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

Class AgentStaticPatrolStrategy

source code


Implements a basic patrol strategy. Given points of interest, just travel along the cycle they define

Instance Methods [hide private]
 
__init__(self, agentIndex, myPatrolPath, rulesOfTheSea)
Initializes the strategy.
source code
 
composeAction(self, agentWorldModel)
Implements the abstract method, see documentation of the abstract method.
source code
 
setNextPointAndNavigationTacticIfNeeded(self, agentWorldModel) source code
 
setNavigationTactic(self, agentWorldModel, nextGoal) source code
 
getPath(self) source code
 
recordStatistics(self) source code

Inherited from AgentStrategy: getOutgoingMessage, transmit

Method Details [hide private]

__init__(self, agentIndex, myPatrolPath, rulesOfTheSea)
(Constructor)

source code 

Initializes the strategy.

Parameters:
  • agentIndex (int) - sort of an agent-id - an agent's index in the array of all agents
  • path (a list of 2-tuples) - a list of (x,y) points that define a cycle for the agent to travel along
  • rulesOfTheSea (boolean) - Tells whether to respect the rules of the sea
Overrides: AgentStrategy.__init__

composeAction(self, agentWorldModel)

source code 

Implements the abstract method, see documentation of the abstract method.

Overrides: AgentStrategy.composeAction