#include <Xabsl2Engine.h>
Inheritance diagram for Xabsl2Engine:
Public Member Functions | |
Xabsl2Engine (Xabsl2ErrorHandler &e, unsigned long(*pTimeFunction)()) | |
Constructor. | |
~Xabsl2Engine () | |
Destructor. | |
void | execute () |
Executes the engine for the selected agent starting from the root option. | |
void | executeSelectedBasicBehavior () |
Executes only the selected basic behavior. | |
void | createOptionGraph (Xabsl2InputSource &input) |
Reads the intermediate code from an input source and creates the option graph. | |
void | registerBasicBehavior (Xabsl2BasicBehavior &basicBehavior) |
Registers a basic behavior at the engine. | |
bool | setSelectedAgent (const char *name) |
Sets the selected Agent. | |
Debugging Interface | |
bool | setRootOption (const char *name) |
Executes the option graph starting from a given option. | |
void | setRootOption () |
Sets the root option of the selected agent. | |
const Xabsl2Option * | getRootOption () const |
Returns the selected root option. | |
bool | setOptionParameter (const char *name, const char *param, double value) |
Sets a parameter of a option. | |
bool | setSelectedBasicBehavior (const char *name) |
Sets the selected basic behavior. | |
bool | setBasicBehaviorParameter (const char *name, const char *param, double value) |
Sets a parameter of a basic behavior. | |
const char * | getSelectedAgentName () |
Returns the name of the selected agent. | |
const Xabsl2BasicBehavior * | getSelectedBasicBehavior () |
Returns the selected basic behavior. | |
Private Member Functions | |
bool | checkForLoops (Xabsl2Option *currenOptionPath[], int currentDepth) |
A recursive function that is used to check for loops in the option graph. | |
Private Attributes | |
Xabsl2Array< Xabsl2Agent * > | agents |
The agents of the engine. | |
Xabsl2Agent * | selectedAgent |
The selected agent. | |
Xabsl2Array< Xabsl2Option * > | options |
The options of the engine. | |
Xabsl2Option * | rootOption |
The option where the execution of the option graph starts. | |
Xabsl2Array< Xabsl2BasicBehavior & > | basicBehaviors |
The registered basic behaviors of the engine. | |
Xabsl2BasicBehavior * | selectedBasicBehavior |
The selected basic behavior. | |
Xabsl2ErrorHandler & | errorHandler |
Is invoked when there are problems during initialization. | |
bool | initialized |
If true, the engine was successfully initialized. | |
unsigned long(* | pTimeFunction )() |
A pointer to a function that returns the system time in ms. |
Martin Lötzsch
Definition at line 22 of file Xabsl2Engine.h.
|
Constructor.
Definition at line 12 of file Xabsl2Engine.cpp. References e. |
|
Destructor.
Definition at line 19 of file Xabsl2Engine.cpp. References agents, Xabsl2Array< Xabsl2Agent * >::getSize(), Xabsl2Array< Xabsl2Option * >::getSize(), and options. |
Here is the call graph for this function:
|
Executes the engine for the selected agent starting from the root option. (Including the selected basic behavior) Definition at line 30 of file Xabsl2Engine.cpp. References Xabsl2Option::activeState, Xabsl2Option::execute(), executeSelectedBasicBehavior(), Xabsl2Array< Xabsl2Option * >::getSize(), Xabsl2Option::optionIsActive, options, Xabsl2Option::optionWasActive, selectedBasicBehavior, Xabsl2Symbols::setOutputSymbols(), Xabsl2State::subsequentBasicBehavior, and Xabsl2State::subsequentOption. Referenced by GTXabsl2EngineExecutor::executeEngine(). |
Here is the call graph for this function:
|
Executes only the selected basic behavior.
Definition at line 60 of file Xabsl2Engine.cpp. References basicBehaviors, Xabsl2BasicBehavior::basicBehaviorWasActiveDuringLastExecutionOfEngine, Xabsl2BasicBehavior::execute(), Xabsl2Array< Xabsl2BasicBehavior & >::getSize(), and selectedBasicBehavior. Referenced by execute(), and GTXabsl2EngineExecutor::executeEngine(). |
Here is the call graph for this function:
|
Reads the intermediate code from an input source and creates the option graph. Note that the basic behaviors and symbols have to be registered before that function is called. Definition at line 73 of file Xabsl2Engine.cpp. References agents, Xabsl2Array< Xabsl2Agent * >::append(), Xabsl2Array< Xabsl2Option * >::append(), basicBehaviors, checkForLoops(), Xabsl2InputSource::close(), Xabsl2ErrorHandler::error(), Xabsl2ErrorHandler::errorsOccurred, Xabsl2Array< Xabsl2Option * >::getElement(), Xabsl2Agent::getRootOption(), Xabsl2Array< Xabsl2Agent * >::getSize(), Xabsl2ErrorHandler::message(), Xabsl2NamedItem::n, Xabsl2InputSource::open(), options, Xabsl2InputSource::readString(), Xabsl2InputSource::readValue(), selectedAgent, selectedBasicBehavior, and XABSL2_DEBUG_INIT. Referenced by GTXabsl2EngineExecutor::init(). |
Here is the call graph for this function:
|
Registers a basic behavior at the engine. This must be done before the intermediate code is read.
Definition at line 185 of file Xabsl2Engine.cpp. References Xabsl2Array< Xabsl2BasicBehavior & >::append(), basicBehaviors, Xabsl2ErrorHandler::error(), Xabsl2Array< Xabsl2BasicBehavior & >::exists(), Xabsl2ErrorHandler::message(), Xabsl2NamedItem::n, and XABSL2_DEBUG_INIT. Referenced by GT2004HeadControlBasicBehaviors::registerBasicBehaviors(), GT2004SimpleBasicBehaviors::registerBasicBehaviors(), GT2004PotentialFieldBasicBehaviors::registerBasicBehaviors(), GT2004EvolutionBasicBehaviors::registerBasicBehaviors(), and CommonBasicBehaviors::registerBasicBehaviors(). |
Here is the call graph for this function:
|
Sets the selected Agent. If the last selected agent was different from the new one, the root option is changed depending on the new agent.
Definition at line 273 of file Xabsl2Engine.cpp. References agents, Xabsl2Array< Xabsl2Agent * >::exists(), Xabsl2Array< Xabsl2Agent * >::getElement(), Xabsl2Agent::getRootOption(), and selectedAgent. Referenced by GTXabsl2EngineExecutor::setSelectedAgent(). |
Here is the call graph for this function:
|
A recursive function that is used to check for loops in the option graph.
Definition at line 146 of file Xabsl2Engine.cpp. References Xabsl2ErrorHandler::error(), Xabsl2Array< Xabsl2State * >::getSize(), Xabsl2NamedItem::n, and Xabsl2Option::states. Referenced by createOptionGraph(). |
Here is the call graph for this function:
|
Executes the option graph starting from a given option. Can be called to test a single option.
Definition at line 208 of file Xabsl2Engine.cpp. References Xabsl2Array< Xabsl2Option * >::exists(), Xabsl2Array< Xabsl2Option * >::getElement(), and options. Referenced by GTXabsl2EngineExecutor::executeEngine(), and GTXabsl2EngineExecutor::handleMessage(). |
Here is the call graph for this function:
|
Sets the root option of the selected agent.
Definition at line 219 of file Xabsl2Engine.cpp. References Xabsl2Agent::getRootOption(), and selectedAgent. |
Here is the call graph for this function:
|
Returns the selected root option.
Definition at line 224 of file Xabsl2Engine.cpp. Referenced by GTXabsl2Profiler::doProfiling(), GTXabsl2Profiler::init(), and GTXabsl2EngineExecutor::sendDebugMessage(). |
|
Sets a parameter of a option.
Definition at line 246 of file Xabsl2Engine.cpp. References Xabsl2Array< double >::exists(), Xabsl2Array< Xabsl2Option * >::exists(), Xabsl2Array< Xabsl2Option * >::getElement(), options, Xabsl2Option::parameters, and Xabsl2Array< double >::setElement(). Referenced by GTXabsl2EngineExecutor::handleMessage(). |
Here is the call graph for this function:
|
Sets the selected basic behavior. Can be called to test a single basic behavior.
Definition at line 197 of file Xabsl2Engine.cpp. References basicBehaviors, Xabsl2Array< Xabsl2BasicBehavior & >::exists(), Xabsl2Array< Xabsl2BasicBehavior & >::getElement(), and selectedBasicBehavior. Referenced by GTXabsl2EngineExecutor::handleMessage(). |
Here is the call graph for this function:
|
Sets a parameter of a basic behavior.
Definition at line 229 of file Xabsl2Engine.cpp. References basicBehaviors, Xabsl2Array< double & >::exists(), Xabsl2Array< Xabsl2BasicBehavior & >::exists(), Xabsl2Array< Xabsl2BasicBehavior & >::getElement(), Xabsl2BasicBehavior::parameters, and Xabsl2Array< double & >::setElement(). Referenced by GTXabsl2EngineExecutor::handleMessage(). |
Here is the call graph for this function:
|
Returns the name of the selected agent.
Definition at line 263 of file Xabsl2Engine.cpp. References Xabsl2NamedItem::n, and selectedAgent. Referenced by GTXabsl2EngineExecutor::sendDebugMessage(). |
|
Returns the selected basic behavior.
Definition at line 268 of file Xabsl2Engine.cpp. References selectedBasicBehavior. Referenced by GTXabsl2EngineExecutor::sendDebugMessage(). |
|
The agents of the engine.
Definition at line 69 of file Xabsl2Engine.h. Referenced by createOptionGraph(), setSelectedAgent(), and ~Xabsl2Engine(). |
|
The selected agent.
Definition at line 72 of file Xabsl2Engine.h. Referenced by createOptionGraph(), getSelectedAgentName(), setRootOption(), and setSelectedAgent(). |
|
The options of the engine.
Definition at line 75 of file Xabsl2Engine.h. Referenced by createOptionGraph(), execute(), setOptionParameter(), setRootOption(), and ~Xabsl2Engine(). |
|
The option where the execution of the option graph starts.
Definition at line 78 of file Xabsl2Engine.h. |
|
The registered basic behaviors of the engine.
Definition at line 81 of file Xabsl2Engine.h. Referenced by createOptionGraph(), executeSelectedBasicBehavior(), registerBasicBehavior(), setBasicBehaviorParameter(), and setSelectedBasicBehavior(). |
|
The selected basic behavior.
Definition at line 84 of file Xabsl2Engine.h. Referenced by createOptionGraph(), execute(), executeSelectedBasicBehavior(), getSelectedBasicBehavior(), and setSelectedBasicBehavior(). |
|
Is invoked when there are problems during initialization.
Reimplemented from Xabsl2Symbols. Definition at line 87 of file Xabsl2Engine.h. |
|
If true, the engine was successfully initialized.
Definition at line 98 of file Xabsl2Engine.h. |
|
A pointer to a function that returns the system time in ms.
|