demo.helicopter
Class RuleEngageEnemy

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

public class RuleEngageEnemy
extends java.lang.Object
implements Rule

RuleEngageEnemy implements the Rule interface in the RELATE architecture. This rule has the agent shoot at all sensed bad guys. It trains the turret and elevates the barrel untill they are pointed at the enemy, then shoots.

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

Constructor Summary
RuleEngageEnemy()
          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

RuleEngageEnemy

public RuleEngageEnemy()
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.