Abstract: This document details the minimum steps necessary to verify that two agents of type DPS-Agent-Node communicate correctly and can access and modify the Working Memory from the Asynchronous-Shell or from the JADE-Shell command interpreter. In order for these agents to communicate properly, they must belong to replicas of the same application. For that reason it is important, before undertaking step 2, to have completed Step 1 successfully and thus have the base structure created for the Avalon application.

Keywords:

Interaction Protocol, Asynchronous-Shell, Facts-Passing between Agents.

Process Enumeration



1. Objective: To deploy two of the Agents of the Avalon application, both connected to two CLIPS type engines and deployed in debug-mode. These two agents have the names: Analizador200 and Analizador204 and, belong to the replica of the application agents-oriented named Avalon.

Process:

  1. Launch the JADE platform on port 4455. (this port number is only for test purposes).
  2. Launch the agent (Analizador200) in debug-mode on port 4455 at address 127.0.0.1.
  3. Launch the second agent (Analizador204) in debug-mode on port 4455 at address 127.0.0.1.

      Previous steps followed in Exercise.1:
      --------------------------------------
    
    
      $ export CLASSPATH=./*:lib/*:
      $ java framework new Avalon
      $ cd Avalon
      $ java generate -n=Analizador200,Analizador204  -t=node
      $ java launcher platform   localhost 4455 &
      $ java launcher stage-node localhost Analizador204 CLIPS  4455 &
      $ java launcher stage-node localhost Analizador200 CLIPS  4455 &
    



2. Objective: To establish the run-level of the Agents in value = 5. That way, all the listeners are activated and the messages can be emitted and captured from their Inboxes.

Process:

  1. Activate the execution level to 5 on both agents. That is, the normal mode of execution.

     $    Click on the top button [n-5] of the Agent.
     $    Or, from the JADE-Shell agent console, execute: init(5);
    



3. Objective: Load Facts in the Working-Memory of an agent and, in the Working-Memory of the second agent remotely. Use the Asynchronous-Shell and the Selector of agents that belong to the Avalon application.

Process:

  1. Access the Asynchronous-Shell of the first Agent.
  2. Check the status of the Knowledge-Base. (facts)
  3. Insert a new Fact. (assert …)
  4. Select the Remote Agent, where to send a Fact.
  5. Insert a new Fact in the Working-Memory of the other agent. (assert …)
  6. Check that this Fact has been inserted in the Working-Memory of remote agent.

TicketBoard

     Access to Asynchronous Shell Tab of **Analizador204** agent.
     ------------------------------------------------------------
     Type on:  Asynchronous-Shell
     ------------------------------------------------------------

     (facts)                       Press  [Ctrl + Shift +  Enter] 
     (assert  (velocidad 0.0))     Press  [Ctrl + Shift +  Enter] 
     (facts)                       Press  [Ctrl + Shift +  Enter] 



     Without moving from the Analizador204 GUI's' Agent, please 
     select the name "Analizador200" from the Avalon agent list.
     ------------------------------------------------------------
     Type on: Analizador204's  Asynchronous-Shell
     ------------------------------------------------------------


     (assert (aceleracion 3.0))     Press  [Ctrl + Shift +  Enter] 


     Now, chage to Analizador200 Agent GUI:
     ------------------------------------------------------------
     Type on:   Asynchronous-Shell
     ------------------------------------------------------------
     
     (facts)                       Press  [Ctrl + Shift +  Enter] 

TicketBoard


  • With this it has been proven that the Facts, and likewise the Rules, can be transmitted from some DPS-Agents to others of the same agent-oriented application.


Using only the JADE-Shell interpreter



4. Objective: Load Facts in the Working-Memory of the agent itself or in the Working-Memory of another agent. And use only the agent JADE-Shell interpreter in debug-mode.

Process:

  1. Access the JADE-Shell of the Agent origin of the requests.
  2. Build the message
  3. Build the behavior and incorporate it into the Agent.
  4. Check results in the Working Memory of the eemote Agent.
  • Shortcut: Access the JADE-Shell interpreter built into the agent, in debug mode.
  • You can use, for example, the agent: Analizador204

Message construction:

     Now, onto the Analizador204 agent JADE-Shell Tab:
     ------------------------------------------------------------
     Type on:   JADE-Shell    
     ------------------------------------------------------------

    [psNode]://Analizador204/config/$ > 

       $ >  theFact = "(assert  (area  5,88789))";
       $ >  msgREPL = myAgent .makeReplMessage( "Analizador200", theFact );

TicketBoard

     -------------------------------------------------
     Detailed content of the msgREPL message.
     -------------------------------------------------
     <(REQUEST
        :sender  ( agent-identifier :name Analizador204@127.0.0.1:4455/JADE  
                   :addresses (sequence http://zorba:7778/acc ))
        :receiver  (set ( agent-identifier :name Analizador200@127.0.0.1:4455/JADE ) )
        :content  "((action (agent-identifier :name Analizador200@127.0.0.1:4455/JADE) 
                      (repl :compiler CLIPS 
                            :content @seeEnvelope_Comments 
                            :language CLIPS 
                            :resultType String 
                            :results waiting... 
                            :sentence KGFzc2VydCAgKGFyZWEgIDUsODg3ODkpKQ==)))" 
        :encoding  fipa.acl.rep.string.std  
        :language  fipa-sl  
        :ontology  Expert-Systems  
        :protocol  fipa-request
        :X-psAction Repl 
        :X-psSender Analizador204 
        :X-psReceiver Analizador200 
     )>


  • Build the Behaviour Object and incorporate it into the Agent.


     Onto the Analizador204 agent JADE-Shell Tab:
     ------------------------------------------------------------
     Type on:   JADE-Shell     
     ------------------------------------------------------------

     [psNode]://Analizador204/config/$ > ...
   
     $ >   b = new N2NREInitiator( myAgent, msgREPL );
     $ >   b .setBehaviourName( "anyLabel" );
     $ >   myAgent .addBehaviour( b );
  • Check Working-Memory remote Agent results.

  • From the remote Analizador200 Asynchronous-Shell Tab, please verify that the requested Facts have been inserted in that Agent’s Working-Memory (facts).

      Onto the Analizador202 agent Asynchronous-Shell Tab:
      ------------------------------------------------------------
      Type on:  Asynchronous-Shell     
      ------------------------------------------------------------
    
      (facts)                        Press  [Ctrl + Shift + Enter]
    

TicketBoard


    The approximate result is:
    ----------------------------
    f-0..
    f-1...
    f-3   (area  5,88789)
    ...
  • With this it has been verified again that, the Facts, and likewise the Rules, can be transmitted from some DPS-Agents to the Working-Memory of others if both agents belong to the same application.


How to entrust calculation tasks to other DPS-Agents



5. Objective: Request to a DPS-Agent-Node agent to perform calculation tasks and receive its results.

Process:

  1. Specialize to Analizador200 agent, in the calculation of Sudokus of 2x2, 3x3, 4x4 and 5x5 size cells.
  2. From another agent, entrust the execution of a Calculation-Case to the Analizador200 agent.

Specialization Process

5.1 Modify node.properties file that belongs to Analizador200 agent:

  • Modify the value assigned to the variable: ps.node.behavior-acpb = 0 and set it equal to 1. (Line 17).
  • Save those changes: by pressing the [Save] button.
  • Initialize the agent: by pressing the [n-6!] button.
  • CRITICAL: Next, press the [n-5] button so that Analizador200 agent reaches its normal execution level, or else it will not respond to remote requests. The level (5) is the normal level of execution when the agent runs in production-mode on JADE platform.

TicketBoard


  • IMPORTANT: See following image. It shows, in its lower right corner, the system Log-output returned by the JADE Platform when the [n-6!] agent re-initialization button is pressed. In said Log-output, it is reported that: Analizador200 agent has executed the behavior acpb (Acronym for: Agent-Capabilities). (See, the last-line at image).

  • The Script acpb can be located through the Analizador200 agent editor (upper center of the image) inside of file named bhv.acpb.bsh. That file is a script that specializes the Analizador200 agent and that script allows it to face the resolution of problems, in this case, the Sudoku 2x2, 3x3, 4x4 and 5x5 cells Problems solving.


TicketBoard


Task assignment process

5.2 Access the Asynchronous-Shell of **Analizador204 agent:**

  • Select the “Analizador200” label agent name, from the list of application agents.
  • Request an easy Sudoku problem, e.g.: grid3x3-p2.clp.
  • Ask about the solution achieved by the remote Analizador200 agent.

       Onto the Analizador204 agent Asynchronous-Shell Tab:
       ------------------------------------------------------------
       Type on:  Asynchronous-Shell     
       ------------------------------------------------------------
    
       (load nodes/Analizador200/engine/grid3x3-p2.clp)  [Ctrl + Shift + Enter]
       (reset)                                           [Ctrl + Shift + Enter]
       (run)                                             [Ctrl + Shift + Enter]
    


  • Now, request a complex Sudoku problem, e.g.: grid4x4-p4.clp.
  • Ask again about the solution achieved by the remote Analizador200 agent.

       Onto the Analizador204 agent Asynchronous-Shell Tab:
       ------------------------------------------------------------
       Type on:  Asynchronous-Shell     
       ------------------------------------------------------------
    
       (reset)                                           [Ctrl + Shift + Enter]
       (load nodes/Analizador200/engine/grid4x4-p4.clp)  [Ctrl + Shift + Enter]
       (reset)                                           [Ctrl + Shift + Enter]
       (run)                                             [Ctrl + Shift + Enter]
    

TicketBoard

  • Observe the time consumed by the Analizador200 agent.
  • Note: perform scrolling upwards in the inference response collection window.

       -------------------------------------------------
       Detailed partial response (human format).
       -------------------------------------------------
      [Analizador200] Agree and queue that REQUEST to its Engine!
        
                                 +-------------------------+
      --------------------------/ Response from:[Analizador200]
      | [n2ni022] INFORM-IF       [sept. 07, 07:45:00.287]
      |                        Delta-Time:[0.607 seconds.]
      -----------------------------------------------------+
      Returns: java.lang.Boolean
      Value  : true
      Results: 
    
    
      The puzzle was...: 
      ... etc.
    


Debugging processes

5.3 How to perform a detailed analysis of Analizador204 agent activities

  • With the previous procedure, it is verified how to entrust Problem solving processes to specialized agents and how they can send a response with their conclusions and we receive it. For a more detailed description of what the internal process has been, the Verbose mode can be activated in the Analizador200 agent. For it:
  1. Modify the node.properties file of Analizador200 agent. Change the variable named: ps.node.agent.verbose.mode = 0, and set it equal to 1. Don’t forget save that changes!
  2. Re-initialize Analizador200 agent with button [n-6!] and then [n-5] to reset to normal execution run-level of agents.
  3. Now, come back to Analizador204 agent GUI and, repeat the last four steps. That is:

      Onto the Analizador204 agent Asynchronous-Shell Tab:
      ------------------------------------------------------------
      Type on:  Asynchronous-Shell     
      ------------------------------------------------------------
    
      (reset)                                           [Ctrl + Shift + Enter]
      (load nodes/Analizador200/engine/grid3x3-p2.clp)  [Ctrl + Shift + Enter]
      (reset)                                           [Ctrl + Shift + Enter]
      (run)                                             [Ctrl + Shift + Enter]
    
  • And then observe, the Log of the system dumped by the JADE platform due to the actions carried out by the Analizador200 agent to resolve and answer raised questions.

  • NOTE: Finally, denote that by also activating the Verbose mode in the Analizador204 agent –from where the requests are being made–, a complete image of the dialogue between both agents will be obtained to reach the interaction protocol: request, reception, preparation of the response, response and reception. All these communicative acts and their harmonic sequence are carried out by Behaviors that implement the rational communication model between agents. (See, FIPA Communicative Act Library Specification).

TicketBoard


References