protected override void AfterReplication() { OR_RegistrationLength.Add(RegistrationLength.Average); OR_RegistrationWaiting.Add(RegistrationWaiting.Average); OR_RegistrationWorkload.Add(RegistrationRoom.Workload); OR_ExaminationLength.Add(ExaminationLength.Average); OR_ExaminationWaiting.Add(ExaminationWaiting.Average); OR_ExaminationWorkload.Add(ExaminationRoom.Workload); OR_VaccinationLength.Add(VaccinationLength.Average); OR_VaccinationWaiting.Add(VaccinationWaiting.Average); OR_VaccinationWorkload.Add(VaccinationRoom.Workload); OR_WaitingRoomLength.Add(WaitingRoomLength.Average); OR_MissingPatients.Add(NotArrivedPatients); OR_Overtime.Add(ActualSimulationTime - Settings.SimulationTime); var afterRep = GetAfterReplicationValues(); _afterReplicationObservables.Next(afterRep); var afterEvent = GetAfterEventValues(); _afterEventObservables.Next(afterEvent); // ak je pusteny experiment a je dosiahnuta hranična replikacia if (VaccinSettings.DoctorsExperimentEnabled && ActualReplication % VaccinSettings.ExperimentReplications == 0) { // poslanie výsledkov experimentu var results = new DoctorsExperimentValues { DoctorsCount = _currentDoctorsCount, AverageFrontLength = OR_ExaminationLength.Average, AverageFrontWaiting = OR_ExaminationWaiting.Average }; _experimentObservables.Next(results); // pokračovanie v experimente ak je to možne if (_currentDoctorsCount < VaccinSettings.DoctorsMax) { OR_ExaminationLength.Clear(); OR_ExaminationWaiting.Clear(); ++_currentDoctorsCount; ExaminationRoom = new Workplace(_currentDoctorsCount); } } Restart(true); }
private void Init() { SetNotArriveProbability(); RegistrationRoom = new Workplace(VaccinSettings.RegistrationWorkers); if (VaccinSettings.DoctorsExperimentEnabled) { ExaminationRoom = new Workplace(_currentDoctorsCount); } else { ExaminationRoom = new Workplace(VaccinSettings.ExaminationWorkers); } VaccinationRoom = new Workplace(VaccinSettings.VaccinationWorkers); RegistrationFront = new Queue <Patient>(); ExaminationFront = new Queue <Patient>(); VaccinationFront = new Queue <Patient>(); RegistrationWaiting = new DiscreetStatistic(); ExaminationWaiting = new DiscreetStatistic(); VaccinationWaiting = new DiscreetStatistic(); RegistrationLength = new ContinuousStatistic(); ExaminationLength = new ContinuousStatistic(); VaccinationLength = new ContinuousStatistic(); WaitingRoomLength = new ContinuousStatistic(); OR_RegistrationLength = new DiscreetStatistic(); OR_RegistrationWaiting = new DiscreetStatistic(); OR_RegistrationWorkload = new DiscreetStatistic(); OR_ExaminationLength = new DiscreetStatistic(); OR_ExaminationWaiting = new DiscreetStatistic(); OR_ExaminationWorkload = new DiscreetStatistic(); OR_VaccinationLength = new DiscreetStatistic(); OR_VaccinationWaiting = new DiscreetStatistic(); OR_VaccinationWorkload = new DiscreetStatistic(); OR_WaitingRoomLength = new DiscreetStatistic(); OR_MissingPatients = new DiscreetStatistic(); OR_Overtime = new DiscreetStatistic(); AddFirstEvent(); }