galatea.hla
Class Agent

java.lang.Object
  extended bygalatea.hla.Agent
Direct Known Subclasses:
Ag, Ags

public class Agent
extends java.lang.Object

This is the wrapper class for agents in Galatea. It provides for a minimal set of agent's services for the simulator. A unique identifier is attached to each agent instance (agentId). Similarly, an attributes allows for the identification of agent types (agentType).
Nevertheless, the most important attributes in the class are 1) the input list, where the simulator will put input data for the agent (normally of type String) and 2) the outputs list (of type LInfluences, as defined in this package) from where the simulator will draw the agent's executing intentions (i.e. its influences).
A clock attribute is provided for those implementations that may required a clock within the agent.
-----
La clase Agent es un "envoltorio" para las implementaciones de agentes en Galatea. La clase provee algunos servicios básicos que, para efectos del simulador, deben prestar todas las implementaciones de agentes. En particular, un identificador único, agentId, será mantenido automáticamente para cada instancia de esta clase. Asimismo, las implementaciones debería proveer mecanismos para asignar un tipo a los agentes (agentType).
No obstante, los atributos más importantes de esta clase envoltorio son 1) la lista de entrada (inputs List), en la cual el simulador colocará las entradas (del tipo que sean, normalmente Strings) al agente y 2) la lista de salida (outputs de tipo LInfluence, clase de este paquete) de donde el simulador recogerá la especificación de las acciones que el agente solicita se ejecuten de inmediato (es decir, sus influencias).
Noten que se incluye un atributo para el reloj, clock, que podría ser empleado cuando las implementaciones mantengan un reloj dentro del agente.
Nuestro planes de desarrollo contemplan que esta clase se convierta en el elemento principal del COMPONENTE AGENTE.

Version:
1
Author:
M. Uzcátegui, J. Dávila

Field Summary
 int agentId
          This variable represents a unique identifier that is attached to each agent instance.
 java.lang.String agentType
          This variable identifies the agent's type..
 double clock
          This variable is provided for those implementations that may required a clock within the agent..
 java.util.ArrayList inputs
          This variable is where the simulator will put input data for the agent (normally of type String).
 LOutputs outputs
          This variable is the outputs list (of type LInfluences, as defined in this package) from where the simulator will draw the agent's executing intentions.
static int population
          This variable indicates how many instances of the Agent class are in the system.
 
Constructor Summary
Agent()
          This constructor creates a new agent's instance.
Agent(java.lang.String n)
          This constructor creates an instance of the agent of n given type.
 
Method Summary
 int getAgentId()
          This method returns the value of the agent's id value.
 void input(java.lang.String o)
           
 boolean isReasoningSuspended()
           
 void resumeReasoning()
           
 void run()
           
 void stopReasoning()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

agentId

public int agentId
This variable represents a unique identifier that is attached to each agent instance.
-----
Esta variable es un identificador único que será mantenido automáticamente para cada instancia de esta clase.


population

public static int population
This variable indicates how many instances of the Agent class are in the system.
-----
Esta variable indica cuantas intancias de la clase Agent hay en el sistema.


agentType

public java.lang.String agentType
This variable identifies the agent's type..
-----
Esta variable identifica el tipo de agente.


clock

public double clock
This variable is provided for those implementations that may required a clock within the agent..
-----
Esta variable puede emplearse cuando las implementaciones mantengan un reloj dentro del agente.


inputs

public java.util.ArrayList inputs
This variable is where the simulator will put input data for the agent (normally of type String).
-----
Esta variable es la lista de entrada, en la cual el simulador colocará las entradas (del tipo que sean, normalmente Strings) al agente.


outputs

public LOutputs outputs
This variable is the outputs list (of type LInfluences, as defined in this package) from where the simulator will draw the agent's executing intentions.
-----
Esta variale es la lista de salida (outputs de tipo LInfluence, clase de este paquete) de donde el simulador recogerá la especificación de las acciones que el agente solicita se ejecuten de inmediato.

Constructor Detail

Agent

public Agent()
This constructor creates a new agent's instance. The identificator of the agent's id is incremented, and by default agent's type is set ou to null.
-----
Este constructor crea una nueva instancia del tipo de agente. Se incrementa automaticamente el identificador del agente, mientras que por defecto, el tipo de agente se coloca como nulo.


Agent

public Agent(java.lang.String n)
This constructor creates an instance of the agent of n given type.
-----
Este constructor crea una instancia del agente del tipo dado n .

Parameters:
n - String. It indicates agent's type.
-----
n – String. Indica el tipo del agente.
Method Detail

getAgentId

public int getAgentId()
This method returns the value of the agent's id value.
-----
Este método devuelve el valor de la identificacion del agente.

Returns:
agentId int. It returns the unique identifier that is attached to each agent instance.
-----
agentId int. Devuelve el valor del identificador único del agente.

run

public void run()

input

public void input(java.lang.String o)
Parameters:
o -

stopReasoning

public void stopReasoning()

isReasoningSuspended

public boolean isReasoningSuspended()
Returns:
boolean

resumeReasoning

public void resumeReasoning()