jeops.examples.monkeys
Class Goal

java.lang.Object
  |
  +--jeops.examples.monkeys.Goal

public class Goal
extends java.lang.Object
implements Constants

A goal of the agent in the monkey and bananas world.

Version:
0.01 19 Jul 2000
Author:
Carlos Figueira Filho (csff@cin.ufpe.br)

Field Summary
private  PhysicalObject object
          The object associated with this goal.
private  int status
          The status of this goal.
private  java.awt.Point to
          The destiny of this goal (if it's the case)
private  int type
          The type of this goal (HOLD, AT, ON)
 
Fields inherited from interface jeops.examples.monkeys.Constants
ACTIVE, AT, CEILING, FLOOR, HEAVY, HOLD, LIGHT, ON, SATISFIED
 
Constructor Summary
Goal(int type)
          Class constructor.
 
Method Summary
 PhysicalObject getObject()
          Returns the object associated with this goal.
 java.awt.Point getTo()
          Returns the destiny of this goal (if applicable)
 int getType()
          Returns the type of this goal, which can be one of (HOLD, AT, ON).
 boolean isActive()
          Checks whether this goal is active.
 boolean isSatisfied()
          Checks whether this goal is satisfied.
 void setObject(PhysicalObject newObject)
          Sets the object associated with this goal.
 void setSatisfied()
          Defines that this goal has been accomplished.
 void setTo(java.awt.Point newTo)
          Sets the destiny of this goal (if applicable).
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

object

private PhysicalObject object
The object associated with this goal.

status

private int status
The status of this goal. (ACTIVE, SATISFIED)

type

private int type
The type of this goal (HOLD, AT, ON)

to

private java.awt.Point to
The destiny of this goal (if it's the case)
Constructor Detail

Goal

public Goal(int type)
Class constructor.
Parameters:
type - the type of this goal.
Method Detail

getObject

public PhysicalObject getObject()
Returns the object associated with this goal.
Returns:
the object associated with this goal.

getTo

public java.awt.Point getTo()
Returns the destiny of this goal (if applicable)
Returns:
the destiny of this goal (if applicable)

getType

public int getType()
Returns the type of this goal, which can be one of (HOLD, AT, ON).
Returns:
the type of this goal.

isActive

public boolean isActive()
Checks whether this goal is active.
Returns:
true if this goal is active; false otherwise.

isSatisfied

public boolean isSatisfied()
Checks whether this goal is satisfied.
Returns:
true if this goal is satisfied; false otherwise.

setObject

public void setObject(PhysicalObject newObject)
Sets the object associated with this goal.
Parameters:
newObject - the object associated with this goal.

setSatisfied

public void setSatisfied()
Defines that this goal has been accomplished.

setTo

public void setTo(java.awt.Point newTo)
Sets the destiny of this goal (if applicable).
Parameters:
newTo - the new destiny of this goal.

toString

public java.lang.String toString()
Returns a string representation of this object. Useful for debugging.
Overrides:
toString in class java.lang.Object
Returns:
a string representation of this object.