pacworld
Class VisiblePackage

java.lang.Object
  extended by pacworld.VisiblePackage

public class VisiblePackage
extends java.lang.Object

The representation of a package in an agent's percept. This includes the package's id, current location, delivery location, and whether or not it is held by an agent.


Constructor Summary
VisiblePackage(Package pack)
          Create a new percept of a package using the package itself.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Tests if this object is equivalent to another object by comparing the id's of the packages.
 int getDestX()
          Get the X coordinate of the location to deliver the package.
 int getDestY()
          Get the Y coordinate of the location to deliver the package.
 int getId()
          Get the unique integer id for the package.
 int getX()
          Get the X location of the package.
 int getY()
          Get the Y location of the package.
 boolean isHeld()
          Is the package currently held by some agent?
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VisiblePackage

public VisiblePackage(Package pack)
Create a new percept of a package using the package itself.

Method Detail

equals

public boolean equals(java.lang.Object obj)
Tests if this object is equivalent to another object by comparing the id's of the packages.

Overrides:
equals in class java.lang.Object

getDestX

public int getDestX()
Get the X coordinate of the location to deliver the package.


getDestY

public int getDestY()
Get the Y coordinate of the location to deliver the package.


getId

public int getId()
Get the unique integer id for the package.


getX

public int getX()
Get the X location of the package.


getY

public int getY()
Get the Y location of the package.


isHeld

public boolean isHeld()
Is the package currently held by some agent?


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object