|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object aima.basic.BasicEnvironmentView aima.gui.framework.AgentAppModel aima.gui.applications.search.map.MapAgentModel
public class MapAgentModel
Provides a ready-to-use implementation of a model for route planning agent
applications. It is based on a scenario description and a list of
destinations. Some features are not used. Subclasses can support those
features by overriding the methods hasInfos(String)
, and
hasObjects(String)
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class aima.gui.framework.AgentAppModel |
---|
AgentAppModel.ModelChangedListener |
Field Summary | |
---|---|
protected java.util.List<java.lang.String> |
destinations
A list of location names, possibly null. |
protected Scenario |
scenario
A scenario. |
Fields inherited from class aima.gui.framework.AgentAppModel |
---|
listeners |
Constructor Summary | |
---|---|
MapAgentModel()
|
Method Summary | |
---|---|
void |
clearTourHistory()
Clears the list of already visited locations. |
void |
envChanged(java.lang.String command)
Reacts on environment changes and updates the tour history. |
Agent |
getAgent()
Returns the agent. |
Map |
getAgentMap()
Returns the map used by the agent. |
Map |
getEnvMap()
Returns the map used by the environment. |
java.util.List<java.lang.String> |
getLocations()
Returns all location names mentioned in the environment map or in the agent map. |
Point2D |
getLocCoords(java.lang.String loc)
Returns the coordinates of the specified location. |
java.util.List<java.lang.String> |
getTourHistory()
Returns a list of all already visited agent locations. |
boolean |
hasInfos(java.lang.String loc)
Checks whether special informations can be perceived at the location. |
boolean |
hasObjects(java.lang.String loc)
Checks whether interesting objects can be perceived at the location. |
boolean |
isDestination(java.lang.String loc)
Checks whether a given location is one of the specified destinations. |
boolean |
isEmpty()
Checks whether there is a scenario available. |
boolean |
isStart(java.lang.String loc)
Checks whether a given location is the initial location of the agent. |
void |
prepare(Scenario s,
java.util.List<java.lang.String> d)
Assigns values to the attributes scenario and
destinations , clears the history and informs all interested
listeners about the model change. |
Methods inherited from class aima.gui.framework.AgentAppModel |
---|
addModelChangedListener, fireModelChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Scenario scenario
protected java.util.List<java.lang.String> destinations
Constructor Detail |
---|
public MapAgentModel()
Method Detail |
---|
public java.util.List<java.lang.String> getTourHistory()
public void clearTourHistory()
public void envChanged(java.lang.String command)
Agent.NO_OP
, the
agent's current location is added to the tour history and all listeners
are informed about the change.
envChanged
in class AgentAppModel
public void prepare(Scenario s, java.util.List<java.lang.String> d)
scenario
and
destinations
, clears the history and informs all interested
listeners about the model change.
s
- A scenario or null.d
- List of location names or null.public boolean isEmpty()
public java.util.List<java.lang.String> getLocations()
public Map getAgentMap()
public Map getEnvMap()
public Agent getAgent()
public boolean isStart(java.lang.String loc)
public boolean isDestination(java.lang.String loc)
public Point2D getLocCoords(java.lang.String loc)
public boolean hasInfos(java.lang.String loc)
public boolean hasObjects(java.lang.String loc)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |