Ejemplo n.º 1
0
        //method that is invoked whenever the OnFinishSimulation event occur
        public void SimulationFinish(object theSimulationObject, SimulationInfoEventArgs si)
        {
            //defining model temporary variables
            CareUnit icuCareUnit;

            icuCareUnit = (CareUnit)beds;
            float bedOccupancyRate;

            //results for run
            bedOccupancyRate = totalBedsUtilisation;
            bedOccupancyRate = bedOccupancyRate / (RunDuration * icuCareUnit.InitialValue * NumberOfRuns);
            if (bedOccupancyRate > 1)
            {
                bedOccupancyRate = 1;
            }
            Console.WriteLine();
            Console.WriteLine("=======================================================");
            Console.WriteLine("Summary Results (average) for {0} run(s)", NumberOfRuns);
            Console.WriteLine("=======================================================");
            Console.WriteLine("Emergency Arrivals: \t\t\t{0}",
                              totalEmergencyArrivals / NumberOfRuns);
            Console.WriteLine("Elective Arrivals: \t\t\t{0}",
                              totalElectiveArrivals / NumberOfRuns);
            Console.WriteLine("Emergency Transfers: \t\t\t{0}",
                              totalEmergencyTransfers / NumberOfRuns);
            Console.WriteLine("Elective Deferrals: \t\t\t{0}",
                              totalElectiveDeferrals / NumberOfRuns);
            Console.WriteLine("Bed Occupancy Rate: \t\t\t{0:P2}", bedOccupancyRate);
            Console.WriteLine("=======================================================");
            Console.WriteLine("=======================================================");
            Console.WriteLine();
            Console.WriteLine();
        }
Ejemplo n.º 2
0
        // event(s)
        // constructor(s)
        // method(s)

        //method that is invoked whenever the OnStartSimulation event occur
        public void SimulationStart(object theSimulationObject, SimulationInfoEventArgs si)
        {
            totalEmergencyArrivals  = 0;
            totalElectiveArrivals   = 0;
            totalEmergencyTransfers = 0;
            totalElectiveDeferrals  = 0;
            totalBedsUtilisation    = 0;
        }
Ejemplo n.º 3
0
        //method that is invoked whenever the OnFinishRun event occur
        public void RunFinished(object theSimulationObject, SimulationInfoEventArgs si)
        {
            //defining model temporary variables
            CareUnit icuCareUnit;

            icuCareUnit = (CareUnit)beds;
            PatientGroup electivePatientGroup;

            electivePatientGroup = (PatientGroup)electiveArrivalMachine;
            PatientGroup emergencyPatientGroup;

            emergencyPatientGroup = (PatientGroup)emergencyArrivalMachine;
            float bedOccupancyRate;

            //results for run
            bedOccupancyRate = icuCareUnit.Utilisation;
            bedOccupancyRate = bedOccupancyRate / (RunDuration * icuCareUnit.InitialValue);
            if (bedOccupancyRate > 1)
            {
                bedOccupancyRate = 1;
            }
            Console.WriteLine("-------------------------------------------------------");
            Console.WriteLine("Results for Run {0} of {1}", si.currentRun, NumberOfRuns);
            Console.WriteLine("-------------------------------------------------------");
            Console.WriteLine("Number of Emergency Arrivals: \t\t{0}", emergencyPatientGroup.NumberOfArrivals);
            Console.WriteLine("Number of Elective Arrivals: \t\t{0}", electivePatientGroup.NumberOfArrivals);
            Console.WriteLine("Number of (Emergency) Transfers: \t{0}",
                              emergencyPatientGroup.NumberOfPatientsDeferred);
            Console.WriteLine("Number of (Elective) Deferrals: \t{0}",
                              electivePatientGroup.NumberOfPatientsDeferred);
            Console.WriteLine("Utilisation (of Beds): \t\t\t{0} (hours)", icuCareUnit.Utilisation);
            Console.WriteLine("Availability (of Beds): \t\t{0} (hours)",
                              (RunDuration * icuCareUnit.InitialValue));

            Console.WriteLine("Bed Occupancy Rate: \t\t\t{0:P2}", bedOccupancyRate);

            totalEmergencyArrivals  += emergencyPatientGroup.NumberOfArrivals;
            totalElectiveArrivals   += electivePatientGroup.NumberOfArrivals;
            totalEmergencyTransfers += emergencyPatientGroup.NumberOfPatientsDeferred;
            totalElectiveDeferrals  += electivePatientGroup.NumberOfPatientsDeferred;
            totalBedsUtilisation    += icuCareUnit.Utilisation;
        }
Ejemplo n.º 4
0
        //method that is invoked whenever the OnStartRun event occur
        public void RunStart(object theSimulationObject, SimulationInfoEventArgs si)
        {
            //defining model temporary variables
            CareUnit icuCareUnit;

            icuCareUnit = (CareUnit)beds;
            PatientGroup electivePatientGroup;

            electivePatientGroup = (PatientGroup)electiveArrivalMachine;
            PatientGroup emergencyPatientGroup;

            emergencyPatientGroup = (PatientGroup)emergencyArrivalMachine;
            // reinitialising model variables
            theSimulation.Technique.Schedule(ref emergencyArrivalMachine, emergencyArrive, 0);
            theSimulation.Technique.Schedule(ref electiveArrivalMachine, electiveArrive, 0);
            emergencyPatientGroup.NumberOfArrivals         = 0;
            emergencyPatientGroup.NumberOfPatientsDeferred = 0;
            emergencyPatientGroup.NumberOfPatientsInQueue  = 0;
            electivePatientGroup.NumberOfArrivals          = 0;
            electivePatientGroup.NumberOfPatientsDeferred  = 0;
            electivePatientGroup.NumberOfPatientsInQueue   = 0;
            icuCareUnit.Count       = icuCareUnit.InitialValue;
            icuCareUnit.Utilisation = 0;
        }
Ejemplo n.º 5
0
 //method that is invoked whenever the CompletionThreePhases event occur
 public void CompletionThreePhases(object theSimulationObject, SimulationInfoEventArgs si)
 {
     //Console.WriteLine ("ST {0}", si.time);
 }