Package edu.tufts.hrilab.action.db
Class Database
java.lang.Object
edu.tufts.hrilab.action.db.Database
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddActionDBEntry(ActionDBEntry entry) voidAdd listenervoidaddPrimitiveActions(ai.thinkingrobots.trade.TRADEServiceInfo constraints) Adds a list of primitive actions in the provided constraints.static voidDestroy Database singleton.voidstatic ActionDatabaseConvenience method to get action only DB (calls getInstance() internally).Get all named DIARC agents known to the systemstatic DatabaseGet Database singleton.static ObserverDatabaseConvenience method to get observer only DB (calls getInstance() internally).static OperatorDatabaseConvenience method to get operator only DB (calls getInstance() internally).static PerformanceMeasuresDatabaseConvenience method to get performance measures DB (calls getInstance() internally).static RecoveryPolicyDatabaseConvenience method to get recovery policy only DB (calls getInstance() internally).booleanisDiarcAgent(Symbol agentRef) Check if agentRef is a DIARC agent.voidloadDatabaseFiles(String dbFileDir, List<String> dbFiles) Load database files and merge into existing database, assigning the specified agent to the parsed actions.voidloadDatabaseFromFile(String dbfilename) Load database from file and merge into existing database.voidloadDatabaseFromFile(String dbfilename, List<Symbol> agents) Load database from file and merge into existing database, assigning the specified agents to the parsed actions.voidloadPerformanceMeasuresFromFile(String fileDir, List<String> filenames) Load action probabilities into databasevoidremoveActionDBEntry(ActionDBEntry entry) voidRemove listenerprotected voidWrite all scripts in the Database to an ASL file.
-
Method Details
-
getInstance
Get Database singleton.- Returns:
-
destroyInstance
public static void destroyInstance()Destroy Database singleton. -
getActionDB
Convenience method to get action only DB (calls getInstance() internally).- Returns:
-
getOperatorDB
Convenience method to get operator only DB (calls getInstance() internally).- Returns:
-
getObserverDB
Convenience method to get observer only DB (calls getInstance() internally).- Returns:
-
getRecoveryPolicyDB
Convenience method to get recovery policy only DB (calls getInstance() internally).- Returns:
-
getPerformanceMeasuresDB
Convenience method to get performance measures DB (calls getInstance() internally).- Returns:
-
writeDB
Write all scripts in the Database to an ASL file. -
loadDatabaseFiles
Load database files and merge into existing database, assigning the specified agent to the parsed actions.- Parameters:
dbFileDir- ASL files base dirdbFiles- list of ASL filenames
-
loadDatabaseFromFile
Load database from file and merge into existing database.- Parameters:
dbfilename- ASL filename
-
loadDatabaseFromFile
Load database from file and merge into existing database, assigning the specified agents to the parsed actions.- Parameters:
dbfilename- ASL filenameagents- agent names
-
loadPerformanceMeasuresFromFile
Load action probabilities into database- Parameters:
filenames-
-
addActionDBEntry
-
removeActionDBEntry
-
disableActionDBEntry
-
addPrimitiveActions
public void addPrimitiveActions(ai.thinkingrobots.trade.TRADEServiceInfo constraints) Adds a list of primitive actions in the provided constraints. This should not be called directly and should instead be triggered by a TRADE joined notification.- Parameters:
constraints- the names of the services provided by the TSP that whose joined notification triggered this call
-
addListener
Add listener- Parameters:
l- listener
-
removeListener
Remove listener- Parameters:
l- listener
-
isDiarcAgent
Check if agentRef is a DIARC agent.- Parameters:
agentRef-- Returns:
-
getDiarcAgents
Get all named DIARC agents known to the system- Returns:
- current set of all DIARC agents including both embodied agents and agent "teams"
-