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

Class TBCBP

source code

Instance Methods [hide private]
 
__init__(self, rl={'limit': 10000, 'maxth': 0.95}) source code
 
getCaseTime(self, case) source code
 
registerService(self, service, time=1, QoS=1)
registers a DF.Service time and QoS parameters are optional
source code
 
delService(self, name) source code
 
getService(self, name)
returns a DF.Service
source code
 
getServiceInfo(self, name)
returns info of a service Usage: name - string with the name of the service returns a dict with the info of the service
source code
 
addCase(self, case)
inserts a new case in the case-base services of the case MUST be registered in the TBCBP
source code
 
addPlan(self, plan) source code
 
getCases(self, P=None, Q=None, inputs=None, outputs=None)
returns a list of cases where the P,Q,inputs and outputs match.
source code
 
getCase(self, case)
returns the case of the case-base whose parameters (P,Q,inputs and outputs) match with the 'case' parameters
source code
 
getCaseOfService(self, name)
returns the case that represents the service 'name' in the case-base Usage: name - string with the name of the service
source code
 
planMatchesInKB(self, case, kb)
returns True if all the Preconditions and Inputs of the case are true in the knowledge-base otherwise returns False Usage: case - the case that we want to compare.
source code
 
composePlan(self, Goal, kb, tout=20, use_rl=True) source code
 
retain(self, case, QoS=None) source code
 
reward(self, c) source code
 
punish(self, c) source code
Method Details [hide private]

getCases(self, P=None, Q=None, inputs=None, outputs=None)

source code 

returns a list of cases where the P,Q,inputs and outputs match. it only compares parameters if they are not None

planMatchesInKB(self, case, kb)

source code 

returns True if all the Preconditions and Inputs of the case are true in the knowledge-base otherwise returns False Usage: case - the case that we want to compare. instance of Case kb - the knowledge base of the agent. instance of kb.KB