OperationalPetController::SchemaRunner Class Reference

#include <SchemaRunner.h>

Collaboration diagram for OperationalPetController::SchemaRunner:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 SchemaRunner (OPC *opc)
virtual ~SchemaRunner ()
Handle addLink (Type linkType, const HandleSeq &outgoing)
bool runSchema (const std::string &ruleName, const std::string &schemaName, const std::vector< std::string > &arguments)
void updateStatus (void)
Handle getExecutingSchemaImplicationLink ()
unsigned long getExecutingSchemaTimestamp ()
bool isExecutingSchema ()
bool isSchemaExecFinished ()
combo::vertex getSchemaExecResult ()
bool isSchemaExecFinished (Procedure::RunningProcedureID schemaId)
Procedure::RunningProcedureID getExecutingSchemaID (void) const

Private Attributes

OPCopc
bool executingSchema
Handle executingSchemaNode
time_t executingSchemaRealTime
Handle executingSchemaImplicationLink
unsigned long executingSchemaTimestamp
Procedure::RunningProcedureID executingSchemaID
SimpleTruthValuedefaultTruthValue
AttentionValuedefaultAttentionValue
float defaultMean
float defaultCount
long procedureExecutionTimeout
bool allowWalkingCancelation
bool petIsMoving
std::string currentWalkingProcedure
std::string currentWalkingTargetId

Friends

class RuleEngineUtil


Detailed Description

class SchemaRunner this class is responsible to receive a schemaname and execute it

Definition at line 40 of file SchemaRunner.h.


Constructor & Destructor Documentation

SchemaRunner::SchemaRunner ( OPC opc  ) 

SchemaRunner::~SchemaRunner (  )  [virtual]

Definition at line 50 of file SchemaRunner.cc.

References defaultAttentionValue, and defaultTruthValue.


Member Function Documentation

Handle SchemaRunner::addLink ( Type  linkType,
const HandleSeq &  outgoing 
)

bool SchemaRunner::runSchema ( const std::string &  ruleName,
const std::string &  schemaName,
const std::vector< std::string > &  arguments 
)

Returns true if the schema with the given name was really sent to ProcedureInterpreter to be executed.

Definition at line 67 of file SchemaRunner.cc.

References combo::abs_min_arity(), addLink(), AtomSpaceUtil::addNode(), opencog::AtomSpace::addTimeInfo(), allowWalkingCancelation, combo::arity(), Procedure::ProcedureRepository::contains(), currentWalkingProcedure, currentWalkingTargetId, opencog::Logger::debug(), opencog::Logger::error(), executingSchema, executingSchemaID, executingSchemaImplicationLink, executingSchemaNode, executingSchemaRealTime, executingSchemaTimestamp, opencog::Logger::fine(), Procedure::ProcedureRepository::get(), Procedure::GeneralProcedure::getArity(), opencog::BaseServer::getAtomSpace(), Spatial::LocalSpaceMap2D::getEntity(), opencog::AtomSpace::getHandle(), OperationalPetController::Pet::getLatestGotoTarget(), opencog::SpaceServer::getLatestMap(), opencog::SpaceServer::getLatestMapHandle(), PerceptionActionInterface::PAI::getLatestSimWorldTimestamp(), OperationalPetController::Pet::getMode(), Procedure::GeneralProcedure::getName(), OperationalPetController::OPC::getPAI(), OperationalPetController::OPC::getPet(), OperationalPetController::OPC::getProcedureInterpreter(), OperationalPetController::OPC::getProcedureRepository(), AtomSpaceUtil::getRuleImplicationLink(), opencog::AtomSpace::getSpaceServer(), Procedure::GeneralProcedure::getType(), opencog::Logger::info(), Procedure::ProcedureInterpreter::isFinished(), opencog::logger(), OC_ASSERT, opc, petIsMoving, procedureExecutionTimeout, Procedure::ProcedureInterpreter::runProcedure(), OperationalPetController::SCAVENGER_HUNT, SELECTED_RULE_PREDICATE_NAME, Procedure::ProcedureInterpreter::stopProcedure(), opencog::Handle::UNDEFINED, and opencog::Logger::warn().

Here is the caller graph for this function:

void SchemaRunner::updateStatus ( void   ) 

Update local variables that shows if the previous selected schema is running or finished

Definition at line 330 of file SchemaRunner.cc.

References executingSchema, executingSchemaID, OperationalPetController::OPC::getProcedureInterpreter(), Procedure::ProcedureInterpreter::isFinished(), opc, and petIsMoving.

Handle OperationalPetController::SchemaRunner::getExecutingSchemaImplicationLink (  )  [inline]

Return the rule implication link for the current executing schema. UndefinedHandle is returned if there is no executing schema.

Definition at line 67 of file SchemaRunner.h.

References executingSchemaImplicationLink.

Here is the caller graph for this function:

unsigned long OperationalPetController::SchemaRunner::getExecutingSchemaTimestamp (  )  [inline]

Return the start timestamp for the current executing schema.

Definition at line 74 of file SchemaRunner.h.

References executingSchemaTimestamp.

Here is the caller graph for this function:

bool OperationalPetController::SchemaRunner::isExecutingSchema ( void   )  [inline]

Return true if there is an schema being executed or false otherwise.

Definition at line 81 of file SchemaRunner.h.

References isSchemaExecFinished().

Here is the caller graph for this function:

bool OperationalPetController::SchemaRunner::isSchemaExecFinished (  )  [inline]

Return true if the current executing schema Id has finished its execution, false otherwise.

Definition at line 89 of file SchemaRunner.h.

References executingSchemaID.

Here is the caller graph for this function:

combo::vertex SchemaRunner::getSchemaExecResult (  ) 

Return the result for the executing schema Id. If called before the schema has finished its execution an assertion exception will be raised. So always use isSchemaExecFinished() before getting the result.

Returns:
the schema execution result

Definition at line 340 of file SchemaRunner.cc.

References combo::id::action_failure, combo::id::action_success, executingSchemaID, OperationalPetController::OPC::getProcedureInterpreter(), Procedure::ProcedureInterpreter::getResult(), Procedure::ProcedureInterpreter::isFailed(), and opc.

Here is the caller graph for this function:

bool OperationalPetController::SchemaRunner::isSchemaExecFinished ( Procedure::RunningProcedureID  schemaId  )  [inline]

Procedure::RunningProcedureID OperationalPetController::SchemaRunner::getExecutingSchemaID ( void   )  const [inline]

Definition at line 111 of file SchemaRunner.h.

References executingSchemaID.

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class RuleEngineUtil [friend]

Definition at line 138 of file SchemaRunner.h.


Member Data Documentation

Definition at line 116 of file SchemaRunner.h.

Definition at line 119 of file SchemaRunner.h.

Definition at line 120 of file SchemaRunner.h.

Definition at line 121 of file SchemaRunner.h.

Definition at line 122 of file SchemaRunner.h.

Definition at line 123 of file SchemaRunner.h.

Definition at line 125 of file SchemaRunner.h.

Definition at line 126 of file SchemaRunner.h.

Definition at line 127 of file SchemaRunner.h.

Definition at line 129 of file SchemaRunner.h.

Definition at line 130 of file SchemaRunner.h.

Definition at line 131 of file SchemaRunner.h.

Definition at line 132 of file SchemaRunner.h.

Definition at line 134 of file SchemaRunner.h.

Definition at line 135 of file SchemaRunner.h.

Definition at line 136 of file SchemaRunner.h.


The documentation for this class was generated from the following files:

Generated on Fri Dec 4 23:24:57 2009 for OpenCog Framework by  doxygen 1.5.6