Operational Avatar Controller

From OpenCog

This documents describes the Operational Avatar Controller (OAC) design.

The OAC class extends the EmbodimentCogServer class and uses external tick mode. This means OAC cycles will be triggered each time a tick message is received from an external clock (in this case, the Proxy for a Virtual World where the Embodiment system is connected to).

The OAC main loop processing incoming messages (fed by a socket listening thread) until there are no messages to process or until a TICK message is received.

Message types received by the OAC

  • PVP messages: sent by the Embodiment Proxy to report changes about the objects the avatar perceives in the world, physiological feelings, other objects' actions (including what avatars have said), status of previously sent actions (or action plans), instructions from its owner and others. In summary, any message that are related to what happened in the World the avatar is connected to. When this message is received, OAC updates its AtomSpace properly, adding/updating predicates according to the received message.
  • Schema messages: sent by LearningServer when it finds a schemata candidate for a trick being learned by the avatar. When OAC receives this message, it schedule the given schemata to be executed by the avatar so owner can check if it learned the trick well or not.
  • Spawner message: the only message sent by spawner so far is the SAVE_AND_EXIT message, which makes OAC to save its state (AtomSpace and other things) and exit.

MindAgents required by the OAC

When a TICK message is received, a CogServer cycle takes place and the scheduler executes the MindAgents registered in the OAC. Usually these include:

  • ProcedureInterpreterAgent - Executes the schemata (usually in Combo) scheduled to execution by the OAC. This includes the current action schema the avatar is executing (containing actions within the virtual world) and any internal schemata that may be running in background.
  • ActionSelectionAgent - Chooses the next action schema to be executed. This agent is based on a RuleEngine that checks precondition predicates (also combo procedures) for each existing rule and then filters them by context and weight to select the next action schema. In addition to rules to select the next action, there are also rules for updating emotional feelings and relations between the avatar and other entities in the world.
  • ImportanceDecayAgent - Updates the AttentionValues of all atoms in the AtomSpace, removing old perceptual data. This can work if we always decay STI by a fixed factor, ensuring that all atoms are removed after a number of cycles, unless they're been given a LTI boost, which is is a way to mark an atom as semi-permanent (to make them permanent one would set VLTI to NONDISPOSABLE). Permanent atoms include those that refer to known entities, built-in schemata, physiological and emotional feelings, contexts, etc.