public class PackageWorld extends Environment
Modifier and Type | Field and Description |
---|---|
static java.io.PrintWriter |
actLog |
static int |
DEFAULT_NUM_AGENTS |
static int |
DEFAULT_NUM_DESTINATIONS
Number of destinations.
|
static int |
DEFAULT_NUM_PACKAGES
Number of packages.
|
static int |
DEFAULT_WORLD_SIZE
The length (and width) of the world.
|
static int |
MAX_NUM_DESTINATIONS |
PacGUI |
pg
The GUI that displays the current world
|
Constructor and Description |
---|
PackageWorld() |
PackageWorld(java.io.PrintWriter actLog) |
Modifier and Type | Method and Description |
---|---|
void |
addAgent(Agent agent)
Add a new agent to the environment.
|
java.util.List<Agent> |
getAgents()
Returns a list of the agents in the environment.
|
int |
getNumAgents()
Return the number of agents in the environment.
|
int |
getPerformanceMeasure(Agent a)
Return the performance measure of the agent in the current
environment.
|
java.lang.String |
getScoreMsg()
Returns a string containing score information for the agent team.
|
int |
getTeamPerformanceMeasure()
Return the performance measure of a team of agents in a
cooperative environment.
|
int |
getWorldSize()
Return the size of the grid for the environment.
|
void |
logMessage(java.lang.String message)
Outputs a message to the log and the GUI.
|
static void |
main(java.lang.String[] args)
Starts the program.
|
void |
resetAgents()
Clears all agents from the environment.
|
void |
setGUI(PacGUI gui)
Associate a GUI with the environment.
|
void |
start(State initState)
Run the simulation starting from a given state.
|
public static int DEFAULT_NUM_AGENTS
public static int DEFAULT_WORLD_SIZE
public static int DEFAULT_NUM_PACKAGES
public static int DEFAULT_NUM_DESTINATIONS
public static int MAX_NUM_DESTINATIONS
public static java.io.PrintWriter actLog
public PacGUI pg
public PackageWorld()
public PackageWorld(java.io.PrintWriter actLog)
public void addAgent(Agent agent)
addAgent
in class Environment
public java.util.List<Agent> getAgents()
public void resetAgents()
public java.lang.String getScoreMsg()
public int getPerformanceMeasure(Agent a)
getPerformanceMeasure
in class Environment
public int getTeamPerformanceMeasure()
getTeamPerformanceMeasure
in class Environment
public int getWorldSize()
public int getNumAgents()
public void setGUI(PacGUI gui)
public void start(State initState)
start
in class Environment
public void logMessage(java.lang.String message)
public static void main(java.lang.String[] args)