Example #1
0
        /* -------------------------------------------------------------------------------- */
        /* ----------------------------- CONSTRUCTORS & SET-UP ---------------------------- */
        /* -------------------------------------------------------------------------------- */



        // !!! CONSTRUCTOR !!!
        public Worker(KanbanDbModel kdb, ExperienceLevel_t experienceLevel, int minutesPerSecond)
        {
            this.experienceLevel  = experienceLevel;
            this.minutesPerSecond = minutesPerSecond;
            this.fogLampsToMake   = 0;
            this.fogLampsMade     = 0;
            this.kdb  = kdb;
            this.rand = new Random();

            // Set up the workstation
            // If it cannot be setup, set our boolean to false so that external program knows
            // that no Worker is present
            if (this.setupWorkstation())
            {
                this.isAtWorkstation = true;
            }
            else
            {
                this.isAtWorkstation = false;
            }
        }
Example #2
0
        //Creates a worker object and assigns appropriate values to begin the simulation
        private void startBtn_Click(object sender, EventArgs e)
        {
            ExperienceLevel_t exp = ExperienceLevel_t.Experienced;

            if (workerExperienceBox.SelectedIndex == 0)
            {
                exp = ExperienceLevel_t.Rookie;
            }
            else if (workerExperienceBox.SelectedIndex == 1)
            {
                exp = ExperienceLevel_t.Experienced;
            }
            else
            {
                exp = ExperienceLevel_t.Senior;
            }
            worker = new Worker(this.kdb, exp, 2);

            thread = new Thread(RunSim);
            thread.Start();

            stopBtn.Enabled  = true;
            startBtn.Enabled = false;
        }