public class VacuumEnvironment extends AbstractEnvironment
| Modifier and Type | Class and Description |
|---|---|
static class |
VacuumEnvironment.LocationState |
| Modifier and Type | Field and Description |
|---|---|
static Action |
ACTION_MOVE_LEFT |
static Action |
ACTION_MOVE_RIGHT |
static Action |
ACTION_SUCK |
protected VacuumEnvironmentState |
envState |
protected boolean |
isDone |
static java.lang.String |
LOCATION_A |
static java.lang.String |
LOCATION_B |
agents, envObjects, performanceMeasures, views| Constructor and Description |
|---|
VacuumEnvironment()
Constructs a vacuum environment with two locations, in which dirt is
placed at random.
|
VacuumEnvironment(VacuumEnvironment.LocationState locAState,
VacuumEnvironment.LocationState locBState)
Constructs a vacuum environment with two locations, in which dirt is
placed as specified.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAgent(Agent a)
Add an agent to the Environment.
|
void |
addAgent(Agent a,
java.lang.String location) |
void |
executeAction(Agent a,
Action agentAction) |
java.lang.String |
getAgentLocation(Agent a) |
EnvironmentState |
getCurrentState() |
java.util.List<java.lang.String> |
getLocations() |
VacuumEnvironment.LocationState |
getLocationState(java.lang.String location) |
Percept |
getPerceptSeenBy(Agent anAgent) |
boolean |
isDone()
Returns
true if the Environment is finished with its current
task(s). |
addEnvironmentObject, addEnvironmentView, createExogenousChange, getAgents, getEnvironmentObjects, getPerformanceMeasure, notifyEnvironmentViews, notifyEnvironmentViews, notifyViews, removeAgent, removeEnvironmentObject, removeEnvironmentView, step, step, stepUntilDone, updatePerformanceMeasurepublic static final Action ACTION_MOVE_LEFT
public static final Action ACTION_MOVE_RIGHT
public static final Action ACTION_SUCK
public static final java.lang.String LOCATION_A
public static final java.lang.String LOCATION_B
protected VacuumEnvironmentState envState
protected boolean isDone
public VacuumEnvironment()
public VacuumEnvironment(VacuumEnvironment.LocationState locAState, VacuumEnvironment.LocationState locBState)
locAState - the initial state of location A, which is either
Clean or Dirty.locBState - the initial state of location B, which is either
Clean or Dirty.public EnvironmentState getCurrentState()
public java.util.List<java.lang.String> getLocations()
public void executeAction(Agent a, Action agentAction)
executeAction in class AbstractEnvironmentpublic Percept getPerceptSeenBy(Agent anAgent)
getPerceptSeenBy in class AbstractEnvironmentpublic boolean isDone()
Environmenttrue if the Environment is finished with its current
task(s).isDone in interface EnvironmentisDone in class AbstractEnvironmenttrue if the Environment is finished with its current
task(s).public void addAgent(Agent a)
EnvironmentaddAgent in interface EnvironmentaddAgent in class AbstractEnvironmenta - the agent to be added.public void addAgent(Agent a, java.lang.String location)
public VacuumEnvironment.LocationState getLocationState(java.lang.String location)
public java.lang.String getAgentLocation(Agent a)