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

Class BDIBehaviour

source code


Instance Methods [hide private]
 
__init__(self, period)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
configureKB(self, typ, sentence=None, path=None) source code
 
addBelieve(self, sentence, type='insert') source code
 
removeBelieve(self, sentence, type='delete') source code
 
askBelieve(self, sentence) source code
 
saveFact(self, name, sentence) source code
 
getFact(self, name) source code
 
addPlan(self, P, Q, inputs, outputs, services)
Adds a new plan to the Planner (TBCBP) Usage: addPlan (P, Q, services) P - precondition of the plan Q - postcondition of the plan services - list of services names (strings)
source code
 
addGoal(self, goal) source code
 
registerServiceInTBCBP(self, service, time=1)
Registers new service in the Planner (TBCBP) Usage: registerService(service, time) service - A DF.Service class time - the estimated execution time of the service (optional)
source code
 
unregisterServiceInTBCBP(self, name=None, service=None) source code
 
getPlan(self, goal)
Finds a plan for a specified goal.
source code
 
composePlan(self, goal, tout=-1)
calls the Temporal-Bounded Case Based Planner
source code
 
selectIntentions(self)
Prepares new plan for active goals Looks for all prepared goals and selects a new plan for it.
source code
 
insertNextService(self, plan, pid)
Selects the next service of a plan to be executed Usage: insertNextService( plan, pid) plan - the running plan (TBCBP.Plan) pid - the plan identifier
source code
 
EndPlan(self, pid, plan)
Finishes the execution of a plan.
source code
 
EndService(self, service, plan)
Finishes the execution of a service.
source code
 
deliberate(self) source code
 
discover(self) source code
 
punishService(self, service) source code
 
_onTick(self)
periodic behaviour execution
source code
 
planSelectedCB(self, plan) source code
 
goalCompletedCB(self, goal) source code
 
serviceCompletedCB(self, service) source code

Inherited from Behaviour.PeriodicBehaviour: getPeriod, setPeriod

Inherited from Behaviour.PeriodicBehaviour (private): _process

Inherited from Behaviour.Behaviour: done, exitCode, getAgent, getParent, kill, managePresence, onEnd, onStart, registerPresenceHandler, root, run, setAgent, setParent, setTemplate

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]

Inherited from Behaviour.Behaviour (private): _exitcode

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, period)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

addPlan(self, P, Q, inputs, outputs, services)

source code 

Adds a new plan to the Planner (TBCBP) Usage: addPlan (P, Q, services) P - precondition of the plan Q - postcondition of the plan services - list of services names (strings)

Return: None

registerServiceInTBCBP(self, service, time=1)

source code 

Registers new service in the Planner (TBCBP) Usage: registerService(service, time) service - A DF.Service class time - the estimated execution time of the service (optional)

Returns: None

getPlan(self, goal)

source code 

Finds a plan for a specified goal. If there is not an existing plan, it composes a new one (when possible) Usage getPlan( goal ) goal - a Goal object to be achieved

Returns: TBCBP.Plan object or None is there is no available plan

selectIntentions(self)

source code 

Prepares new plan for active goals Looks for all prepared goals and selects a new plan for it. then the goal is archived in prepared_goals and the plan is stored in self.plans

EndPlan(self, pid, plan)

source code 

Finishes the execution of a plan. If the plan run well, its case is rewarded. Otherwise, it is punished. Finally goal is setted as done and not active. Usage: EndPlan ( pid, plan) pid - Plan identifier plan - TBCBP.Plan object

EndService(self, service, plan)

source code 

Finishes the execution of a service. If the service failed, it is punished and the plan is finished. Otherwise, the next service of the plan is selected. Usage: EndService ( service, plan) service - the current running DF.Service plan - the TBCBP.Plan where the service belongs

_onTick(self)

source code 

periodic behaviour execution

Overrides: Behaviour.PeriodicBehaviour._onTick