override public void InAct() { Console.WriteLine("In " + this.Name + ", Patient number " + CurrentPatient.Index + " Type = " + CurrentPatient.PatientType.Name); SetTCurrForChannels(); if (base.State == 0) { if (CheckFreeChannels() == true) { HospitalChannel hospitalChannel = (HospitalChannel)GetFreeChannel(); hospitalChannel.CurrentPatient = CurrentPatient; hospitalChannel.InAct(); CurrentPatient = null; if (CheckFreeChannels() == false) { base.State = 1; } } base.TNext = GetTNext(); } else { Queue++; PatientsInQueue.Add(CurrentPatient); CurrentPatient = null; } }
override public void InAct() { Console.WriteLine("In " + this.Name + ", Patient number " + CurrentPatient.Index + " Type = " + CurrentPatient.PatientType.Name); switch (CurrentPatient.PatientType.Name) { case "PatientType1": type1PatientsStartTime.Add(CurrentPatient.startTime); break; case "PatientType2": type2PatientsStartTime.Add(CurrentPatient.startTime); break; case "PatientType3": type3PatientsStartTime.Add(CurrentPatient.startTime); break; } ; SetTCurrForChannels(); if (base.State == 0) { if (CheckFreeChannels() == true) { HospitalChannel hospitalChannel = GetFreeChannel(); hospitalChannel.CurrentPatient = CurrentPatient; hospitalChannel.DelayMean = CurrentPatient.PatientType.AvRegisterTime; hospitalChannel.InAct(); CurrentPatient = null; if (CheckFreeChannels() == false) { base.State = 1; } } base.TNext = GetTNext(); } else { Queue++; PatientsInQueue.Add(CurrentPatient); CurrentPatient = null; } }