Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

IDEA::PslDatabase Class Reference
[PlanServer handle classes]

Maintains all the PlanServer instances. More...

#include <PslDatabase.hh>

List of all members.

Public Methods

 PslDatabase (PslModelManager *modelManager, const std::string &agentName, const std::string &name)
 Constructor.

 ~PslDatabase ()
 Destructor.

PslDatabaseImplgetImpl () const
void archive (const Time &t) const
 See archiving. Removes and releases PslToken instances from the invoking database whose values can no longer change due to decisions on variables and whose latest end time is befor t.

void resetContent () const
const std::string & getAgentName () const
 Returns the name of the agent passed in the construcor of the invoking database.

void setAgentName (const std::string &name) const
bool isConsistent () const
 Returns true if the invoking database is in a consistent state. A database is consistent if the state of all the variables does not violate any activated constraints.

const PslConstantcreateConstant (const std::string &name, double value, const PslConstantType &type) const
 Will create a constant by the name name with value value of type type. If a constant by the name name already exists with a different value and/or type this will raise an error. Will return the pointer to the (created) PslConstant.

const PslObjectcreateObject (const PslObjectClass *objectClass, const std::string &objectName) const
 Will create an instance of the object-class objectClassName by the name objectName and return a pointer to this instance. Will return the existing instance of PslObject if it already exists by the name objectName.

void lock (const std::string &location) const
 Requests a (recursive thread) lock on the database. Blocks untill the lock has been acquired.

void unLock (const std::string &location) const
 Releases the (recursive thread) lock on the database.

void setActiveUpdate () const
 Turns the active update on. When active updating is on changes in the underlying plan database will be handled immediatly. For example if a sub-goal is activated a PslToken instance will be created immediatly.

void setPassiveUpdate () const
 Turns the active update on. When active updating is off changes in the underlying plan database will be postponed untill PslDatabase::setActiveUpdate is invoked.

const PslTokencreateToken (const PslTimeline *timeline, const PslPredicate *predicate, const Time &earliestStart, const Time &latestStart, const Time &earliestEnd, const Time &latestEnd, int externalTokenId=-1, const TokenLocation &source=TokenLocation(), const std::string &comRelayName=UNKNOWN) const
 Creates a new PslToken instance.

const PslVariablecreateVariable (int lb, int ub, const std::string &name) const
 Creates a new PslVariable instance of type INT and interval [lb,ub].

const PslVariablecreateVariable (int value, const std::string &name) const
 Creates a new singleton PslVariable instance of type INT.

const PslVariablecreateVariable (const PslDataType &type, const std::string &name) const
 Creates a new PslVariable instance of type type with largest possible domain.

const PslVariablecreateVariable (double lb, double ub, const std::string &name) const
 Creates a new PslVariable instance of type REAL and interval [lb,ub].

const PslVariablecreateVariable (double value, const std::string &name) const
 Creates a new singleton PslVariable instance of type REAL.

const PslVariablecreateVariable (const PslLabelSet *ls, const std::string &name) const
 Creates a new PslVariable instance of type LABEL.

const PslVariablecreateBoolVariable (const std::string &name) const
 Creates a new PslVariable instance of type BOOL.

int externalize (const PslToken *token) const
 Will externalize PslToken instance token. Externalizing a token is creating a mapping between a unique integer (return value) and the token instance so we can map it back to a token using PslDatabase::getExternalizedToken.

const PslTokengetExternalizedToken (int id) const
 Returns the PslToken instance associated with external token identifier id. If no such token exists 0 will be returned.

const PslTokengetToken (int uid) const
 Returns token with unique identifier uid. The unique identifier does not have to correspond with the external token identifier.

const PslConstantgetConstant (const std::string &name) const
 Returns the PslConstant instance by the name name if it exists otherwise returns a null-pointer.

const PslModelManagergetModelManager () const
 Returns the PslModelManager instance associated with the invoked database.

const std::string & getName () const
 Returns the name of the invoking database.

const PslObjectgetObject (const std::string &name) const
 Returns the PslObject instance by the name name if it exists otherwise returns a null-pointer.

const PslObjectList getObjects () const
void setTime (const Time &time) const
 Sets the current time of the invoking databasem must be equal or greate than getTime to actually change the current time otherwise nothing is changed.

const Time getTime () const
 Returns the current time of the invoking database. The current time of a database is the time passed to PslDatabase::setTime.

void setPendingMessages (bool value) const
 Sets the pending messages flag to value. Typically this flag indicates messages are pending in the reactive planner queue to be handled.

const PslVariablegetVariable (int id) const
 Returns a variable with id id of such a variable instance exists otherwise returns 0.

const PslTrueFalseVariablegetPendingMessageVariable () const
 Returns the pending-message variable which is a variable which is always either true or false.

void removeVariable (const PslVariable *var) const
void print (std::ostream &os) const
 Prints token information to stream os.

void setPrintFilter (PslOutputFilter *filter, bool deleteInstance)
 Set a filter for printing the invoking database.


Private Attributes

PslDatabaseImplm_Impl


Detailed Description

Maintains all the PlanServer instances.


Constructor & Destructor Documentation

IDEA::PslDatabase::PslDatabase PslModelManager   modelManager,
const std::string &    agentName,
const std::string &    name
 

Constructor.

IDEA::PslDatabase::~PslDatabase  
 

Destructor.


Member Function Documentation

void IDEA::PslDatabase::archive const Time   t const
 

See archiving. Removes and releases PslToken instances from the invoking database whose values can no longer change due to decisions on variables and whose latest end time is befor t.

const PslVariable * IDEA::PslDatabase::createBoolVariable const std::string &    name const
 

Creates a new PslVariable instance of type BOOL.

const PslConstant * IDEA::PslDatabase::createConstant const std::string &    name,
double    value,
const PslConstantType   type
const
 

Will create a constant by the name name with value value of type type. If a constant by the name name already exists with a different value and/or type this will raise an error. Will return the pointer to the (created) PslConstant.

const PslObject * IDEA::PslDatabase::createObject const PslObjectClass   objectClass,
const std::string &    objectName
const
 

Will create an instance of the object-class objectClassName by the name objectName and return a pointer to this instance. Will return the existing instance of PslObject if it already exists by the name objectName.

Will raise an error if a PslObject name already exists with a PslObjectClass with a different name than objectClassName or if no PslObjectClass exists by the name objectClassName.

const PslToken * IDEA::PslDatabase::createToken const PslTimeline   timeline,
const PslPredicate   predicate,
const Time   earliestStart,
const Time   latestStart,
const Time   earliestEnd,
const Time   latestEnd,
int    externalTokenId = -1,
const TokenLocation   source = TokenLocation(),
const std::string &    comRelayName = UNKNOWN
const
 

Creates a new PslToken instance.

const PslVariable * IDEA::PslDatabase::createVariable const PslLabelSet   ls,
const std::string &    name
const
 

Creates a new PslVariable instance of type LABEL.

const PslVariable * IDEA::PslDatabase::createVariable double    value,
const std::string &    name
const
 

Creates a new singleton PslVariable instance of type REAL.

const PslVariable * IDEA::PslDatabase::createVariable double    lb,
double    ub,
const std::string &    name
const
 

Creates a new PslVariable instance of type REAL and interval [lb,ub].

const PslVariable * IDEA::PslDatabase::createVariable const PslDataType   type,
const std::string &    name
const
 

Creates a new PslVariable instance of type type with largest possible domain.

const PslVariable * IDEA::PslDatabase::createVariable int    value,
const std::string &    name
const
 

Creates a new singleton PslVariable instance of type INT.

const PslVariable * IDEA::PslDatabase::createVariable int    lb,
int    ub,
const std::string &    name
const
 

Creates a new PslVariable instance of type INT and interval [lb,ub].

int IDEA::PslDatabase::externalize const PslToken   token const
 

Will externalize PslToken instance token. Externalizing a token is creating a mapping between a unique integer (return value) and the token instance so we can map it back to a token using PslDatabase::getExternalizedToken.

const std::string & IDEA::PslDatabase::getAgentName  
 

Returns the name of the agent passed in the construcor of the invoking database.

const PslConstant * IDEA::PslDatabase::getConstant const std::string &    name const
 

Returns the PslConstant instance by the name name if it exists otherwise returns a null-pointer.

const PslToken * IDEA::PslDatabase::getExternalizedToken int    id const
 

Returns the PslToken instance associated with external token identifier id. If no such token exists 0 will be returned.

PslDatabaseImpl * IDEA::PslDatabase::getImpl  
 

const PslModelManager * IDEA::PslDatabase::getModelManager  
 

Returns the PslModelManager instance associated with the invoked database.

const std::string & IDEA::PslDatabase::getName  
 

Returns the name of the invoking database.

const PslObject * IDEA::PslDatabase::getObject const std::string &    name const
 

Returns the PslObject instance by the name name if it exists otherwise returns a null-pointer.

const PslObjectList IDEA::PslDatabase::getObjects  
 

\breif Returns all the PslObject instances associated with the invoking database.

const PslTrueFalseVariable * IDEA::PslDatabase::getPendingMessageVariable  
 

Returns the pending-message variable which is a variable which is always either true or false.

const Time IDEA::PslDatabase::getTime  
 

Returns the current time of the invoking database. The current time of a database is the time passed to PslDatabase::setTime.

const PslToken * IDEA::PslDatabase::getToken int    uid const
 

Returns token with unique identifier uid. The unique identifier does not have to correspond with the external token identifier.

const PslVariable * IDEA::PslDatabase::getVariable int    id const
 

Returns a variable with id id of such a variable instance exists otherwise returns 0.

bool IDEA::PslDatabase::isConsistent  
 

Returns true if the invoking database is in a consistent state. A database is consistent if the state of all the variables does not violate any activated constraints.

void IDEA::PslDatabase::lock const std::string &    location const
 

Requests a (recursive thread) lock on the database. Blocks untill the lock has been acquired.

void IDEA::PslDatabase::print std::ostream &    os const
 

Prints token information to stream os.

void IDEA::PslDatabase::removeVariable const PslVariable   var const
 

void IDEA::PslDatabase::resetContent  
 

void IDEA::PslDatabase::setActiveUpdate  
 

Turns the active update on. When active updating is on changes in the underlying plan database will be handled immediatly. For example if a sub-goal is activated a PslToken instance will be created immediatly.

void IDEA::PslDatabase::setAgentName const std::string &    name const
 

void IDEA::PslDatabase::setPassiveUpdate  
 

Turns the active update on. When active updating is off changes in the underlying plan database will be postponed untill PslDatabase::setActiveUpdate is invoked.

void IDEA::PslDatabase::setPendingMessages bool    value const
 

Sets the pending messages flag to value. Typically this flag indicates messages are pending in the reactive planner queue to be handled.

void IDEA::PslDatabase::setPrintFilter PslOutputFilter   filter,
bool    deleteInstance
 

Set a filter for printing the invoking database.

void IDEA::PslDatabase::setTime const Time   time const
 

Sets the current time of the invoking databasem must be equal or greate than getTime to actually change the current time otherwise nothing is changed.

void IDEA::PslDatabase::unLock const std::string &    location const
 

Releases the (recursive thread) lock on the database.


Member Data Documentation

PslDatabaseImpl* IDEA::PslDatabase::m_Impl [private]
 


Contact information
© IDEA
Generated on Fri Feb 3 17:09:47 2006 for IDEA.