Package edu.tufts.hrilab.action.db
Class Database
java.lang.Object
edu.tufts.hrilab.action.db.Database
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addActionDBEntry
(ActionDBEntry entry) void
Add listenervoid
addPrimitiveActions
(ai.thinkingrobots.trade.TRADEServiceInfo constraints) Adds a list of primitive actions in the provided constraints.static void
Destroy Database singleton.void
static ActionDatabase
Convenience method to get action only DB (calls getInstance() internally).Get all named DIARC agents known to the systemstatic Database
Get Database singleton.static ObserverDatabase
Convenience method to get observer only DB (calls getInstance() internally).static OperatorDatabase
Convenience method to get operator only DB (calls getInstance() internally).static PerformanceMeasuresDatabase
Convenience method to get performance measures DB (calls getInstance() internally).static RecoveryPolicyDatabase
Convenience method to get recovery policy only DB (calls getInstance() internally).boolean
isDiarcAgent
(Symbol agentRef) Check if agentRef is a DIARC agent.void
loadDatabaseFiles
(String dbFileDir, List<String> dbFiles) Load database files and merge into existing database, assigning the specified agent to the parsed actions.void
loadDatabaseFromFile
(String dbfilename) Load database from file and merge into existing database.void
loadDatabaseFromFile
(String dbfilename, List<Symbol> agents) Load database from file and merge into existing database, assigning the specified agents to the parsed actions.void
loadPerformanceMeasuresFromFile
(String fileDir, List<String> filenames) Load action probabilities into databasevoid
removeActionDBEntry
(ActionDBEntry entry) void
Remove listenerprotected void
Write 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"
-