|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object agent.State pacworld.PackageState
public class PackageState
Represents a state in the package world.
Constructor Summary | |
---|---|
PackageState()
Construct a new package state. |
Method Summary | |
---|---|
boolean |
bumped(Agent a)
Return true if the agent bumped into an obstacle on its previous move. |
void |
display()
Print an output of the state to the screen. |
void |
dropPackage(Agent a,
int dropX,
int dropY)
|
java.util.Collection<PacAgentRep> |
getAgentReps()
|
int |
getAgentX(Agent a)
Return the X location of the specified agent. |
int |
getAgentY(Agent a)
Return the Y location of the specified agent. |
Location[] |
getDestinations()
|
int |
getIdleCount()
|
static PackageState |
getInitState(java.util.List<Agent> agts,
int numPackages,
int numDests,
int mapSize)
Return a random initial state for the vacuum world. |
static PackageState |
getInitState(long seed,
java.util.List<Agent> agts,
int numPackages,
int numDests,
int mapSize)
Use the given seed to generate a pseudo-random initial state for the vacuum world. |
java.lang.Object[][] |
getMap()
Returns the map. |
int |
getMapSize()
|
int |
getMessageCount()
|
java.lang.String[] |
getMessages()
|
int |
getNonProductiveCount()
|
int |
getNumPackages()
|
java.lang.Object |
getObjectAt(int x,
int y)
Return the object located at the specified location. |
int |
getOrigNumPackages()
|
int |
getPacCount()
|
Package |
getPackageHeldByAgent(Agent a)
Return the package (if any) held by the specified agent. |
java.util.List<Package> |
getPackages()
|
long |
getTotalMessageLength()
|
int |
getWorkCount()
|
boolean |
hasObstacle(int x,
int y)
Return true if the specified location has an obstacle in it. |
boolean |
inBounds(int x,
int y)
Return true if the location is within bounds of the state's map. |
void |
pickup(Agent a,
Package p)
Modify the state so that the agent is holding the selected package. |
void |
printState()
|
void |
repositionAgent(Agent a,
int newX,
int newY)
Change the agent's position. |
void |
repositionPackage(Package p,
int newX,
int newY)
Change a package's position. |
void |
setBump(Agent a,
boolean bump)
Set an indicator that the robot bumped into an obstacle during its previous move. |
void |
setGUI(PacGUI pg)
|
void |
setIdleCount(int ic)
|
void |
setMessage(Agent a,
java.lang.String s)
Set whatever message was said by the agent in its previous move. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PackageState()
Method Detail |
---|
public boolean bumped(Agent a)
public void display()
display
in class State
public void dropPackage(Agent a, int dropX, int dropY)
public java.util.Collection<PacAgentRep> getAgentReps()
public int getAgentX(Agent a)
public int getAgentY(Agent a)
public Location[] getDestinations()
public int getIdleCount()
public static PackageState getInitState(java.util.List<Agent> agts, int numPackages, int numDests, int mapSize)
public static PackageState getInitState(long seed, java.util.List<Agent> agts, int numPackages, int numDests, int mapSize)
public java.lang.Object[][] getMap()
public int getMapSize()
public int getMessageCount()
public java.lang.String[] getMessages()
public int getNonProductiveCount()
public int getNumPackages()
public java.lang.Object getObjectAt(int x, int y)
public int getOrigNumPackages()
public int getPacCount()
public Package getPackageHeldByAgent(Agent a)
public java.util.List<Package> getPackages()
public long getTotalMessageLength()
public int getWorkCount()
public boolean hasObstacle(int x, int y)
public boolean inBounds(int x, int y)
public void pickup(Agent a, Package p)
public void printState()
public void repositionAgent(Agent a, int newX, int newY)
public void repositionPackage(Package p, int newX, int newY)
public void setBump(Agent a, boolean bump)
public void setGUI(PacGUI pg)
public void setIdleCount(int ic)
public void setMessage(Agent a, java.lang.String s)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |