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

Class Behaviour

source code


Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
_process(self)
main loop must be overridden
source code
 
done(self)
returns True if the behavior has finished else returns False
source code
 
exitCode(self)
returns the default exit code for the behavior
source code
 
getAgent(self)
returns the agent which controls the behavior
source code
 
getParent(self) source code
 
kill(self)
stops the behavior
source code
 
managePresence(self, frm=None, type=None, status=None, show=None, role=None, affiliation=None)
DEPRECATED manage a FIPA-formed presence message
source code
 
onEnd(self)
this method runs when the behavior stops
source code
 
onStart(self)
this method runs when the behavior starts
source code
 
registerPresenceHandler(self, template, handler)
DEPRECATED register a handler that will manage all incoming presence notifications matching the given presence template
source code
 
root(self) source code
 
run(self) source code
 
setAgent(self, agent)
sets the agent which controls the behavior
source code
 
setParent(self, parent) source code
 
setTemplate(self, template)
Set the message template for this behaviour
source code

Inherited from MessageReceiver.MessageReceiver: postMessage

Inherited from MessageReceiver.MessageReceiver (private): _receive

Inherited from threading.Thread: __repr__, getName, 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__

Instance Variables [hide private]
  _exitcode
def __getattr__(self, aname): return self.myAgent.__dict__[aname]
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)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

run(self)

source code 
Overrides: threading.Thread.run

Instance Variable Details [hide private]

_exitcode


def __getattr__(self, aname):
    return self.myAgent.__dict__[aname]

def __setattr__(self, aname, value):
    # Base case: aname is defined locally
    if aname in self.__dict__:
        self.__dict__[aname] = value
    # Second case: aname is defined in "myAgent"
    elif "myAgent" in self.__dict__ and self.__dict__["myAgent"] and aname in self.myAgent.__dict__:
        setattr(self.myAgent, aname, value)
    # Third case: new local declaration
    else:
        self.__dict__[aname] = value