aminePlatform.agent.amineJade.ppcgAgent
Class PPCGAmineJadeAgent

java.lang.Object
  extended byjade.core.Agent
      extended byaminePlatform.agent.amineJade.AmineJadeAgent
          extended byaminePlatform.agent.amineJade.ppcgAgent.PPCGAmineJadeAgent
All Implemented Interfaces:
AmineAgent, java.lang.Runnable, java.io.Serializable, jade.util.leap.Serializable, jade.core.TimerListener

public class PPCGAmineJadeAgent
extends AmineJadeAgent

Title : PPCGAmineJadeAgent class

Description : PPCGAmineJadeAgent is a specialized class of the AmineJadeAgent class. As introduced in the MAS classes, to create an MAS, it is necessary to declare one or more agents that would constitute the MAS. PPCGAmineJadeAgent is one possible class to use to create an agent of the MAS system. This type of agent is specifically benefiting from the Prolog engine to satisfy goals.

Copyright : Copyright (c) Adil KABBAJ 2004-2009

See Also:
Serialized Form

Field Summary
 Interpreter myPPCGInterpreter
          Every agent has a corresponding Prolog+CG interpreter.
 
Fields inherited from class aminePlatform.agent.amineJade.AmineJadeAgent
agentID, myGui
 
Fields inherited from class jade.core.Agent
AP_ACTIVE, AP_COPY, AP_DELETED, AP_IDLE, AP_INITIATED, AP_MAX, AP_MIN, AP_SUSPENDED, AP_TRANSIT, AP_WAITING, currentBehaviour, currentMessage, D_ACTIVE, D_MAX, D_MIN, D_RETIRED, D_SUSPENDED, D_UNKNOWN
 
Constructor Summary
PPCGAmineJadeAgent()
           
 
Method Summary
 Interpreter getmyPPCGInterpreter()
           
 void listen()
          Each agent has a msgBox.An agent is listening when he checks if he has received an ACL in his msgBox.
static void print(java.lang.Object content, java.lang.String agent)
           
 void satisfyGoal(java.lang.String goal)
          One of the main goals for using MAS is that agents have to act autonomously by satisfying their own goals.
static void send(java.lang.String sender, Individual receiver, java.lang.String content)
          This method is defined a static to let the programmer use it from the Prolog+CG environment.
static void send(java.lang.String sender, java.lang.String receiver, java.lang.String content)
          This method is defined a static to let the programmer use it from the Prolog+CG environment.
static java.lang.Object sendAndWait(java.lang.String sender, Individual receiver, java.lang.String content)
          This method is defined a static to let the programmer use it from the Prolog+CG environment.
static java.lang.Object sendAndWait(java.lang.String sender, java.lang.String receiver, java.lang.String content)
          This method is defined a static to let the programmer use it from the Prolog+CG environment.
 void setmyPPCGInterpreter(Interpreter interpreter)
           
 void setup()
          This method is overwritten from AmineJadeAgent class and from the Jade platform.
 
Methods inherited from class aminePlatform.agent.amineJade.AmineJadeAgent
send, send, sendAndWait, sendAndWait
 
Methods inherited from class jade.core.Agent
addBehaviour, afterClone, afterMove, beforeClone, beforeMove, blockingReceive, blockingReceive, blockingReceive, blockingReceive, doActivate, doClone, doDelete, doMove, doStart, doSuspend, doTimeOut, doWait, doWait, doWake, extractPassword, extractUsername, getAgentState, getAID, getAMS, getArguments, getAuthority, getCertificateFolder, getContainerController, getContentManager, getCurQueueSize, getDefaultDF, getHap, getHelper, getLocalName, getName, getO2AObject, getPrincipal, getProperty, getQueueSize, getState, here, notifyChangeBehaviourState, notifyRestarted, postMessage, putBack, putO2AObject, read, read, receive, receive, removeBehaviour, restartLater, restore, run, send, setArguments, setEnabledO2ACommunication, setGenerateBehaviourEvents, setOwnership, setPrincipal, setQueueSize, takeDown, waitUntilStarted, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myPPCGInterpreter

public Interpreter myPPCGInterpreter
Every agent has a corresponding Prolog+CG interpreter. This interpreter would be used to satisfy the agent goals

Constructor Detail

PPCGAmineJadeAgent

public PPCGAmineJadeAgent()
Method Detail

setup

public void setup()
This method is overwritten from AmineJadeAgent class and from the Jade platform. It allows to setup the creation of one PPCGAgent (with the creation of its Prolog+CG interpreter) within the MAS and do the corresponding updating concerning the whole MAS such as incrementing the number of created agents, etc.

Specified by:
setup in interface AmineAgent
Overrides:
setup in class AmineJadeAgent

satisfyGoal

public void satisfyGoal(java.lang.String goal)
One of the main goals for using MAS is that agents have to act autonomously by satisfying their own goals. For the type of a PPCGAmineJadeAgent, the inference engine used is Prolog+CG. The method tries to satisfy the goal specified as a string with the call of the findAllSolutions method defined in Prolog+CG engine.

Specified by:
satisfyGoal in interface AmineAgent
Overrides:
satisfyGoal in class AmineJadeAgent
Parameters:
goal - A String

send

public static void send(java.lang.String sender,
                        java.lang.String receiver,
                        java.lang.String content)
This method is defined a static to let the programmer use it from the Prolog+CG environment. It allows the sender agent to send a message content to a receiver agent.

Parameters:
sender - a String corresponding to the sender agent
receiver - a String corresponding to the receiver agent
content - a String corresponding to the message

send

public static void send(java.lang.String sender,
                        Individual receiver,
                        java.lang.String content)
This method is defined a static to let the programmer use it from the Prolog+CG environment. It allows the sender agent to send a message content to a receiver agent.

Parameters:
sender - a String corresponding to the sender agent
receiver - an Individual corresponding to the receiver agent
content - a String corresponding to the message

sendAndWait

public static java.lang.Object sendAndWait(java.lang.String sender,
                                           java.lang.String receiver,
                                           java.lang.String content)
This method is defined a static to let the programmer use it from the Prolog+CG environment. it allows the sender agent to send a message content to a receiver agent and wait for the response.

Parameters:
sender - a String corresponding to the sender agent
receiver - a String corresponding to the receiver agent
content - a String corresponding to the message

sendAndWait

public static java.lang.Object sendAndWait(java.lang.String sender,
                                           Individual receiver,
                                           java.lang.String content)
This method is defined a static to let the programmer use it from the Prolog+CG environment. it allows the sender agent to send a message content to a receiver agent and wait for the response.

Parameters:
sender - a String corresponding to the sender agent
receiver - an Individual corresponding to the receiver agent
content - a String corresponding to the message

listen

public void listen()
Each agent has a msgBox.An agent is listening when he checks if he has received an ACL in his msgBox. it allows the current agent to check if someone has sent a message to him

Specified by:
listen in interface AmineAgent
Overrides:
listen in class AmineJadeAgent

print

public static void print(java.lang.Object content,
                         java.lang.String agent)

getmyPPCGInterpreter

public Interpreter getmyPPCGInterpreter()

setmyPPCGInterpreter

public void setmyPPCGInterpreter(Interpreter interpreter)