org.micropsi.comp.agent.micropsi.actions
Class EatAction

java.lang.Object
  extended byorg.micropsi.comp.agent.micropsi.actions.EatAction
All Implemented Interfaces:
ActionTranslatorIF

public class EatAction
extends java.lang.Object
implements ActionTranslatorIF


Constructor Summary
EatAction(NetFacadeIF net, MicroPsiAgent agent, Logger logger)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EatAction

public EatAction(NetFacadeIF net,
                 MicroPsiAgent agent,
                 Logger logger)
Method Detail

getActionID

public java.lang.String getActionID()
Description copied from interface: ActionTranslatorIF
Returns the ID of the action that this translator will construct.

Specified by:
getActionID in interface ActionTranslatorIF
Returns:
the action's id

calculateAction

public MAction calculateAction()
Description copied from interface: ActionTranslatorIF
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).

Specified by:
calculateAction in interface ActionTranslatorIF
Returns:
the action to be sent to the world.

receiveActionResult

public void receiveActionResult(double value)
Description copied from interface: ActionTranslatorIF
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.

Specified by:
receiveActionResult in interface ActionTranslatorIF
Parameters:
value - the success of this action's execution

getCurrentActionPriority

public double getCurrentActionPriority()
Description copied from interface: ActionTranslatorIF
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".

Specified by:
getCurrentActionPriority in interface ActionTranslatorIF
Returns:
the action's priority for this step.

dontCalculateAction

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

Specified by:
dontCalculateAction in interface ActionTranslatorIF

shutdown

public void shutdown()
Description copied from interface: ActionTranslatorIF
This is called directly before destruction and should be used to unregister listeners etc.

Specified by:
shutdown in interface ActionTranslatorIF

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

.