edu.sc.ants
Class Action

java.lang.Object
  |
  +--edu.sc.ants.Action

public class Action
extends java.lang.Object

An action taken by an agent


Field Summary
 java.lang.String type
          The type of action.
 double value
          An amount associated with the type.
 
Constructor Summary
Action(java.lang.String s)
          Action constructor.
Action(java.lang.String a, double d)
          Action constructor.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

type

public java.lang.String type
The type of action. Legal values include "move", "heading", "nothing".

value

public double value
An amount associated with the type. That is, how much to "move" (in pixels), turn ("heading") (in radians). All values are relative to current position and heading. For example, setting value to 10 and type = "move" means to move forward 10 points.
Constructor Detail

Action

public Action(java.lang.String a,
              double d)
Action constructor.
Parameters:
a - type of action ("move", "heading")
d - length of action

Action

public Action(java.lang.String s)
Action constructor. value is set to 0.
Parameters:
a - type of action ("move", "heading")