Module agents :: Class Agent
[hide private]
[frames] | no frames]

Class Agent

source code

This is a class for an agent that controls a ship. An agent has two main components: it's world model, and its decision-making strategy.

Instance Methods [hide private]
 
__init__(self, worldModel, strategy) source code
CompositeAction
getAction(self, percepts)
A template method.
source code
 
receiveMsg(self, msg)
msg is received by the agent using this function
source code
CompositeMessage
getOutgoingMessage(self)
Returns any message that strategy created
source code
Method Details [hide private]

getAction(self, percepts)

source code 

A template method. Choose an action based on current percepts

Parameters:
  • percepts (PerceptList) - A list of percepts sent to the agent for this decision cycle
Returns: CompositeAction
A list of actions to be executed on the ship

receiveMsg(self, msg)

source code 

msg is received by the agent using this function

Parameters:
  • msg (PrimitiveMessage) - a primitive message sent to the agent.

getOutgoingMessage(self)

source code 

Returns any message that strategy created

Returns: CompositeMessage
The agents' outgoing message for this decision cycle