Пример #1
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
Пример #2
0
        //--------------------------------------------------------------------------------------------------
        //  Constructor
        //--------------------------------------------------------------------------------------------------

        #region Constructor

        /// <summary>
        /// Basic contructor
        /// </summary>
        /// <param name="xmlInput">Xml input that defines most of input</param>
        public InputEmergency(XMLInputHealthCareDepartment xmlInput) : base(xmlInput)
        {
        } // end of InputEmergencyMedium