public abstract class Environment
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.ArrayList<Agent> |
agents
The set of agents in the environment.
|
protected State |
state
The current state of the environment.
|
Constructor and Description |
---|
Environment()
Construct a new environment.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
addAgent(Agent agent)
Add a new agent to the environment.
|
protected abstract Percept |
getPercept(Agent a)
Create a percept for an agent.
|
abstract int |
getPerformanceMeasure(Agent a)
Return the performance measure of a particular agent in the current
environment.
|
abstract int |
getTeamPerformanceMeasure()
Return the performance measure of a team of agents in a
cooperative environment.
|
protected abstract boolean |
isComplete()
Is the simulation over? Returns true if it is, otherwise false.
|
void |
start(State initState)
Run the simulation starting from a given state.
|
protected void |
updateState(Agent a,
Action action)
Execute an agent's action and update the environment's state.
|
protected java.util.ArrayList<Agent> agents
protected State state
public Environment()
public abstract void addAgent(Agent agent)
public void start(State initState)
protected abstract boolean isComplete()
protected abstract Percept getPercept(Agent a)
DESIGN NOTE: The see() function is not implemented in the agent because the agent shouldn't have direct access to the environment. Otherwise, the agent could "cheat" in inaccessible environments and "see" things that wasn't part of its percept.
protected void updateState(Agent a, Action action)
public abstract int getTeamPerformanceMeasure()
public abstract int getPerformanceMeasure(Agent a)