com.epochx.action
Class Action

java.lang.Object
  extended by com.epochx.action.Action
Direct Known Subclasses:
AntAction

public abstract class Action
extends java.lang.Object

Actions provide a system for performing events or actions that have side-effects rather than returning a literal value. For problems such as the artificial ant, instead of CandidatePrograms being defined as having a return type of boolean or double, they have a return type of Action. As such different Action 'values' are used. The model will define TerminalsNodes with values that are Action objects such as AntMoveAction or AntTurnLeftAction.

When these TerminalNodes are evaluated, their action values get executed - which may result in an artificial ant moving across an artificial landscape. But all evaluations must return a result, and since the TYPE of these Nodes is Action, they return Action.DO_NOTHING which indicates that no further execution is required, and if executed will do nothing.


Field Summary
static Action DO_NOTHING
          This predefined Action object should be used when no action should be performed.
 
Constructor Summary
Action()
           
 
Method Summary
abstract  void execute()
          The execute method should be called to perform whatever action this Action represents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DO_NOTHING

public static final Action DO_NOTHING
This predefined Action object should be used when no action should be performed. Typically it is the return value of TerminalNode that have been evaluated/executed to indicate that there is no further action to be carried out.

Constructor Detail

Action

public Action()
Method Detail

execute

public abstract void execute()
The execute method should be called to perform whatever action this Action represents. Generally Actions are executed at evaluation.