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

IDEA::PslToken Class Reference
[PlanServer handle classes]

A token. More...

#include <PslToken.hh>

List of all members.

Public Methods

 ~PslToken ()
PslTokenImplgetImpl () const
void commit () const
 Commits the current token, commiting a token disables it from being freed in case of a recovery. See commited token.

bool isCommitted () const
 Returns true if the invoking token is commited otherwise returns false. See commited token.

bool isExecuting (const Time &t) const
 Returns true if the token would be considered executing if the current time would be t. See executing token.

bool canBeCommitted () const
 See commited token.

bool isEnabled () const
 Returns true if the invoking token is enabled (it can be ended) by invoking PslToken::isEnabled See enabled token.

void setEnabled (bool value=true) const
 Sets the invoking token to be enabled. See enabled token.

void activateTimelineAssignedConstraints (int authority) const
 Activates (and created if required) all the constraints which need to be maintained for a token assigned to a timeline.

void deActivateTimelineAssignedConstraints () const
 De-activates all the constraints which need to be maintained for a token assigned to a timeline.

void activateActiveConstraints (int authority) const
 Activates (and created if required) all the constraints which need to be maintained for an active token.

void deActivateActiveConstraints () const
 De-activates all the constraints which need to be maintained for an active token.

int getId () const
 Returns unique identifier of the invoking token. Can be used to retrieve the token from the PslDatabase instance.

const std::string & getName () const
 Returns the name of the invoking token. Corresponds to the name of the predicate associated with the invoking token and therefor is not unique.

void print (std::ostream &os) const
 Streams token information to os.

bool usesCPU () const
 Returns true if the token uses CPU otherwise returns false.

bool endsAtStart (const PslToken *token) const
 Returns true if the invoking token ends at the start of the token otherwise returns false.

void setSuccessor (const PslToken *token) const
 Sets the successor of the invoking token to be token.

bool returnsStatus () const
 Returns true if the invoking token returns a status otherwise returns false. See returns a status.

bool isAuthorized () const
 Returns true if the invoking token is authorized otherwise returns false. See authorized token.

bool hasDirectSuccessor (const PslTimeline *tl) const
 Returns true if the invoking token has a direct succesor on the timeline tl, otherwise returns false.

PslParameterList getParameters () const
 Returns the list of parameters of the invoking token.

bool isGoal () const
 Returns true if the invoking token is a goal token otherwise returns false. See goal token.

bool isExecutable () const
 Returns true if the invoking token is an executable token otherwise returns false. See executable token.

bool isFinalized () const
 Returns true if the invoking token has been finalized otherwise returns false. A finalized token is a token...

bool isControllable () const
 Returns true if the invoking token is controllable otherwise returns false. See controllable token.

bool isOpenLoop () const
 Returns true if the token is open-loop otherwise returns false.

const PslDatabasegetDatabase () const
 Returns the database of the invoking token.

Time getEarliestEndTime () const
 Returns the earliest end time of the invoking token.

Time getLatestEndTime () const
 Returns the latest end time of the invoking token.

Time getMaximumDuration () const
 Returns the maximum duration of the invoking token.

Time getMinimumDuration () const
 Returns the minimum duration of the invoking token.

Time getEarliestStartTime () const
 Returns the earliest start time of the invoking token.

Time getLatestStartTime () const
 Returns the latest start time of the invoking token.

int getExternalId () const
void setEarliestEndTime (const Time &value) const
 Sets the earliest-end-time of the invoking token to value.

void setLatestEndTime (const Time &value) const
 Sets the latest-end-time of the invoking token to value.

void setLatestStartTime (const Time &value) const
 Sets the latest-start-time of the invoking token to value.

void setEarliestStartTime (const Time &value) const
 Sets the earliest-start-time of the invoking token to value.

const PslTimelinegetTimeline () const
 Returns the PslTimeline instance of the invoking token.

const TokenLocationgetSourceLocation () const
 Returns the source-location of the invoking token.

const std::string & getComRelayName () const
 Returns the ComRelay name via which the token came into the AgentRelay of the invoking token. Will return the constant string UNKNOWN of the ComRelay-name is unknown.

const PslParametergetReturnStatusParameter () const
 Returns the return-status parameter. Returns 0 if the invoking token has no return-status-flag parameter.

const PslParametergetReturnStatusFlagParameter () const
 Returns the return-status-flag parameter. Returns 0 if the invoking token has no return-status-flag parameter.

const PslParametergetParameter (int index) const
 Return the parameter with index index. Raises an error if no such parameter exists.

const PslParametergetParameter (const std::string &parameterName) const
 Return the parameter with name parameterName. Returns null if parameter does not exists.

const PslPredicategetPredicate () const
 Returns the PslPredicate associated with the invoking token.

const TokenLocationgetTargetLocation () const
const PslVariablegetStartVariable () const
 Returns an instance of PslVariable representing the start time of the invoking token.

const PslVariablegetEndVariable () const
 Returns an instance of PslVariable representing the end time of the invoking token.

void finalize () const
 Finalizes the token.

bool endsNoEarlierThanEnd (const PslToken *token) const

Static Public Methods

const PslToken * getExternalizedToken (unsigned int tokenId)
 Returns a pointer to the instance of the externalized token with token id tokenId. An externalized token is a token which got a unique external-token id assigned to it by the invoking agent. If no such token exists a null-pointer is returned.


Private Methods

 PslToken (PslTokenImpl *impl)
void enforceOutputConstraint ()
 EnforceOutputConstraint enables the output-received constraint.

void relaxOutputConstraint ()
 Relaxes the output-constraint (see PslToken::enforceOutputConstraint).


Private Attributes

PslTokenImplm_Impl

Friends

class PslDatabaseImpl


Detailed Description

A token.

class PslToken


Constructor & Destructor Documentation

IDEA::PslToken::~PslToken  
 

IDEA::PslToken::PslToken PslTokenImpl   impl [private]
 


Member Function Documentation

void IDEA::PslToken::activateActiveConstraints int    authority const
 

Activates (and created if required) all the constraints which need to be maintained for an active token.

void IDEA::PslToken::activateTimelineAssignedConstraints int    authority const
 

Activates (and created if required) all the constraints which need to be maintained for a token assigned to a timeline.

bool IDEA::PslToken::canBeCommitted  
 

See commited token.

void IDEA::PslToken::commit  
 

Commits the current token, commiting a token disables it from being freed in case of a recovery. See commited token.

void IDEA::PslToken::deActivateActiveConstraints  
 

De-activates all the constraints which need to be maintained for an active token.

void IDEA::PslToken::deActivateTimelineAssignedConstraints  
 

De-activates all the constraints which need to be maintained for a token assigned to a timeline.

bool IDEA::PslToken::endsAtStart const PslToken *    token const
 

Returns true if the invoking token ends at the start of the token otherwise returns false.

The token ends at the start of the token if this is enforced by constraint, it is not sufficient that the bounds of the start and end are the same.

bool IDEA::PslToken::endsNoEarlierThanEnd const PslToken *    token const
 

calculates temporal distance between end time variables of 2 tokens. Returns true if current token's end event must match or precede given token's end event

void IDEA::PslToken::enforceOutputConstraint   [private]
 

EnforceOutputConstraint enables the output-received constraint.

The output-received constraint maintains the following invariants:

For a goal token
For an executable token
For non-goal and non-executable tokens

void IDEA::PslToken::finalize  
 

Finalizes the token.

Finalizing the token involves:

  • commiting the start and end time to current time
  • finalizing the parameter values

const std::string & IDEA::PslToken::getComRelayName  
 

Returns the ComRelay name via which the token came into the AgentRelay of the invoking token. Will return the constant string UNKNOWN of the ComRelay-name is unknown.

const PslDatabase * IDEA::PslToken::getDatabase  
 

Returns the database of the invoking token.

Time IDEA::PslToken::getEarliestEndTime  
 

Returns the earliest end time of the invoking token.

Time IDEA::PslToken::getEarliestStartTime  
 

Returns the earliest start time of the invoking token.

const PslVariable * IDEA::PslToken::getEndVariable  
 

Returns an instance of PslVariable representing the end time of the invoking token.

int IDEA::PslToken::getExternalId  
 

const PslToken* IDEA::PslToken::getExternalizedToken unsigned int    tokenId [static]
 

Returns a pointer to the instance of the externalized token with token id tokenId. An externalized token is a token which got a unique external-token id assigned to it by the invoking agent. If no such token exists a null-pointer is returned.

Typically one will assign an external token id to a token for which one sends messages out and one potentially receives information back for. The external-token id is used to make a mapping between the message and the receiving token.

int IDEA::PslToken::getId  
 

Returns unique identifier of the invoking token. Can be used to retrieve the token from the PslDatabase instance.

PslTokenImpl * IDEA::PslToken::getImpl  
 

Time IDEA::PslToken::getLatestEndTime  
 

Returns the latest end time of the invoking token.

Time IDEA::PslToken::getLatestStartTime  
 

Returns the latest start time of the invoking token.

Time IDEA::PslToken::getMaximumDuration  
 

Returns the maximum duration of the invoking token.

Time IDEA::PslToken::getMinimumDuration  
 

Returns the minimum duration of the invoking token.

const std::string & IDEA::PslToken::getName  
 

Returns the name of the invoking token. Corresponds to the name of the predicate associated with the invoking token and therefor is not unique.

const PslParameter * IDEA::PslToken::getParameter const std::string &    parameterName const
 

Return the parameter with name parameterName. Returns null if parameter does not exists.

const PslParameter * IDEA::PslToken::getParameter int    index const
 

Return the parameter with index index. Raises an error if no such parameter exists.

PslParameterList IDEA::PslToken::getParameters  
 

Returns the list of parameters of the invoking token.

const PslPredicate * IDEA::PslToken::getPredicate  
 

Returns the PslPredicate associated with the invoking token.

const PslParameter * IDEA::PslToken::getReturnStatusFlagParameter  
 

Returns the return-status-flag parameter. Returns 0 if the invoking token has no return-status-flag parameter.

const PslParameter * IDEA::PslToken::getReturnStatusParameter  
 

Returns the return-status parameter. Returns 0 if the invoking token has no return-status-flag parameter.

const TokenLocation & IDEA::PslToken::getSourceLocation  
 

Returns the source-location of the invoking token.

Not all tokens have a source-location, if this is the case all the fields in the returned SourceLocation instance have value TokenLocation::UNKNOWN

const PslVariable * IDEA::PslToken::getStartVariable  
 

Returns an instance of PslVariable representing the start time of the invoking token.

const TokenLocation & IDEA::PslToken::getTargetLocation  
 

const PslTimeline * IDEA::PslToken::getTimeline  
 

Returns the PslTimeline instance of the invoking token.

bool IDEA::PslToken::hasDirectSuccessor const PslTimeline   tl const
 

Returns true if the invoking token has a direct succesor on the timeline tl, otherwise returns false.

A direct succesor B of token A is defined as A.end equals B.start enforced (zero distance in the temporal network).

bool IDEA::PslToken::isAuthorized  
 

Returns true if the invoking token is authorized otherwise returns false. See authorized token.

bool IDEA::PslToken::isCommitted  
 

Returns true if the invoking token is commited otherwise returns false. See commited token.

bool IDEA::PslToken::isControllable  
 

Returns true if the invoking token is controllable otherwise returns false. See controllable token.

bool IDEA::PslToken::isEnabled  
 

Returns true if the invoking token is enabled (it can be ended) by invoking PslToken::isEnabled See enabled token.

bool IDEA::PslToken::isExecutable  
 

Returns true if the invoking token is an executable token otherwise returns false. See executable token.

bool IDEA::PslToken::isExecuting const Time   t const
 

Returns true if the token would be considered executing if the current time would be t. See executing token.

bool IDEA::PslToken::isFinalized  
 

Returns true if the invoking token has been finalized otherwise returns false. A finalized token is a token...

bool IDEA::PslToken::isGoal  
 

Returns true if the invoking token is a goal token otherwise returns false. See goal token.

bool IDEA::PslToken::isOpenLoop  
 

Returns true if the token is open-loop otherwise returns false.

A token is open-loop if...

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

Streams token information to os.

void IDEA::PslToken::relaxOutputConstraint   [private]
 

Relaxes the output-constraint (see PslToken::enforceOutputConstraint).

When a constraint is relaxed the invariant are no longer maintained.

bool IDEA::PslToken::returnsStatus  
 

Returns true if the invoking token returns a status otherwise returns false. See returns a status.

void IDEA::PslToken::setEarliestEndTime const Time   value const
 

Sets the earliest-end-time of the invoking token to value.

Be aware that (depending on the plan-database technology) this will error out if not in a search when one ends up with an inconsistency due to this assignment.

void IDEA::PslToken::setEarliestStartTime const Time   value const
 

Sets the earliest-start-time of the invoking token to value.

Be aware that (depending on the plan-database technology) this will error out if not in a search when one ends up with an inconsistency due to this assignment.

void IDEA::PslToken::setEnabled bool    value = true const
 

Sets the invoking token to be enabled. See enabled token.

void IDEA::PslToken::setLatestEndTime const Time   value const
 

Sets the latest-end-time of the invoking token to value.

Be aware that (depending on the plan-database technology) this will error out if not in a search when one ends up with an inconsistency due to this assignment.

void IDEA::PslToken::setLatestStartTime const Time   value const
 

Sets the latest-start-time of the invoking token to value.

Be aware that (depending on the plan-database technology) this will error out if not in a search when one ends up with an inconsistency due to this assignment.

void IDEA::PslToken::setSuccessor const PslToken *    token const
 

Sets the successor of the invoking token to be token.

bool IDEA::PslToken::usesCPU  
 

Returns true if the token uses CPU otherwise returns false.

This information is used for determining if we can warp. Warping is skipping of time if we can so (which only makes sense in simulation mode). Warping can not take place if a procedure (token) is being executed using CPU.


Friends And Related Function Documentation

friend class PslDatabaseImpl [friend]
 


Member Data Documentation

PslTokenImpl* IDEA::PslToken::m_Impl [private]
 


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