cz.cuni.amis.pogamut.base.agent.utils.runner
Interface IAgentDescriptor<PARAMS extends IAgentParameters,MODULE extends GuiceAgentModule>

Type Parameters:
PARAMS -
MODULE -
All Known Implementing Classes:
AgentDescriptor, UT2004BotDescriptor

public interface IAgentDescriptor<PARAMS extends IAgentParameters,MODULE extends GuiceAgentModule>

This interface describes everything that is needed to instantiate and start of the agent.

It describes three things:

  1. Guice module that contains a definition (bindings) for the factory, so we know how to instantiate the agent (getAgentModule())
  2. number of the agents that should be instantiated/started (getCount())
  3. respective parameters that should be passed to the agents during construction (getAgentParameters())

Used by implementors of IMultipleAgentRunner. It allows you to start different agents (of different classes) at once.

Note that the getCount() does not need to match the getAgentParameters().length. There are three scenarios (according to the relation between those two numbers) and the number of agents the IMultipleAgentRunner will instantiate:

  1. getCount() > getAgentParameters().length - in this case, the IMultipleAgentRunner will instantiate specified number of agents with default parameters
  2. getCount() == getAgentParameters().length - in this case, the IMultipleAgentRunner will instantiate the same number of agents as there are parameters
  3. getCount() < getAgentParameters().length - the IMultipleAgentRunner will instantiate 'count' of agents and first 'number of parameters' will have custom params as specified, rest will have defaults


Method Summary
 MODULE getAgentModule()
          Agent module that contains bindings for the classes, used by GuiceAgentFactory (or concretely by the Guice) to instantiate the agent.
 PARAMS[] getAgentParameters()
          Respective parameters of the agents.
 int getCount()
          How many instances this object describes, i.e., how many agents should be instantiated using getAgentModule().
 

Method Detail

getAgentModule

MODULE getAgentModule()
Agent module that contains bindings for the classes, used by GuiceAgentFactory (or concretely by the Guice) to instantiate the agent.

Returns:
agent's module

getCount

int getCount()
How many instances this object describes, i.e., how many agents should be instantiated using getAgentModule().

Returns:
number of agents to instantiate

getAgentParameters

PARAMS[] getAgentParameters()
Respective parameters of the agents. The length of the array must be the same as getCount(), i.e., there must be a separate parameter instance for every agent).

Note that some parameters may be null as IMultipleAgentRunner implementation can provide default parameters for agents (usually).

Returns: