org.micropsi.comp.robot
Class RobotActionExecutor

java.lang.Object
  extended byorg.micropsi.comp.robot.RobotActionExecutor

public abstract class RobotActionExecutor
extends java.lang.Object


Constructor Summary
RobotActionExecutor()
           
 
Method Summary
abstract  MActionResponse executeAction(MAction action)
          Implementations should execute the desired action and return immediate results here.
protected  java.lang.String getConfigEntry(java.lang.String entry)
          Returns a String entry from the configuration.
protected  java.lang.String getConnectedAgent()
          Returns the name of the agent currently controlling the robot.
abstract  ConsoleQuestionTypeIF[] getConsoleQuestionContributions()
          Implementations should return an array of contributions to the console Q/A system.
protected static RobotActionExecutor getInstance()
           
protected  Logger getLogger()
          Returns the logger for this component.
protected static void setup(java.lang.String classname, ConfigurationReaderIF config, java.lang.String prefix, RobotWorldComponent tecLayer)
           
abstract  void shutdown()
          Called when the action executor should terminate.
abstract  void tick(long simStep)
          Called periodically right before a new system cycle begins.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RobotActionExecutor

public RobotActionExecutor()
Method Detail

setup

protected static final void setup(java.lang.String classname,
                                  ConfigurationReaderIF config,
                                  java.lang.String prefix,
                                  RobotWorldComponent tecLayer)
                           throws MicropsiException
Throws:
MicropsiException

getInstance

protected static final RobotActionExecutor getInstance()
                                                throws MicropsiException
Throws:
MicropsiException

getLogger

protected Logger getLogger()
Returns the logger for this component.

Returns:
a Logger

getConfigEntry

protected java.lang.String getConfigEntry(java.lang.String entry)
                                   throws MicropsiConfigException
Returns a String entry from the configuration.

Parameters:
entry - the entry's name in the configuration
Returns:
the entry
Throws:
MicropsiConfigException - if there is no such entry

getConnectedAgent

protected java.lang.String getConnectedAgent()
Returns the name of the agent currently controlling the robot.

Returns:
the name of the agent.

executeAction

public abstract MActionResponse executeAction(MAction action)
Implementations should execute the desired action and return immediate results here. "Immediate results" doesn't have to mean all to much with robots, as probably no results will be known at that time. And as this method should return immediately, the immediate results will, in robot environments, probably be simply something like "Ok I can use that actuator at that point". Again there's the distribution issue, see

Parameters:
action - the Action to be executed.
Returns:
an MActionResponse with immediate results which must not be null and MUST have the agent name set. (get the Agent name via getConnectedAgent()).
See Also:
for a discussion of possible problems with distribution.

Once more, the constraints:
  1. Return immediately, do not wait until the action has been executed fully
  2. This method is called exactly once per Micropsi system cycle
  3. MActionResponse doesn't need to contain anything, if there is nothing to report at that point of time.

getConsoleQuestionContributions

public abstract ConsoleQuestionTypeIF[] getConsoleQuestionContributions()
Implementations should return an array of contributions to the console Q/A system. If you want to have any communication with consoles, this is the place to implement it. The question types you return here will be registered with the RobotWorldComponent and then be available for the system's consoles.
There is another getConsoleQuestionContributions() method in the perception extractor. The two methods are treated independently and equally. Implementations decide where to register which question type.
If the implementation does not want to provide answers to any console questions, this method may return null or an empty array safely.

Returns:
an array of ConsoleQuestionTypeIF implementations or null

tick

public abstract void tick(long simStep)
Called periodically right before a new system cycle begins. (Before the actions are executed).

Parameters:
simStep -

shutdown

public abstract void shutdown()
Called when the action executor should terminate. (When the MRS is going down)


(c) by Micropsi Project: http://www.cognitive-agents.org

.