Main Page | Class Hierarchy | Class List | Class Members | Related Pages

blockworld.Agent Class Reference

Agent representation in Env. This doubles as a plugin instance. More...

List of all members.

Public Member Functions

 Agent (String name)
String getName ()
Point getPosition ()
 Get current agent position.

boolean senseBomb ()
 Sense if agent is carrying a bomb.

boolean isEntered ()
 Check if agent is "entered" in the environment.

void reset ()
 Called by the interpreter when the agent this instance refers to is reset.

String toString ()
 returns the unique name of the agent this instance refers to.

void deleteObservers ()
 removes all listeners


Public Attributes

transient Signal signalMove = new Signal("agent attempts move")
 emitted if agent attemps movement (succesful or not)

transient Signal signalPickupBomb = new Signal("agent attempts pickup")
 emitted if agent attemps to pickup a bomb (succesful or not)

transient Signal signalDropBomb = new Signal("agent attempts drop")
 emitted if agent attemps to drop a bomb (succesful or not)

transient Signal signalMoveSucces = new Signal("agent succesful move")
 emitted if agent succesfully moves

transient Signal signalPickupBombSucces = new Signal("agent succesful pickup")
 emitted if agent (succesfully) picks up a bomb

transient Signal signalDropBombSucces = new Signal("agent sucessful drop")
 emitted if agent (succesfully) drops a bomb


Protected Attributes

String _name

Package Attributes

Point _position = null
 _position is null means agent did not enter the world.

boolean _bomb = false


Detailed Description

Agent representation in Env. This doubles as a plugin instance.


Member Function Documentation

Point blockworld.Agent.getPosition  ) 
 

Get current agent position.

Returns:
This will return null if the agent is not entered in the world.

boolean blockworld.Agent.isEntered  ) 
 

Check if agent is "entered" in the environment.

That is, it has a position in the world.

Returns:
true if agent is entered in the environment

void blockworld.Agent.reset  ) 
 

Called by the interpreter when the agent this instance refers to is reset.

Todo:
signalMove show become special signal enter/exit

boolean blockworld.Agent.senseBomb  ) 
 

Sense if agent is carrying a bomb.

Returns:
True if agent is carrying a bomb, false otherwise.

String blockworld.Agent.toString  ) 
 

returns the unique name of the agent this instance refers to.


Member Data Documentation

Point blockworld.Agent._position = null [package]
 

_position is null means agent did not enter the world.

This method is only for the blockworld package to prevent setting the position by other means that through the north/south/west/east methods of the environment.

Todo:
is protection "package" correct?


The documentation for this class was generated from the following file:
Generated on Wed Jun 16 17:22:45 2004 for blockworld by doxygen 1.3.7