Package spade :: Module Agent :: Class AbstractAgent
[hide private]
[frames] | no frames]

Class AbstractAgent

source code


Abstract Agent only for heritance Child classes: PlatformAgent, Agent

Instance Methods [hide private]
 
__init__(self, agentjid, serverplatform, p2p=False)
inits an agent with a JID (user@server) and a platform JID (acc.platformserver)
source code
 
setAdminPasswd(self, passwd) source code
 
WUIController_login(self, password=None, forward_url='index') source code
 
WUIController_logout(self) source code
 
WUIController_admin(self, *args, **kwargs) source code
 
WUIController_log(self, *args, **kwargs) source code
 
WUIController_messages(self, *args, **kwargs) source code
 
WUIController_search(self, *args, **kwargs) source code
 
WUIController_sendmsg(self, *args, **kwargs) source code
 
WUIController_sent(self, *args, **kwargs) source code
 
registerLogComponent(self, component) source code
 
DEBUG(self, dmsg, typ='info', component='spade') source code
 
setDebug(self, activate=True) source code
 
setDebugToScreen(self, activate=True) source code
 
setDebugToFile(self, activate=True, fname='') source code
 
getLog(self) source code
 
newMessage(self)
Creates and returns an empty ACL message
source code
 
newContentObject(self)
Creates and returns an empty Content Object
source code
 
_jabber_presenceCB(self, conn, mess)
presence callback manages jabber stanzas of the 'presence' protocol
source code
 
_jabber_messageCB(self, conn, mess, raiseFlag=True)
message callback read the message envelope and post the message to the agent
source code
 
_other_messageCB(self, conn, mess)
non jabber:x:fipa chat messages callback
source code
 
_jabber_iqCB(self, conn, mess)
IQ callback manages jabber stanzas of the 'iq' protocol
source code
 
getAID(self)
returns AID
source code
 
setAID(self, aid)
sets a new AID
source code
 
addAddress(self, addr) source code
 
getName(self) source code
 
getAMS(self)
returns the AMS aid
source code
 
getDF(self)
returns the DF aid
source code
 
getMUC(self)
returns the MUC JID
source code
 
getSpadePlatformJID(self)
returns the SPADE JID (string)
source code
 
getDomain(self)
returns the SPADE server domain
source code
 
getP2PUrl(self) source code
 
requestDiscoInfo(self, to) source code
 
initiateStream(self, to)
Perform a Stream Initiation with another agent in order to stablish a P2P communication channel
source code
 
send(self, ACLmsg, method='jabber')
sends an ACLMessage
source code
 
_sendTo(self, ACLmsg, tojid, method)
sends an ACLMessage to a specific JabberID
source code
 
send_p2p(self, jabber_msg=None, to='', method='p2ppy', ACLmsg=None) source code
 
_kill(self)
kills the agent
source code
 
isRunning(self)
returns wether an agent is running or not
source code
 
stop(self, timeout=0)
Stops the agent execution and blocks until the agent dies
source code
 
forceKill(self) source code
 
_setup(self)
setup agent method.
source code
 
_initBdiBehav(self)
starts the BDI behaviour ONLY if self is a subclass of bdi.BDIAgent
source code
 
takeDown(self)
stops the agent must be overridden (kind of a "onEnd" for the agent)
source code
 
run(self)
periodic agent execution
source code
 
setDefaultBehaviour(self, behaviour)
sets a Behavior as Default
source code
 
getDefaultBehaviour(self)
returns the default behavior
source code
 
addBehaviour(self, behaviour, template=None)
adds a new behavior to the agent
source code
 
runBehaviourOnce(self, behaviour, template=None)
Runs the behaviour offline Executes its process once @warning Only for OneShotBehaviour
source code
 
removeBehaviour(self, behaviour)
removes a behavior from the agent
source code
 
subscribeToFriend(self, aid)
presence subscription to another agent
source code
 
unsubscribeToFriend(self, aid)
presence unsubscription to another agent
source code
 
getSocialNetwork(self, nowait=False)
get list of social agents which have some relation with the agent
source code
 
searchAgent(self, AAD)
searches an agent in the AMS the search template is an AmsAgentDescription class
source code
 
modifyAgent(self, AAD)
modifies the AmsAgentDescription of an agent in the AMS
source code
 
getPlatformInfo(self)
returns the Plarform Info
source code
 
registerService(self, service, methodCall=None, otherdf=None)
registers a service in the DF the service template is a DfAgentDescriptor
source code
 
deregisterService(self, DAD, otherdf=None)
deregisters a service in the DF the service template is a DfAgentDescriptor
source code
 
searchService(self, DAD)
search a service in the DF the service template is a DfAgentDescriptor
source code
 
modifyService(self, DAD, methodCall=None)
modifies a service in the DF the service template is a DfAgentDescriptor
source code
 
invokeService(self, service, inputs=None)
invokes a service using jabber-rpc (XML-RPC) the service template is a DF.Service if inputs is None, they are extracted from the agent's KB
source code
 
publishEvent(self, name, event) source code
 
subscribeToEvent(self, name, behaviour=None, server=None, jid=None) source code
 
unsubscribeFromEvent(self, name, server=None, jid=None) source code
 
createEvent(self, name, server=None, type='leaf', parent=None, access=None) source code
 
deleteEvent(self, name, server=None) source code
 
addBelieve(self, sentence, type='insert') source code
 
removeBelieve(self, sentence, type='delete') source code
 
askBelieve(self, sentence) source code
 
configureKB(self, typ, sentence=None, path=None) source code
 
saveFact(self, name, sentence) source code
 
getFact(self, name) source code

Inherited from MessageReceiver.MessageReceiver: postMessage

Inherited from MessageReceiver.MessageReceiver (private): _receive

Inherited from threading.Thread: __repr__, isAlive, isDaemon, is_alive, join, setDaemon, setName, start

Inherited from threading.Thread (private): _reset_internal_locks, _set_daemon, _set_ident

Inherited from threading._Verbose (private): _note

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from threading.Thread: daemon, ident, name

Inherited from threading.Thread (private): _block

Inherited from object: __class__

Method Details [hide private]

__init__(self, agentjid, serverplatform, p2p=False)
(Constructor)

source code 

inits an agent with a JID (user@server) and a platform JID (acc.platformserver)

Overrides: object.__init__

WUIController_admin(self, *args, **kwargs)

source code 
Decorators:
  • @require_login

WUIController_log(self, *args, **kwargs)

source code 
Decorators:
  • @require_login

WUIController_messages(self, *args, **kwargs)

source code 
Decorators:
  • @require_login

WUIController_search(self, *args, **kwargs)

source code 
Decorators:
  • @require_login

WUIController_sendmsg(self, *args, **kwargs)

source code 
Decorators:
  • @require_login

WUIController_sent(self, *args, **kwargs)

source code 
Decorators:
  • @require_login

getName(self)

source code 
Overrides: threading.Thread.getName

_setup(self)

source code 

setup agent method. configures the agent must be overridden

run(self)

source code 

periodic agent execution

Overrides: threading.Thread.run