org.micropsi.comp.agent.aaa
Interface ActionTranslatorIF

All Known Implementing Classes:
DrinkAction, EatAction, FocusAction, MoveAction, MovementAction, MovementAction, NoopAction

public interface ActionTranslatorIF

Action translators decide what (if any) action will be sent to the server and construct the MAction objects when needed.


Method Summary
 MAction calculateAction()
          This method will be called on the action translator with the highest priority.
 void dontCalculateAction()
          This method is called on the actions with lower priorities.
 java.lang.String getActionID()
          Returns the ID of the action that this translator will construct.
 double getCurrentActionPriority()
          Returns the action's current priority.
 void receiveActionResult(double value)
          Called every cycle to report the success of the action, without regard of previous cycle's priorities.
 void shutdown()
          This is called directly before destruction and should be used to unregister listeners etc.
 

Method Detail

getActionID

public java.lang.String getActionID()
Returns the ID of the action that this translator will construct.

Returns:
the action's id

getCurrentActionPriority

public double getCurrentActionPriority()
Returns the action's current priority. Every step the framework calls this method on all action translators. The action with the highest priority will "win".

Returns:
the action's priority for this step.

calculateAction

public MAction calculateAction()
This method will be called on the action translator with the highest priority. It returns the MAction object that will be sent to the world. If, for some reason, the action would be invalid or should not be sent, it is okay to return null (no action will be sent in that case).

Returns:
the action to be sent to the world.

dontCalculateAction

public void dontCalculateAction()
This method is called on the actions with lower priorities. (Those that did not "win") Typically used for cleaning up.


receiveActionResult

public void receiveActionResult(double value)
Called every cycle to report the success of the action, without regard of previous cycle's priorities. If the action was not sent to the server (if it didn't win, if calculateAction returned null) the value will simply be zero. Otherwise, the value will be the success value received from the server.

Parameters:
value - the success of this action's execution

shutdown

public void shutdown()
This is called directly before destruction and should be used to unregister listeners etc.


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

.