Projects



Changes between Initial Version and Version 1 of Paose/Documentation/HowTo-Roles-and-Dependencies


Ignore:
Timestamp:
Sep 6, 2010, 10:31:04 AM (14 years ago)
Author:
wester
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Paose/Documentation/HowTo-Roles-and-Dependencies

    v1 v1  
     1= HowTo: Roles and Dependencies with KBE =
     2
     3This document explains the purpose and handling of the ''Knowledge Base Editor (KBE)'' tool (Mulan plugin ''KBE'').
     4
     5== (1) Description ==
     6
     7The KBE fulfils several purposes for the development of an MAA (which should actually better be addressed separately instead of by one monolithic tool):
     8
     9  1. The user can define roles for the MAA along with role dependencies in terms of inheritance and service dependencies.
     10  2. For each role, further information can be added: state descriptions, expected patterns for incoming messages, mapping between incoming messages and interaction protocols to be activated in response.
     11  3. Several roles can be clustered into what can be considered particular agent types (or agent positions) for the MAS to be.
     12  4. Ultimately, all the former specifications are compiled into knowledge base files (.kb files). These embody initial bodies of knowledge that agents can be lauched with.
     13
     14== (2) Embedment in the PAOSE Development Process ==
     15
     16The following figure illustrates the embedment of the models and software artefacts created with / generated by the KBE into the PAOSE development process.
     17
     18[[Image(PAOSE_embedment_KBE.png)]]
     19
     20== (3) Tool Usage ==
     21
     22As already said, all efforts of using the KBE ultimately result in the generation of knowledge base files to launch agents with initially. Thus, before describing the usage of the KBE step by step, we have a look at what kind of information the knowlege base of a Mulan/Capa agent contains. Afterwards, we address the modelling of roles and role dependencies, the adding of role-specific information, and the definition of agent types in turn.
     23
     24=== (3.1) Contents of the knowledge base of a Mulan/Capa agent ===
     25
     26The knowledge base of a Mulan/Capa agent is a unified Renew net (''WissensbasisKBE.rnw'') that offers an interface for accessing and modifying the knowledge of an agent. The knowledge body itself however is stored on a particular place within this net as a Java ''Hashtable''. Thus, knowledge is stored in the form of key-value-tuples, where a key typically is a ''String''. Basically, the developer is free in choosing a key for association with a particular knowledge element. But there exist some reserved keys.
     27
     28  * '''{{{"Name"}}}''': {{{The AgentIdentifier}}} that denotes the agent itself.
     29  * '''{{{"serviceDesc"}}}''': A list ({{{Vector}}}) that denotes the services ({{{ServiceDescription}}}) offerd by the agent.
     30  * '''{{{"requiredServices"}}}''': A list ({{{Vector}}}) that denotes the services ({{{ServiceDescription}}}) required by the agent.
     31  * Each of the required services ({{{ServiceDescription}}}) results in a key of its own that is the name of the service (via {{{getName()}}}) and that is associated with a list ({{{VTSet}}}) of agents ({{{AgentIdentifier}}}) that offer this service. Service providers and service users are made known to each other by directory facilitators.
     32  * '''{{{"proaktiv"}}}''' (yeah, still some german involved): A list ({{{Vector}}}) of net names ({{{String}}} without the {{{.rnw}}} suffix) that denote the protocol nets that are to be started proactively on agent startup.
     33  * '''{{{"protocols"}}}''' (quite unintuitive key name): A list ({{{VTIndex}}}) of messages ({{{AclMessage}}}) upon whose reception the agent reacts with the instantiation of a protocol net (as long as the messages do not carry conversation IDs).
     34  * Each of the messages from the '''{{{"protocols"}}}''' list results in a key of its own and is associated with the net name ({{{String}}} without the {{{.rnw}}} suffix) that denotes the protocol net to be instantiated upon reception of the message.
     35  * '''{{{"decisionComponents"}}}''': A list ({{{Vector}}}) of net names ({{{String}}} without the {{{.rnw}}} suffix)  that denote the decision component (DC) nets of the agent.
     36
     37In addition to these reserved and oligatory key-value-tuples, the knowledge {{{Hashtable}}} typically contains further entries that add to the state description of the agent.
     38
     39=== (3.2) Modelling roles and role dependencies ===
     40
     41In order to demonstrate the usage of the KBE we refer to a simple MAA as a running example. The MAA features agents that can act as ''producers'', ''consumers'', and ''storages''. Producer agents can send produced items to storage agents from which they can be retrieved by consumer agents.
     42
     43After starting up KBE as via the Renew menu bar ({{{Plugins}}} >> {{{KBE}}} >> {{{Start KBE}}}) we need to create a new project (right click in the ''projects'' frame of the KBE window >> {{{New Project}}}). First of all we want to model the roles and role dependencies for this new project. In order to do so, we create a new diagram (right click on the project entry that was just created >> {{{Create}}} >> {{{New MA-Diagram}}}).
     44
     45In our MAA example, we identify the roles {{{Producer}}}, {{{Consumer}}}, and {{{Storage}}}. In addition, we want to model an abstract/super role {{{CapaAgent}}} from which all other roles inherit.
     46
     47[[Image(KBE_roles.png)]]
     48
     49In addition to inheritance, role dependencies can take on the form of service dependencies. In our running example, the role {{{Storage}}} offers the services {{{store}}} and {{{deliver}}} which are used by the roles {{{Producer}}} and {{{Consumer}}} respectively. For this purpose, the KBE offers service interfaces as modelling elements where each service interface is provided by exactly one role und may be used by multiple roles. A service interface carries one or more service descriptions. Each of these services is provided by the role that provides the interface as a whole. Roles that use a service interface use a subset of the corresponding services. Service descriptions may be added to a service interface via right-clicking the interface element and following the menu options. Descriptions of required services for roles may be added analogously. When a role is declared as using a service interface, the KBE automatically checks (via comparing keys) for matches between the required services of the role and the services of the service interface.
     50
     51[[Image(KBE_services.png)]]
     52
     53=== (3.3) Adding role-specific information ===
     54
     55Roles and role dependencies embody a global view onto the MAA under development. In addition, we can add (local) role-specific information. We distinguish between arbitrary ''state descriptions'' and a ''mapping between patterns of expected incoming messages and protocol nets'' that are to be launched in response. Turning to state descriptions in our running example, we add (again, via right-clicking the role and following the menu options):
     56  * Entries for an ''agent name/identifier'' (see Sect. 3.1) and a ''proactive protocols section'' (see Sect. 3.1) for the super role  {{{CapaAgent}}}. They are inherited by all inheriting roles (however, inheritance is severely bugged, see Sect. 4).
     57  * Entries for ''decision components'' (see Sect. 3.1) for {{{Producer}}}, {{{Storage}}}, and {{{Consumer}}} respectively.
     58  * An entry for a ''product list'' on behalf of the {{{Storage}}}.
     59  * An entry for a ''product names list'' on behalf of the {{{Consumer}}}.
     60Note that there are quite different value types associated with each of these entries (in particular a {{{Vector}}} for the decision components and two ontology classes {{{ProductList}}} and {{{ProductNamesList}}}).
     61
     62Decision components are the source for proactive conversation initializations (starting protocol nets proactively). In our running example, this concerns the {{{Producer}}} who can start a conversation with the {{{Storage}}} in order to store products and the {{{Consumer}}} who can start a conversation with the {{{Storage}}} in order to get a list of available products or to retrieve one specific product. The aspect of handling proactive conversation initializations is not addressed in the KBE. However, what is addressed in the KBE is reactive conversation participation. In our running example this concerns the {{{Storage}}} who has to react to incoming messages from the {{{Producer}}} and from the {{{Consumer}}} by starting protocol nets reactively. So we define a mapping between incoming message patterns and protocol nets. Again, this is done via right-clicking the role element and following the menu options. Define patterns of incoming messages first and choose a unique key for each. Afterwards, define names of protocol nets and assign one or more keys of message patterns to them.
     63
     64[[Image(KBE_state.png)]]
     65
     66=== (3.4) Defining agent types and generating knowlege base files ===
     67
     68So far, we have modelled roles and role dependencies. However, they are still just abstract specifications. Our MAA will consist of agents who occupy these roles and thus fill them "with life". We define an agent type by assining to it one or more roles and thus define the agent's initial body of knowledge with which it is "born". In order to do so, we have to switch the KBE perspective. But beforehand, we have to save our role diagram (via the small disc button in the upper left corner) and generate XML descriptions of all roles and service interfaces defined in it (via right-clicking the name that was chosen for our role diagram >> {{{Generate}}} >> {{{Generate ARDs/AIDs (intermediate KBs) from MAD ...}}}).
     69
     70Afterwards, we switch KBE perspective from the role diagram to the MAS perspective where agent types may be defined. Either this perspective is already available in the ''projects'' frame of the KBE or you have to create it via right-clicking the name of the role diagram >> {{{Create}}} >> {{{New MAS}}}.
     71
     72In the MAS perspective you may define agent types by assigning roles to it. The final step is to save all agent type definitions as ''knowledge base files'' ({{{.kb}}} files) to the directoy from they are to be read when the MAA is launched (via {{{Save Agent KB}}} or {{{Save All Agent KBs}}}).
     73
     74[[Image(KBE_agentTypes.png)]]
     75
     76== (4) Pitfalls ==
     77
     78soon
     79
     80== (5) Conventions ==
     81
     82soon ...