|
||||||||||
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 static PackageState getInitState(long seed, java.util.List<Agent> agts, int numPackages, int numDests, int mapSize)
public static PackageState getInitState(java.util.List<Agent> agts, int numPackages, int numDests, int mapSize)
public void printState()
public int getAgentX(Agent a)
public int getAgentY(Agent a)
public Package getPackageHeldByAgent(Agent a)
public void pickup(Agent a, Package p)
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 boolean hasObstacle(int x, int y)
public java.lang.Object getObjectAt(int x, int y)
public boolean bumped(Agent a)
public boolean inBounds(int x, int y)
public void dropPackage(Agent a, int dropX, int dropY)
public int getNumPackages()
public int getOrigNumPackages()
public int getMapSize()
public int getIdleCount()
public void setIdleCount(int ic)
public java.util.List<Package> getPackages()
public java.util.Collection<PacAgentRep> getAgentReps()
public java.lang.String[] getMessages()
public Location[] getDestinations()
public int getWorkCount()
public int getPacCount()
public int getMessageCount()
public long getTotalMessageLength()
public int getNonProductiveCount()
public void setMessage(Agent a, java.lang.String s)
public void display()
display
in class State
public void setGUI(PacGUI pg)
public java.lang.Object[][] getMap()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |