edu.columbia.cs.coms4701.agent.environments.grid
Class GridEnvironmentObserver<K extends AgentAction,P extends AgentPercept,A extends Agent<K,P>,C extends GridCell,J extends GridPanel<C>>
java.lang.Object
edu.columbia.cs.coms4701.agent.observer.GUIEnvironmentObserver<K,P,A,J>
edu.columbia.cs.coms4701.agent.environments.grid.GridEnvironmentObserver<K,P,A,C,J>
- All Implemented Interfaces:
- EnvironmentObserver<K,P,A>, AgentAddedListener<K,P,A>, AgentChoseActionListener<K,P,A>, AgentReceivedPerceptsListener<K,P,A>, EnvironmentBeganRunningListener, EnvironmentObjectAddedListener, EnvironmentStoppedRunningListener, ObserverPlayingStateChangedListener, java.beans.PropertyChangeListener, java.util.EventListener, javax.swing.event.ChangeListener
- Direct Known Subclasses:
- PenteEnvironmentObserver, RoombaEnvironmentObserver
public abstract class GridEnvironmentObserver<K extends AgentAction,P extends AgentPercept,A extends Agent<K,P>,C extends GridCell,J extends GridPanel<C>>
- extends GUIEnvironmentObserver<K,P,A,J>
An EnvironmentObserver implementation for grid environments. Supplies a GridPanel view to give a bird's-eye view of the world.
- Version:
- 0.1
User: aaron Date: Sep 8, 2006 Time: 3:59:21 PM
- Author:
- aaron@cs
Constructor Summary |
GridEnvironmentObserver(java.lang.Class<C> gridCellClass)
Constructs a new GUIEnvironmentObserver, which can then be attached to a (single!) Environment to track progress. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GridEnvironmentObserver
public GridEnvironmentObserver(java.lang.Class<C> gridCellClass)
- Constructs a new GUIEnvironmentObserver, which can then be attached to a (single!) Environment to track progress.
Callers should supply a class of a GridCell subclass, so the GridPanel
can construct new instances of the cell as needed.
generateEnvironmentPanel
public abstract J generateEnvironmentPanel()
- Generates a new instance of the environment panel for this observer.
- Specified by:
generateEnvironmentPanel
in class GUIEnvironmentObserver<K extends AgentAction,P extends AgentPercept,A extends Agent<K,P>,J extends GridPanel<C>>
- Returns:
- a new environment panel, calling constructors as necessary
environmentObjectAdded
public void environmentObjectAdded(EnvironmentObjectAddedEvent theEvent)
- Overridden to support the grid map.
- Specified by:
environmentObjectAdded
in interface EnvironmentObjectAddedListener
- Overrides:
environmentObjectAdded
in class GUIEnvironmentObserver<K extends AgentAction,P extends AgentPercept,A extends Agent<K,P>,J extends GridPanel<C>>
- Parameters:
theEvent
- event specifying the environment and the object.