public HospitalSimulationModel(DateTime startTime, DateTime endTime)
            : base(startTime, endTime)
        {
            //--------------------------------------------------------------------------------------------------
            // Create Tree
            //--------------------------------------------------------------------------------------------------

            // hospital
            InputHospital       inputHosptial = new InputHospital();
            ControlUnitHospital hospital      = new ControlUnitHospital("Hospital", null, this, inputHosptial);

            // emergency
            InputEmergency inputEmergency         = new InputEmergency(null);
            ControlUnitEmergencyExample emergency = new ControlUnitEmergencyExample("Emergency", hospital, this, inputEmergency);

            // diagnostics
            //InputDiagnosticsMedium inputDiagnostics = new InputDiagnosticsMedium();
            //ControlUnitSpecialTreatmentModelDiagnostics diagnostics = new ControlUnitSpecialTreatmentModelDiagnostics("Diagnostics",
            //    hospital,
            //    this,
            //    inputDiagnostics.GetSpecialFacilityAdmissionTypes().ToArray(),
            //    inputDiagnostics,
            //    inputDiagnostics);

            ////surgery theatre
            //InputSurgeryTheatre inputSurgeryTheatre = new InputSurgeryTheatre();
            //ControlUnitSpecialTreatmentSurgeryTheatre surgery
            //    = new ControlUnitSpecialTreatmentSurgeryTheatre("SurgeryTheatres",
            //    hospital,
            //    this,
            //    Helpers<TreatmentType>.EmptyArray(),
            //    inputSurgeryTheatre,
            //    inputSurgeryTheatre);

            // outpatient

            #region OutpatientSurgical

            //InputOutpatientMediumSurgical inputOutpatientSurgical = new InputOutpatientMediumSurgical();
            //OutpatientWaitingListControlUnit waitingListOutpatientSurgical = new OutpatientWaitingListControlUnit("OutpatientSurgicalWaitingList",
            //    hospital,
            //    this,
            //    inputOutpatientSurgical,
            //    true,
            //    true);

            //ControlUnitOutpatientMedium outpatientSurgical =
            //    new ControlUnitOutpatientMedium("OutpatientSurgical",
            //                                    hospital,
            //                                    this,
            //                                    inputOutpatientSurgical,
            //                                    waitingListOutpatientSurgical);
            //waitingListOutpatientSurgical.SetParentControlUnit(outpatientSurgical);

            #endregion

            #region OutpatientIntern

            //InputOutpatientMediumIntern inputOutpatientIntern = new InputOutpatientMediumIntern();
            //OutpatientWaitingListControlUnit waitingListOutpatientIntern = new OutpatientWaitingListControlUnit("OutpatientInternWaitingList",
            //    hospital,
            //    this,
            //    inputOutpatientIntern,
            //    true,
            //    true);


            //ControlUnitOutpatientMedium outpatientIntern =
            //    new ControlUnitOutpatientMedium("OutpatientIntern",
            //        hospital,
            //        this,
            //        inputOutpatientIntern,
            //        waitingListOutpatientIntern);
            //waitingListOutpatientIntern.SetParentControlUnit(outpatientIntern);


            #endregion

            //outpatientSurgical.SetChildControlUnits(new ControlUnit[] { waitingListOutpatientSurgical });
            //outpatientIntern.SetChildControlUnits(new ControlUnit[] { waitingListOutpatientIntern });
            //hospital.SetChildControlUnits(new ControlUnit[] { diagnostics, emergency, inpatientSurgical, outpatientSurgical, outpatientIntern, inpatientIntern, surgery });
            //hospital.SetChildControlUnits(new ControlUnit[] {diagnostics, inpatientIntern, inpatientSurgical, emergency, outpatientIntern});
            //hospital.SetChildControlUnits(new ControlUnit[] { waitingListInpatient, inpatient, emergency, diagnostics, waitingListOutpatient, outpatient});
            //hospital.SetChildControlUnits(new ControlUnit[] { waitingListInpatient, inpatient});

            _rootControlUnit = hospital;
        } // end of HosptialSimulationModel
Example #2
0
        /// <summary>
        /// All submodels for emergency, outpatient and diagnostic departments are set
        /// </summary>
        /// <param name="startTime">Start time of simulation</param>
        /// <param name="endTime">End time of simulation</param>
        public HospitalSimulationModelWithVisualization(DateTime startTime, DateTime endTime)
            : base(startTime, endTime)
        {
            XmlSerializer deserializer = new XmlSerializer(typeof(XMLInputHealthCareWithWaitingList));

            string projectDirectory = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.Parent.FullName;

            //--------------------------------------------------------------------------------------------------
            // Create Tree
            //--------------------------------------------------------------------------------------------------

            #region Hospital

            // hospital
            InputHospital inputHosptial = new InputHospital();
            hospital = new ControlUnitHospital("Hospital", null, this, inputHosptial);

            #endregion

            #region Emergency

            // emergency
            string     emergencyInputFile = projectDirectory + "\\SampleHospitalModel\\Input\\XMLEmergencySampleInput.xml";
            TextReader textReader         = new StreamReader(emergencyInputFile);

            XmlSerializer emergencyDeserializer            = new XmlSerializer(typeof(XMLInputHealthCareDepartment));
            XMLInputHealthCareDepartment emergencyXMLInput = (XMLInputHealthCareDepartment)emergencyDeserializer.Deserialize(textReader);

            InputEmergency inputEmergency = new InputEmergency(emergencyXMLInput);
            emergency = new ControlUnitEmergencyExample("Emergency", hospital, this, inputEmergency);

            triageRegisterOrgUnit = new ControlUnitEmergencyRegisterTriage("OrgUnitTriageRegister", emergency, emergency, this, inputEmergency);
            surgicalOrgUnit       = new ContorlUnitAssessmentTreatmentExample("OrgUnitSurgical", emergency, emergency, this, inputEmergency);
            internalOrgUnit       = new ContorlUnitAssessmentTreatmentExample("OrgUnitInternal", emergency, emergency, this, inputEmergency);

            emergency.SetChildOrganizationalControls(new ControlUnitOrganizationalUnit[] { triageRegisterOrgUnit, surgicalOrgUnit, internalOrgUnit });


            #endregion

            #region Diagnostics

            // diagnostics
            string diagnosticsInputFile = projectDirectory + "\\SampleHospitalModel\\Input\\XMLSampleInputDiagnostics.xml";
            textReader = new StreamReader(diagnosticsInputFile);

            XMLInputHealthCareWithWaitingList diagnosticsXMLInput = (XMLInputHealthCareWithWaitingList)deserializer.Deserialize(textReader);

            InputDiagnostics inputDiagnostics = new InputDiagnostics(diagnosticsXMLInput);
            diagnostics =
                new ControlUnitSpecialTreatmentModelDiagnostics("Diagnostics",
                                                                hospital,
                                                                this,
                                                                inputDiagnostics.GetAdmissionTypes().ToArray(),
                                                                inputDiagnostics.GetWaitingListSchedule(),
                                                                inputDiagnostics);

            #endregion

            #region OutpatientSurgical

            string outpatientInputFile = projectDirectory + "\\SampleHospitalModel\\Input\\XMLSampleInputOutpatientSurgical.xml";
            textReader = new StreamReader(outpatientInputFile);

            XMLInputHealthCareWithWaitingList outPatientXMLInput      = (XMLInputHealthCareWithWaitingList)deserializer.Deserialize(textReader);
            InputOutpatientMediumSurgical     inputOutpatientSurgical = new InputOutpatientMediumSurgical(outPatientXMLInput);

            waitingListOutpatientSurgical =
                new OutpatientWaitingListSingleScheduleControl(
                    "OutpatientSurgicalWaitingList",
                    hospital,
                    this,
                    inputOutpatientSurgical,
                    true);


            outpatientSurgical =
                new ControlUnitOutpatientMedium("OutpatientSurgical",
                                                hospital,
                                                this,
                                                inputOutpatientSurgical,
                                                waitingListOutpatientSurgical);
            waitingListOutpatientSurgical.SetParentControlUnit(outpatientSurgical);
            outpatientSurgical.SetChildControlUnits(new ControlUnit[] { waitingListOutpatientSurgical });

            #endregion

            hospital.SetChildControlUnits(new ControlUnit[] { emergency, outpatientSurgical, diagnostics });

            _rootControlUnit = hospital;
        } // end of