Grupo GRASIA! http://grasia.fdi.ucm.es Facultad de Informática Universidad Comp

Grupo GRASIA! http://grasia.fdi.ucm.es Facultad de Informática Universidad Complutense de Madrid 28040 Madrid España INGENIAS Agent Framework Development Guide version 1.0 AUTHOR: Jorge J. Gómez-Sanz Introduction This document introduces to the basics needed to produce specifications with the INGENIAS Development Kit's, or IDK, editor which can be processed by the INGENIAS Agent Framework or IAF. The IAF produces native Java code over the JADE platform. It has its own agent architecture, separated from Jade's behavior framework. Scope Readers of this document should be familiar with the INGENIAS Development Kit facilities. Therefore, reading the IDK manual is a must (http://ingenias.sourceforge.net). Other software that should be known by the reader is ant (ant.apache.org) and JADE (http://jade.tilab.com). It is recommended to be familiar with agent theory, in particular with the concepts of Organization, Believes Desires Intention model, agent coordination, and mental state. This document should be read by any one interested in covering the implementation stage of an agent oriented development with INGENIAS. INDEX 1. WHAT IS THE IAF..............................................................................................................................4 1.1. IAF AND THE IDK..............................................................................................................................4 1.2. LOCATION CONVENTIONS.......................................................................................................................4 2. A MAS ACCORDING TO THE IAF...................................................................................................5 2.1. THE LIFECYCLE OF AN IAF AGENT...........................................................................................................5 3. AN AUTOMATICALLY GENERATED CODE DEVELOPMENT PHILOSOPHY .....................6 3.1. WORKING WITH THE IDK AND THE CODE GENERATOR..................................................................................7 4. A PROJECT.........................................................................................................................................8 5. GENERATING THE SPECIFICATION..........................................................................................10 6. MENTAL STATE...............................................................................................................................10 6.1. STRUCTURE OF THE MENTAL STATE.......................................................................................................10 6.2. MENTAL STATE GENERATION...............................................................................................................10 6.3. MENTAL STATE DURING EXECUTION........................................................................................................12 6.4. MENTAL STATE AND CONCURRENCE.......................................................................................................13 7. DEFINING INTERACTIONS...........................................................................................................13 7.1. DESCRIBING A PROTOCOL......................................................................................................................15 7.2. INFORMATION TRANSFER.......................................................................................................................16 7.3. STORING INFORMATION TRANSFERRED......................................................................................................18 7.4. LAUNCHING AN INTERACTION.................................................................................................................18 7.5. STATES OF AN INTERACTION..................................................................................................................19 7.6. MODIFYING CONVERSATIONS.................................................................................................................20 7.7. DEFINING TIMEOUTS............................................................................................................................20 7.8. WHEN AN CONVERSATION IS ABORTED.....................................................................................................21 8. GOALS................................................................................................................................................21 9. TASKS................................................................................................................................................21 9.1. INPUTS.............................................................................................................................................22 9.2. OUTPUTS..........................................................................................................................................23 9.3. GENERATING A TASK CODE...................................................................................................................23 9.4. REFERRING TO OTHER CONVERSATIONS.....................................................................................................23 9.5. TASKS AND MEMORY MANAGEMENT........................................................................................................24 9.6. SELF AWARENESS................................................................................................................................24 9.7. GENERATED CODE OF A TASK................................................................................................................24 9.8. ALLOCATING THE MODIFIED CODE INTO THE SPECIFICATION...........................................................................26 10. INTEGRATING WITH EXTERNAL COMPONENTS.................................................................26 10.1. INITIALIZING AND TERMINATING APPLICATIONS........................................................................................28 10.2. CODE WITHIN THE APPLICATIONS..........................................................................................................29 11. AGENT PERCEPTION...................................................................................................................29 11.1. DEFINING THE PERCEPTION RELATIONSHIP...............................................................................................29 11.2. IMPLEMENTING PERCEPTION.................................................................................................................31 11.3. PERCEPTION IN RUNTIME.....................................................................................................................31 12. CREATING DEPLOYMENTS........................................................................................................31 12.1. DEPLOYMENT FOLDER STRUCTURE........................................................................................................35 12.2. BUILD FILES AND SPECIAL TARGETS.......................................................................................................35 13. THE DEFAULT SYSTEM...............................................................................................................36 13.1. PROVIDING THE FINAL CODE................................................................................................................36 2 14. DEBUGGING...................................................................................................................................36 14.1. WINDOWS OF THE DEBUGGER..............................................................................................................36 14.2. STEP BY STEP...................................................................................................................................39 14.3. LOGS.............................................................................................................................................40 14.4. MENTAL ENTITIES TRACES.................................................................................................................40 14.5. MENTAL ENTITIES TIMESTAPS..............................................................................................................41 15. SETUP...............................................................................................................................................41 16. TESTING..........................................................................................................................................41 16.1. DEFINING TESTS IN THE SPECIFICATION...................................................................................................42 16.2. INCLUDING CODE IN THE TEST..............................................................................................................43 16.3. LAUNCHING THE TEST........................................................................................................................46 17. TROUBLESHOOTING...................................................................................................................46 17.1. THE INTERACTION DOES NOT PROGRESS..................................................................................................46 17.2. THE TASK IS NOT EXECUTED. ..............................................................................................................47 17.3. THE AGENT IS NOT LAUNCHED..............................................................................................................47 17.4. OUT OF MEMORY EXCEPTION IN THE CONSOLE..........................................................................................47 17.5. MESSAGES DO NOT ARRIVE TO THE EXPECTED RECEIVER.............................................................................47 17.6. THE TASK DOES NOT FINISH, HENCE, THE AGENT GETS STUCK.......................................................................47 17.7. I NEED TO ALLOCATE METHODS WITHIN THE TASK FOR MY CODE...................................................................47 17.8. WHEN THE TASK ACCESSES THE INFORMATION CONTAINED WITHIN A FACT, IT DOES NOT CONTAIN THE INFORMATION I EXPECTED.................................................................................................................................................47 17.9. THE MS GETS CROWDED WITH ENTITIES. ...............................................................................................48 18. FIGURE INDEX...............................................................................................................................49 3 1 What is the IAF IAF stands for the INGENIAS Agent Framework. It is a framework developed along several years that enables a full model driven development. This means that a developer can focus most of its effort in specifying the system, converting a great deal of the implementation in a matter of transforming automatically the specification into code. This IAF permits to combine the classic approach for coding applications with modern techniques of automatic code generation. The resulting system is almost fully operational, reducing the amount of work of the developer in an relevant degree. Each produced MAS works over the JADE platform. Hence, additional tools existing for this framework can be applied as well. The most important aspect of the IAF is its demostrated capability to solve problems. It has been applied along several projects with very promising results. Preliminar versions of this module has been released in the past, though this is the first time a complete development manual is produced as well. 1.1 IAF and the IDK The IDK is the specification editor that hosts plugins for the parsing of the current opened specification project. Both IDK and IAF can work together or separatedly. The IAF has its own folder, as well as the IDK. The IAF can be executed from the command line or invoked from the IDK directly. The IDK includes by default a module copy of the IAF and enough infrastructure to perform the instructions included in this manual. Nevertheless, readers are invited to get used to working with the IAF alone. 1.2 Location Conventions To properly understand the instructions to develop a project, it is assumed that the IDK and the IAF will be allocated as follows: ● IDK folder. It hosts the INGENIAS Development Kit.. ○ IAF folder. It contains the INGENIAS Agent Framework, including binaries and sources. ○ workspace folder. It contains zero or more Project folders. ■ A Project folder contains the current project under development. ○ editor folder. The visual editor is allocated here. 4 2 A MAS according to the IAF A MAS in the IAF is constructed over the JADE platform. The MAS can be distributed along one or several containers in one or many computers. To enable this feature, the IAF has means of declaring different deployment configurations. The running MAS will be connected to several non-agent applications providing the basic services. Hence, if the MAS has to interact with a user, there will be GUIs producing events according to user actions, and defining actuators for agents. These GUIs will be specified as applications at the specification level. These aspects are considered in the section about application integration. An important feature of the IAF is the relevance of interactions, which are considered first class citizens during specification and coding. An interaction in runtime is called a conversation. The interactions according to the IAF have the main purpose of transferrring information from one agent to another. This information transfer is ruled by timeouts and initiation/colaboration conditions. Also, interactions can be aborted due to failures in the communication or simply because an agent did not answer within the timeout. Finally, interactions consider cases where there may be several actors of the same time, i.e., supports broadcasting of information. Tasks are important as well. They are scheduled because the agent wants to attain a pursued goal. The specification of tasks permits them to influence in the mental state by removing/adding information, start conversations with other agents, or influence into already running conversations. Tasks support cardinality attributes associated to the inputs. Testing is a new addition to the IAF. A developer can define at the specification level what tests will be performed and to what configuration of MAS will be applied. The detailed definition of the test has to be handcrafted, though there are some utilities that could make this work easier. 2.1 The lifecycle of an IAF agent An agent in the IAF performs a simple deliberation cycle: ● Identify new tasks to schedule and tasks to remove from the schedule. The schedule of the agent is a queue. Therefore, those tasks scheduled first are executed first. Tasks to be scheduled are those whose execution can satisfy the pursued goals and whose inputs are available. Due to the execution of some tasks, a scheduled task may have one or more of its inputs removed. Therefore, it can no more be executed. In this case, the task is removed from the schedule. ● Execute one scheduled task. Task execution is not concurrent. This permits to define a safe mechanism to detect modifications in the mental state of the agent that can affect scheduled tasks. This cycle omits the classic perception step. It is not needed at all. In fact, the agent can receive new information at any moment and this does not cause internal conflicts. The incorporation of new pieces of information does not imply a change in already scheduled tasks, though it may mean the incorporation of new tasks. Unfortunately, this quality prevents aborting scheduled tasks if new contradicting information appears. Despite this quality, the architecture would still capable of aborting already scheduled tasks, if the developer needs so. For this, it is enough to 5 remove manually those mental entities existing in the mental state that activated the scheduled tasks. 3 An Automatically Generated Code Development Philosophy The INGENIAS Agent Framework Framework, or IAF, bases on a philosophy for the automatically generated code generation approach. In this approach, there is a specification which is the core of the development. From this core, the different scripts and sources are automatically produced. Nevertheless, the produced code is imperfect. It misses some functionaly related to the different concrete processes to be executed within the individual agents of the system. Therefore, it is required to manually embedd this missing code. Also, a developer may find necessary to modify already generated code. The IAF proposes several means to handle these needs: ● The developer can modify manually the different templates if it is necessary. Such change would uploads/S4/ ingenias-agent-framework-development-guide-version-1-0.pdf

  • 17
  • 0
  • 0
Afficher les détails des licences
Licence et utilisation
Gratuit pour un usage personnel Attribution requise
Partager
  • Détails
  • Publié le Mai 02, 2022
  • Catégorie Law / Droit
  • Langue French
  • Taille du fichier 0.5921MB