demo.helicopter
Class RuleDefense1

java.lang.Object
  extended bydemo.helicopter.RuleDefense1
All Implemented Interfaces:
Rule

public class RuleDefense1
extends java.lang.Object
implements Rule

RuleDefense1 implements the Rule interface in the RELATE architecture. This rule keep the agent within 250 meters from its own flag, traveling at top speed.

Since:
JDK1.2
Version:
1.0, 17 Aug 00
Author:
Michael R. Dickson, Kimberly A. Roddy

Constructor Summary
RuleDefense1()
          Default constructor
 
Method Summary
 java.lang.Object calculate(SensedEnvironment pPE)
          Returns an Integer to be put in the protocol vector indicating which piece of code the agent uses in the ActionInterpreter.
 java.lang.String toString()
          returns the name of the rule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RuleDefense1

public RuleDefense1()
Default constructor

Method Detail

calculate

public java.lang.Object calculate(SensedEnvironment pPE)
Returns an Integer to be put in the protocol vector indicating which piece of code the agent uses in the ActionInterpreter.

Specified by:
calculate in interface Rule
Parameters:
pPE - The PerceivedEnvironment .
Returns:
An integer corresponding to the action selected by this calculation.

toString

public java.lang.String toString()
returns the name of the rule.

Specified by:
toString in interface Rule
Returns:
the String representation of the rule name.