Agents Interaction Modelling with

Abdul Samad Shibghatullah 59 30052008 b Duty Agent DA A DA corresponds to a duty that results in the loss of its driver because of UE such as lateness, delay, or unavailable. A DA’s objective is to find a driver that will drive the duty. A DA’s responsibility is to make sure that a crew takes the duty. Table 3.2 illustrates the attributes for a DA. Table 3.1: The Attributes for CA Name Description Crew ID Identification number for a crew Route Number The route number that was assigned to the crew Duty Number The duty number that was assigned to the crew Sign-On Time The time the crew should sign-on at garage. Start Work 1 Time The starting time for the crew first piece of work. Finish Work 1 Time The finishing time for the crew first piece of work. Start Break Time The starting time for the break. Finish Break Time The finishing time for the break. Start Work 2 Time The starting time for the crew second piece of work. Finish Work 2 Time The finishing time for the crew second piece of work. Sign-Off Time The sign-off time for the crew at garage. Status To indicate the status of a crew for the purpose of rescheduling, 0 if not available and 1 if available. Table 3.2: The Attributes for DA Name Description Route No Number for the route Duty No Number of the duty Start Time The start time for the duty to be covered. End Time The end time for the duty to be covered Total Time Total time that need to be covered Minimum Required Time A minimum required time to cover the duty. Late Crew Ready Time The time when the late-crew is ready.

3.4.2 Agents Interaction

A MAS achieves its objectives through interactions between agents. In the proposed architecture, agents interact in a virtual world in which agents representing available resources negotiate with agents representing demands for resources until a satisfactory matching is achieved. Agents interact by exchanging messages of various types Odell et al., 2000. Each message type conveys certain semantics associated to a particular task. Each time an agent receives a message, it immediately knows what reasoning procedure it must activate in order to set up the most appropriate answer or action, or Abdul Samad Shibghatullah 60 30052008 what kind of update it has to perform in its domain specific knowledge. Table 3.3 provides a list of these messages, together with a short description of them. Table 3.3: Message Passed in Agents Interaction Message Type Sender Receiver Description reqDriver DA CA Sent whenever a duty needs a driver. respond CA DA Sent as soon as a crew received a request from a duty. detailsSpecs DA CA It conveys information about the details specification of a duty. beginMatching CA DA Sent to initiate a negotiation noMatch DA CA Sent to inform that there is no match because the crew does not fulfill the duty’s requirement. reserved DA CA Sent to inform that the crew is reserved to take the duty. acceptMatch DA CA Sent to inform that the crew is accepted to take the duty. declineReservation DA CA Sent to inform that the crew reservation is rejected because there is other crew that is more suitable to take the duty. DA CA1 CA2 CAn reqDriver reqDriver reqDriver respond respond respond detailsSpec detailsSpec detailsSpec beginMatching beginMatching reserved reserved acceptMatch declineReservation Figure 3.7: Sequence of Messages when Match is Found The matching process is initiated by a demand agent, which in this case is a duty agent DA. Figure 3.7, 3.8 and 3.9 show the sequence of messages in different scenarios of matching process between DA and CA. Figure 3.7 shows the sequence of messages Abdul Samad Shibghatullah 61 30052008 between a DA and CAs in the scenario when there is a match. It starts when a DA needs a driver crew to take hisher duty because the original driver is late or not available. The DA sends messages to all the CAs requesting a driver reqDriver message. In return, CAs will respond to the DA respond message. Then the DA sends detailed specifications of the duty detailsSpec message. CAs that are available in this case CA2 and CAn for the duty will respond and matching will start beginMatching message. If the CA matches the requirement, then DA will put CA into reserved reserved message. DA will continue the matching process with the next CA and put CA into reserved if it fulfils the requirement. After all negotiation, DA will make the decision to choose the best option. The one that is chosen in this case CAn will receive an acceptance message from DA acceptMatch message. In regards to the rest of the CAs in reservation, the DA will send a rejection message declineReservation message. Figure 3.8 shows the same scenario with the only difference that there is no match because all CAs which are available in this case CA2 and CAn do not satisfy requirements. When CA details do not match a DA’s requirements, the DA will send noMatch message to the CA. DA CA1 CA2 CAn reqDriver reqDriver reqDriver respond respond respond detailsSpec detailsSpec detailsSpec beginMatching beginMatching noMatch noMatch Figure 3.8: Sequence of Messages when No Match is Found Abdul Samad Shibghatullah 62 30052008 DAn CA1 CA2 CAn reqDriver reqDriver reqDriver respond respond respond detailsSpec detailsSpec detailsSpec beginMatching beginMatching reserved reserved acceptMatch declineReservation DA2 DA1 reqDriver reqDriver reqDriver respond respond respond detailsSpec detailsSpec detailsSpec beginMatching beginMatching reserved reserved acceptMatch declineReservation reqDriver reqDriver reqDriver respond respond respond detailsSpec detailsSpec detailsSpec beginMatching reserved acceptMatch Figure 3.9: Sequence of Messages for Multiple Matches Abdul Samad Shibghatullah 63 30052008 The two examples in Figure 3.7 and Figure 3.8 show only one DA is involved. However, Figure 3.9 shows the sequence of messages when more than one DA needs drivers. In this scenario, three DAs DA1, DA2 and DAn need to find CAs that could take their duties. The matching process takes place in turn between all the DAs. It starts with DA1, then DA2, and finally DAn. The matching process and message passing is the same as described before. The only difference is that the process takes longer. In this example, CAn, CA2, and CA1 match DA1, DA2 and DAn respectively.

3.5 Summary