/// <summary> /// Select next task /// first from tasks in progress /// then from tasks to do /// </summary> /// <returns>the next task to work on</returns> public SymuTask SelectNextTask(ushort step) { // First check new messages if (SelectNextMessage(CommunicationMediums.FaceToFace, out var symuTask)) { return(symuTask); } if (SelectNextMessage(CommunicationMediums.Irc, out symuTask)) { return(symuTask); } if (SelectNextMessage(CommunicationMediums.Phone, out symuTask)) { return(symuTask); } if (SelectNextMessage(CommunicationMediums.Meeting, out symuTask)) { return(symuTask); } if (SelectNextMessage(CommunicationMediums.Email, out symuTask)) { return(symuTask); } if (SelectNextMessage(CommunicationMediums.ViaAPlatform, out symuTask)) { return(symuTask); } // First push new tasks to do in progress depending of the multi tasking model of the agent while (ToDo.Any() && !HasReachedSimultaneousMaximumLimit) { var task = PrioritizeNextTask(ToDo); SetInProgress(task); } // Then check tasks already in progress but non blocked today return(PrioritizeNextTask(GetTasksInProgress(step))); }