crisis_0

Embed Size (px)

Citation preview

  • 8/7/2019 crisis_0

    1/17

    The INGENIAS Development Kit: a practical

    application for crisis-management

    Ivan Garca-Magarino, Celia Gutierrez, and Ruben Fuentes-Fernandez

    D. Software Engineering and Artificial IntelligenceFacultad de Informatica

    Universidad Complutense de Madrid, Spainivan [email protected], [email protected], [email protected]

    Abstract. The INGENIAS Development Kit (IDK) supports the devel-opment of fully functional Multi-agent Systems (MASs) from specifica-tion models, following a model-driven approach. This paper presents a

    practical application about crisis-management, in order to provide a fullexample of application of the IDK tool; and consequently, the specifica-tion and the code of this system are included in the IDK 2.8 distribu-tion. The presented application manages the crisis situation of a city, inwhich, a poisonous material is released, and the central services are notenough to heal all the affected people. The software engineering processof the presented MAS application covers the following phases: specifi-cation, model design, implementation, and testing. Both the number ofinteractions and the number of participants are economized in order toincrease the network efficiency, due to the real-time necessity of the MASapplication.

    1 IntroductionThe INGENIAS Development Kit (IDK) [2] allows practitioners to create Multi-agent Systems (MASs) by defining specification models and generating the pro-gramming code. The goals of this work is to present a practical application of thelast IDK distribution (2.8). For this purpose, a crisis-management case study isselected, and a solution is proposed. The presented MAS is included in the IDK2.8 distribution, which can be downloaded from Grasiaweb1.

    In the crisis-management [1] case study, a poisonous material has been acci-dentally released into a city. The number of affected people is very high to bemanaged only with a centralized solution. The official medical services are notenough to heal all the affected people. Thus, a distributed solution is necessary,and the collaboration among the people on the ground is also necessary.

    The presented solution is based on the following facts: the citizens with med-ical capabilities can help affected citizens who are close enough; the citizens canbe quickly warned of the poison-affected locations to avoid them; the centralofficial system must be informed of all the poison-affected locations; the com-munications should be efficient. Therefore, the three goals of the presented MAS

    1 http://grasia.fdi.ucm.es (in Software INGENIAS Development Kit)

  • 8/7/2019 crisis_0

    2/17

    2 I. Garca-Magarino, C. Gutierrez, R. Fuentes-Fernandez

    are: to coordinate citizens, to keep the network efficiency, and to inform thecentral services.

    The next section describes the requirements of the presented MAS applicationfor crisis-management; and Section 3 describes the most relevant aspects of theother stages of the process for creating the practical application. Section 4 brieflypresents some experimental results. Finally, Section 5 indicates the conclusions;and an annex with further details of the practical application can be downloadedfrom Grasia web2.

    2 Requirements

    The requirements of the case study are formalized with use cases in the Mai-nUseCases diagram (see Figure 1). The first use case is called Coordination-ForHelpingEachOtherUC. The goal of this use case is the coordination among

    the people on the ground, so they can help each other. The people on the groundwith medical capabilities offer help, and the poisoned people ask for help.

    Fig. 1. Main use-cases diagram.

    The second use case, which is called InformCentralServicesUC, informs thecentral services of the poison-affected locations. The InformCentralServicesUCuse case is included in the CoordinationForHelpingEachOtherUC use case, be-cause the coordination among people on the ground includes to report the poison-affected locations to the central services. This makes it possible that the centralservices can assist areas with many affected locations.

    Both mentioned use cases employ the network for communication. The per-formance of the communication is crucial due to the urgency of the crisis sit-uation; thus, a participant for managing the network is included in both usecases. The network-participant is the intermediator in the communications, andits goal is to improve the efficiency of the communication.

    3 The MAS for managing the Crisis-situation

    The presented MAS satisfies the requirements mentioned at Section 2, with thefollowing kinds of agents: coordination-agents, network-agents and information-agent. The coordination-agents are responsible for the coordination among the

    2 http://grasia.fdi.ucm.es (in Software Additional Material for Papers)

  • 8/7/2019 crisis_0

    3/17

    The IDK: A practical application for crisis-management 3

    people on the ground. Each mobile device of the people on the ground is habitedby a coordination-agent. Each user interacts with a coordination-agent. The

    network-agents are in charge of the proper communication among the otherkinds of agents. The information-agentorganizes the poison-affected locationsand shows them to the central official services.

    3.1 Main design decisions

    Amongst other concepts, INGENIAS methodology uses roles, goals, mental statesand interactions. The following sub-sections describes the most relevant designdecisions related to these concepts.

    Fig. 2. Role and agent definitions of the presented MAS.

    Roles and goals The roles (see Figure 2) of the presented MAS are the follow-

    ing. Coordinator Role (i.e CoordinatorR). Several agents play this role, and each

    user can interact with one of them. The goal of the coordination-agents is tocoordinate the people on the ground, so they can help each other; and theyalso can warn each other of the poison-affected locations.

    Network Role (i.e NetworkR). Several agents play this role. The network-agents are the intermediators for the communications in the presented MAS.The goals of this role is to isolate the possible communication problems andto improve the network efficiency.

    Information Role (i.e InformationR). Only one agent plays this role, and itsgoal is to inform of the poison-affected locations to the central services.

    Mental States The mental state of a coordination-agent contains both the lo-cation in the city and the state of the corresponding user. The user state can beany of the following values: need-help, can-help, being-helped, helping. The men-tal state of the information-agent contains a city map with the poison-affectedlocations. The network-agent mental states only contains the facts necessary forthe communications. The initial mental states are shown at Figure 2.

  • 8/7/2019 crisis_0

    4/17

    4 I. Garca-Magarino, C. Gutierrez, R. Fuentes-Fernandez

    Interactions The user can both offer help, if the user has medical capabilities,and ask for help, if the user gets poisoned. In case of poisoning, the coordination-

    agent interacts with the network-agent with the Coordinator-networkerinterac-tion. In case of receiving a message of poisoning, the network-agent is responsiblefor three operations. Firstly, the network-agent must look for help around thepoison-affected location, among other citizens, through the coordination-agents.Secondly, the network-agent must warn other citizens through the coordination-agents. Finally, the network-agent must report the poison-affected location tothe information-agent. The first and second operations are achieved with theNetworker-coordinatorinteraction; whereas the third is achieved with the Networker-informerinteraction.

    In all the communications, a network-agent is the intermediate for isolatingnetwork problems. Therefore, the communication between people on the groundinvolves two interactions, a Coordinator-networker interaction, and a Networker-

    Coordination interaction. The communication between a person on the groundand the information central system involves two interactions, the Coordinator-networker interaction and the Networker-Information interaction.

    In order to economize interactions, one communication among citizens satis-fies two necessities: to ask for help around the affected location; and to warn othercitizens of the affected location. In this application, a citizen only reports the ne-cessity of help when being poisoned. This message is delivered to the coordinator-agents of the other citizens, and only the two following cases are possible: thereceiver can help the requester and, in this case, the receiver coordination-agentask its user to go to assist the requester citizen; otherwise, the receiver cannothelp the poisoned person and, in this case, the receiver coordination-agent warnsits user of the poison-affected location. Therefore, the same interaction are used

    for both warning and asking for help.

    An alternative would be to use different interactions for each necessity. How-ever, the current approach has a fewer number of interactions than the alterna-tive and, consequently, increases the efficiency of the network.

    Fig. 3. Networker-coordinator protocol.

  • 8/7/2019 crisis_0

    5/17

    The IDK: A practical application for crisis-management 5

    In the search for help, there can be several people on the ground that canassist the same affected person. In this case, the network-agent only asks one

    of the coordination-agents to come, so the remaining people with medical ca-pabilities can help other poisoned people. Thus, in the interaction protocol (seeFigure 3), firstly, the networker asks for help to all the coordinators. Then, allthe coordinators answer whether they can help or not. Finally, the networkeronly asks one coordinator to come.

    An interaction is shared between the two necessary communications: amongpeople in the ground; and between an affected person and the central informationsystem. Both communications share the first interaction, called Coordinator-networker interaction, in which a coordinator-agent requests help to the network-agent. Then, the network-agent initiates two interactions, which respectivelycompletes the two communications and are called Networker-coordinator andNetworker-information. Since an interaction is shared, the number of interactions

    is fewer without changing the functionality, and the network efficiency increases.

    Participants of the Interactions The INGENIAS Agent Framework(IAF)adds certain participant for one-to-one and one-to-many interactions, by default.However, the selection of participants can be tuned for special needs.

    For instance, a coordinator-agent establishes the interaction with one network-agent, when requesting for help. By default, the first network-agent is alwaysselected in this one-to-one interaction. However, this default behavior makes thefirst network-agent get collapsed while it makes the other network-agents be iso-lated. For this reason, in this MAS, the same number of coordination-agents and

    network-agents are instantiated, and each coordination-agent is associated witha different network-agent for the communication. In case a coordination-agentcannot contact the associated network-agent, the coordination-agent randomlyselects another network-agent. This policy increases the reliability and the effi-ciency (see Section 4) of the system because the first network-agent does not getcollapsed as in the default behavior.

    A network-agent can search for a coordination-agent that can help a requestercoordination-agent. In this search, the network-agent initiates a one-to-manyinteraction. The default behavior is to add all the coordination-agents to theinteraction. However, the default behavior is not the most appropriate for thefollowing reason. The requester coordination-agent is also asked for help. Therequester should not receive its own message, because it is not necessary and theunnecessary messages make the network efficiency lower. The selected policy forthe Networker-coordinator interaction is the following: a network-agent searchesfor help for a requester coordination-agent, and the network-agent initiates aconversation with all the coordination-agents but the requester. In this man-ner, the unnecessary messages and unnecessary collaborators in the interactionsare avoided. Thus, the efficiency (see Section 4) is increased above the defaultbehavior.

  • 8/7/2019 crisis_0

    6/17

    6 I. Garca-Magarino, C. Gutierrez, R. Fuentes-Fernandez

    Tasks A group of tasks is the responsible for reacting to the events gener-ated by the people on the ground. A person on the ground can generate several

    events from the Graphical User Interface (GUI) provided by the correspondingcoordination-agent, and these events are need-help, can-help, update-locationornone. For all the mentioned events, the corresponding task consumes the event,and updates the mental state of the coordination-agent. In particular, for theneed-help event, the corresponding task launches a Coordinator-networker con-versation to ask for help.

    Another group of tasks is associated to the Coordinator-networker interac-tion and transfers the information of the requester (the agent ID3, and its loca-tion). The most relevant task is the CNNHelpTtask, which receives a requestfor help and is executed by the network-agent. This task launches two differ-ent conversations, whose goals are respectively to search for help from othercoordination-agent and to inform the information-agent of the new affected lo-cation. In addition, within the coordination-network interaction, some tasks arethe responsible for bringing back the response to the requester agent. The re-sponse indicates whether help is found. If help is found, the response containsthe ID of the coordination-agent whose user is coming to help the poisoned user.

    Another group of tasks is associated to the Networker-coordinator interac-tion, which is related to the search of help. Firstly, the network-agent deliversa frame fact, called NCHelpFF, requesting help to all the coordination-agents.This NCHelpFF frame fact contains the requester agent ID and its location. TheNCCHelpTtask is associated with the reception of the mentioned frame fact.This task checks out whether the corresponding user can heal the poisonousmaterial effects, by consulting the coordination-agent mental state. Then, if theuser has medical capabilities, the distance between the requester user and thehelper user is calculated. If both users are close enough, the response is positive.

    The network-agent executes another task that manages all the responses andrequests one user, at most, to come for helping.

    Finally, some tasks are the responsible for the transfer of the new poison-affected location to the information-agent. One of these tasks updates the citymap of the poison-affected locations in the information-agent mental state andshows the map with a GUI.

    3.2 Implementation

    The presented MAS implementation is available at IDK 2.8 distribution. A fullyfunctional implementation skeleton is generated with IAF code generator and,then, the skeleton is manually completed with programming code for the content

    of tasks, the GUIs and other components.Figure 4 shows an example of execution, in which, four people on the ground

    use the presented MAS. The CoordA 1 and CoordA 3 users have medical ca-pabilities; thus, they press the Can Help button. The CoordA 0 user gets af-fected by the poisonous material; thus, he presses the Need Help button. The

    3 Agent identifier name, which is unique in the MAS.

  • 8/7/2019 crisis_0

    7/17

    The IDK: A practical application for crisis-management 7

    MAS starts to coordinate and inform the central system. CoordA 1 can helpCoordA 0 because of two conditions: CoordA 1 has medical capabilities and is

    close enough to CoordA 0 (look at the locations in Figure 4). On the contrary, noother coordination-agent satisfies the same conditions. The response is sent backto CoordA 0 with the following message, CoordA 1 is coming to help you. Theother people on the ground are warned of the new poison-affected location withthe following message, Alert! Infection in (0,3). Avoid this location. Finally,the city map of the central services is updated. The new affected location (0,3)is indicated in the information GUI with a different background color.

    Fig. 4. Example of execution.

    3.3 Testing

    The presented MAS includes a battery of tests (see the Annex in Grasiaweb),which are modeled with INGENIAS methodology. The first test, which is calledGeneralTest, checks out several functionalities by initializing the MAS with thesame values of the execution example (see Figure 4). In this case, a citizenrequests for help, and there are other three citizens. One of them is too farfor helping the requester. The second one has not medical capabilities, and thethird one is close enough and has medical capabilities. This test checks that acitizen is asked to come for helping when the citizen satisfy two conditions: thecitizen must be close enough to the requester; the citizen must have medicalcapabilities. Moreover, the GeneralTest also checks out the information of thecentral services, by checking the poison-affected locations of the map at the endof the execution.

    The second test, which is called OnlyOneComesTest, is initialized with sev-eral people on the ground with medical capabilities (a deployment called Sev-eralDoctors). In this test, an agent asks for help, and there are several citizenswith medical capabilities nearby. Thus, there are several citizen that satisfy the

  • 8/7/2019 crisis_0

    8/17

    8 I. Garca-Magarino, C. Gutierrez, R. Fuentes-Fernandez

    necessary conditions for helping the requester. The tests checks that only onecitizen is asked to go for healing the requester.

    4 Experimental Results

    The system was run in a JADE platform with several deployments (i.e. withnine agents and twenty-one agents), and several selection-mechanisms of partic-ipants (i.e. default selectionand presented selection). In these experiments, allthe users simultaneously either offered help or asked for help, several times. Thisexperiment measured the latency between the moment a user asks for help andthe moment the system replies after the coordination process. The average ofthese latency-times is presented in Table 1. As one can observe, the presentedselection strategy for participants increases the performance. This increment ofperformance is higher when more agents are running (for instance, latencies of

    13,9 seconds and 5,4 seconds respectively for default selection and presentedselection, when running 21 agents).

    Default Selection Presented Selection

    9 agents 2069 ms 1928 ms21 agents 13890 ms 5354 ms

    Table 1. Latency-times in mili-seconds.

    5 Conclusions

    On the whole, a MAS is developed with the IDK tool from the specificationto the testing for managing crisis-situations in a city, in order to illustrate theuse of the IDK tool. Practitioners can download the IDK 2.8 distribution toexperiment with both the IDK tool and the presented practical application.

    Acknowledgements. This work has been supported by the research projectsTIN2005-08501-C03-01 and TIN2008-06464-C03-01, funded by the Spanish Coun-cil for Science and Technology.

    References

    1. AgentLink. Multi-agent Systems in Crisis Management: The Combined Systems.Case Study, December 2005.

    2. Jorge J. Gomez-Sanz, Ruben Fuentes-Fernandez, Juan Pavon, and Ivan Garca-Magarino. INGENIAS Development Kit: a visual multi-agent system developmentenvironment (Awarded as Best Academic Demo of AAMAS08). In The SeventhInternational Conference on Autonomous Agents and Multiagent Systems, AA-

    MAS08, pages 16751676. ACM, 2008. May 12-16, 2008, Estoril Portugal.

  • 8/7/2019 crisis_0

    9/17

    The IDK: A practical application for crisis-management 9

    THE FOLLOWING ANNEX IS NOT PART OF THE PAPER. IT

    IS ONLY INCLUDED HERE TO FACILITATE THE REVIEWING

    PROCESS, IN CASE ANY REVIEWER WANTS TO CONSULT IT.THIS ANNEX IS AVAILABLE IN GRASIA WEB AND WILL BE

    REMOVED FROM THIS PAPER FOR ITS FINAL VERSION.

    A Further details of the MAS

    The whole specification and the necessary source code are available within theIDK 2.8 distribution, which is available in Grasiaweb4. The specification canbe opened from IDK editor. The IAF code generator can regenerate the code.For further instructions, consult the IAF Manual at Grasiaweb5.

    The MAS can be executed in stand alone version with ant runSimpleProd-StandAlone command or any of the startscripts. Otherwise, two commands

    must be executed in two different consoles. These two commands are the fol-lowing, ant runjadeSimple and ant runSimple. In this case, you can see the jadeplatform and the INGENIAS console. In this manner, the execution of the MAScan be monitored.

    The whole specification is located in workspace/crisis/spec/specification.xmlwithin the IDK 2.8 distribution. However, the most relevant parts of the specifi-cation are shown in this annex section. Figure 5 indicates the relevant INGENIASnotation to understand this annex.

    The specification of the agents is already shown at Figure 2. A group of tasksis responsible for perceiving the people on the ground events and reacting. Thisgroup of tasks are specified in StateTasks diagram (see Figure 6).

    Fig. 5. Legend of the most Relevant INGENIAS Notation.

    The CNIntinteraction is established from the a coordinator-agent to a network-

    agent. The CNInt interaction is defined with the CNDefdiagram (Figure 7). Theprotocol of this interaction is specified with the CNProtocoldiagram (Figure 8).The tasks related to the CNInt interaction are defined within the CNTasks dia-gram (Figure 9).

    4 http://grasia.fdi.ucm.es (in Software INGENIAS Development Kit)5 http://grasia.fdi.ucm.es (in Software INGENIAS Agent Framework)

  • 8/7/2019 crisis_0

    10/17

    10 I. Garca-Magarino, C. Gutierrez, R. Fuentes-Fernandez

    Fig. 6. StateTasks Diagram. This diagram contains tasks for perceiving the user events.All these tasks update the state of the corresponding coordination-agent and its loca-

    tion. The NeedHelpE event has further effects. This event launches a Coordinator-networker conversation.

    Fig. 7. CNDef Diagram. Definition of the Coordinator-networker Interaction.

  • 8/7/2019 crisis_0

    11/17

    The IDK: A practical application for crisis-management 11

    Fig. 8. CNProtocol Diagram. Protocol of the Coordinator-networker Interaction. Thecoordinator-agent asks for help. The network-agent searches for another coordinationagent that can help the requester. After this search, the network-agent responses tothe current coordinator-agent with the search results.

    Fig. 9. CNTasks Diagram. Tasks Related to the Coordinator-networker Interaction.

    When the network-agent receives the help message, two conversations are launched.The first conversation searches for help among other coordination-agents. The secondconversation informs the central services. The response to the current coordinationagent has the following information. Firstly, the response includes whether help isfound or not. If so, the helper identifier is also included.

  • 8/7/2019 crisis_0

    12/17

    12 I. Garca-Magarino, C. Gutierrez, R. Fuentes-Fernandez

    The NCIntis established from a network-agent to several coordination-agents. This interaction searches for help from people on the ground and alerts

    people on the ground. The NCDefdiagram (Figure 10) defines the interaction.The NCProtocoldiagram (already shown in Figure 3) determines its protocol.The NCTasks diagram (Figure 11) contains the tasks associated to the NCIntinteraction.

    Fig. 10. NCDef Diagram. Definition of the Networker-coordinator Interaction. Noticethe following fact. This interaction is different from the interaction of Figure 7.

    The NIIntis established from a network-agent to the information-agent.

    This interaction informs the central service of a new affected location. The NIDefdiagram (Figure 12) defines the interaction. The NIProtocoldiagram (Figure 13)determines its protocol. The NITasks diagram (Figure 14) contains the tasksassociated to the NIInt interaction.

    All the tasks have associated some code in the specification. In addition,the internal applications have some code for initialization. The definition ofthe necessary components for the code are omitted in this annex. This codeis included in the zip format annex.

    Finally, the deployments diagram (see Figure 15) indicates how many agentsare instantiated. There are several deployments for different numbers of users.

    There are two tests. The test components are shown in Figure 16. For thesetests, some specific deployments are needed. The deployment of the GeneralTestand OnlyOneComesTesttests are shown in Figures 17 and 18. Both tests needthe user to press the NeedHelp button of a certain coordinator-agent to startthe MAS cooperation. This fact is indicated properly with a message to the userin the console. For running the tests, two consoles are necessary. In the firstconsole, run the ant runjade command. In the second console, run any of thefollowing commands; ant alljunit, ant junitTestingGeneralor ant junitTestin-gOnlyOneComes.

  • 8/7/2019 crisis_0

    13/17

    The IDK: A practical application for crisis-management 13

    Fig. 11. NCTasks Diagram. Tasks Related to the Networker-coordinator Interaction.These tasks transfer the necessary information. This information is the location of therequester, the requester identifier and the helper identifier. The NCCHelpT task cal-culates the distance from the requester to the current coordination-agent. This taskchecks the current coordination-agent state. According to these operations, this taskanswers to the request. The NCNRespT task continues the conversation with the re-quester communicating the search results by means of the NRespFF frame fact. TheNCCComeT task shows a message in the user application depending on whether thecurrent coordination agent is asked to come or not.

    Fig. 12. NIDef Diagram. Definition of the Networker-informer Interaction.

  • 8/7/2019 crisis_0

    14/17

    14 I. Garca-Magarino, C. Gutierrez, R. Fuentes-Fernandez

    Fig. 13. NIProtocol Diagram. Protocol of the Networker-informer Interaction. Thenetworker indicates the new poison-affected location to the information-agent.

    Fig. 14. NITasks Diagram. Task Related to the Networker-informer Interaction. TheNIDangerT task updates the city map of the poison-affected locations.

    Fig. 15. Deployment Diagram. It contains two deployments called Simple and Seriousrespectively. The Simple deployment initializes four coordination-agents, four network-agents and one information-agent. The Serious deployment initializes ten coordination-agents, ten network-agents and one information-agent.

  • 8/7/2019 crisis_0

    15/17

    The IDK: A practical application for crisis-management 15

    Fig. 16. Components for the tests. The test names are GeneralTestand Only-

    OneComesTest.

    Fig. 17. Deployment for the GeneralTest test. Four coordinator agents are initialized.Two of them have medical capabilities. They are distributed along the city map.

  • 8/7/2019 crisis_0

    16/17

    16 I. Garca-Magarino, C. Gutierrez, R. Fuentes-Fernandez

    Fig. 18. Deployment for the OnlyOneComesTest test. Three coordinator agents areinitialized. Most of them have medical capabilities. They are very close to each other.

    Fig. 19. Additional Coordination-agents Defined for Complex Deployments. These de-ployments are necessary for the testing.

  • 8/7/2019 crisis_0

    17/17

    The IDK: A practical application for crisis-management 17

    In the mentioned deployments for the tests, several coordination-agent areinitialized with different values. For this reason, several additional coordination-

    agents are defined to play CoordinatorR role. The definition of these additionalagents are shown in Figure 19.