/// <summary> /// Receive message from other agents /// </summary> /// <param name="from">Transmitter agent</param> /// <param name="target">Receiver agent type</param> /// <param name="msgText">Message text in string</param> /// <param name="info">Additional parameter</param> protected override void OnMessageReceived(object from, Type target, string msgText, params object[] info) { switch (msgText) { case "RequestStandBy": position = AMBULANCE_POSITION.StagingArea; break; case "DispatchAmbulance": // Ambulance dispatch request from staging area to MCI field position = AMBULANCE_POSITION.Field; // Go to MCI field SendMessage(typeof(EMSVehicle), "FieldArrivalReport"); break; case "RequestPatientTransfer": // Transport patient Patient p = (Patient)info[0]; SendMessage(typeof(Hospital), "DispatchPatient", p); SendMessage(typeof(EMSVehicle), "TransferComplete"); position = AMBULANCE_POSITION.StagingArea; break; default: break; } }