galatea.glorias
Class Ag

java.lang.Object
  extended bygalatea.hla.Agent
      extended bygalatea.glorias.Ag

public class Ag
extends Agent

This class is a general agent scheme with a minimal inference engine.
Ag is the main class in the package and the principal class in the agent architectura described in [Uzcategui, 2002] and [Davila, 1997]. The current implementation includes a very light version of the inference engine for the agent, which only allow for condition-action rules with a simple heading.
Particular agent realization must subclass this class, adding the attributes that may required for specific purposes. Among those, observational services and, more importantly, the particular general goals for the agent must be included (as attributes of the subclass of Ag).
This class also allows for two way to deal with sensing behaviour. The constructors make up for the difference in implementing one behaviour or the other.
Note that this class is a subclass of Agent in the galatea.hla package. This separate package provides the wrapper for agents as to allow for different implementation of agents in Galatea. Gloria is just one of them.
-----
Esta clase es un esquema general de agente que contiene un pequeño motor de inferencia.
La clase Ag, almacena las observaciones, las influencias y las metas del agente. En el caso de las observaciones y de las metas, las mismas deben detallarse en cada uno de los agentes, los cuales debe implementarse como instancias de sub-clases de Ag.
Esta clase tiene dos posibilidades: agentes que implementan sensores y los agentes que no implementan sensores. La diferencia entre ambos se muestra en los mètodos constructores implementados en esta clase.
Noten, por favor, que este clase es una subclase de la clase Agent en el paquete galatea.hla. Este otro paquete contiene, entre otras cosas, el "envoltorio" para los agentes, con algunos atributos generales (como las listas de entradas y salidas). El objetivo de esta separación de atributos generales de agentes (en galatea.hla.Agent) de los especificios de Gloria es proveernos de una interfaz genérica para admitir otro tipo de agentes en Galatea.

Version:
Juguete toytwo_1.
Author:
Jacinto Dávila y Niandry Moreno.

Field Summary
 
Fields inherited from class galatea.hla.Agent
agentId, agentType, clock, inputs, outputs, population
 
Constructor Summary
Ag(int n, int m)
          Constructor for agents that implements sensors.
Ag(int n, java.lang.String tipo)
          Constructor for agents that does not implement sensors.
 
Method Summary
 void activateSensor(int i)
          This method activates the sensor of a determined position of the sensor`s array (which contains the total set of the agent's sensors).
 void addObservation(java.lang.String obs)
          This method adds an observation to the agent's observation list.
 void addObservationSensor(int n, java.lang.String[] obs)
          This method is used for agents that implements sensors.
 void addPermanentGoal(java.lang.String name, int n, java.lang.String[] obs)
          This method permits to specify the structure of each agent's goal: agent's goals name and the required observations list to activate each goal.
 void cycle()
          The main cycle/locus of control of the agent.
 void rcycle()
          The main cycle/locus of control of the agent.
 void run()
          The agent's starting point when used as a thread.
 
Methods inherited from class galatea.hla.Agent
getAgentId, input, isReasoningSuspended, resumeReasoning, stopReasoning
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ag

public Ag(int n,
          java.lang.String tipo)
Constructor for agents that does not implement sensors. It is required the quantity of goals that the agent may perform.
-----
Este método es el constructor para aquellos agentes que no implementan sensores. Como parámetro debe suministrarse la cantidad de metas permanentes del agente.

Parameters:
n - int. Number of goals that the agent may perform.
-----
n - int. Indica el número de metas permanentes del agente.

Ag

public Ag(int n,
          int m)
Constructor for agents that implements sensors. The quantity of goals and the quantity of sensors are required.
-----
Este método es el constructor para aquellos agentes que implementan sensores. Se debe suministrar la cantidad de metas permanentes y la cantidad de sensores a implementar.

Parameters:
n - int. Number of goals that the agent may perform.
-----
n - int. Número de metas permanentes del agente.

m - int. It indicates the quantity of agent's sensors.
-----
m - int. Indica la cantidad de sensores a implementar en el agente.
Method Detail

activateSensor

public void activateSensor(int i)
This method activates the sensor of a determined position of the sensor`s array (which contains the total set of the agent's sensors).
-----
Este procedmiento activa el sensor que corresponde a una determinada posicion del arreglo (arreglo que contiene la totalidad de sensores del agente).

Parameters:
i - int. It is the position of the sensor at the sensor array.
-----
i - int. Indica la posición del sensor a activar en el arreglo que contiene todos los sensores del agente.

addPermanentGoal

public void addPermanentGoal(java.lang.String name,
                             int n,
                             java.lang.String[] obs)
This method permits to specify the structure of each agent's goal: agent's goals name and the required observations list to activate each goal.
-----
Este método permite especificar la estructura de cada una de las metas del agente: nombre de la meta del agente, lista de las observaciones requeridas para activar cada una de las metas.

Parameters:
name - String. It indicates the name of the goal to be executed.
-----
name - String. Indica el nombre de la meta que será ejecutada.

n - int. It is the position of the goal at the set of agent's goals.
-----
n - int. Indica la posición de la meta en el conjunto total de metas del agente.

obs - String[]. List of the required observations to execute the permanent goal.
-----
obs - String[]. Lista de las observaciones requeridas para ejecutar la meta permanente.

addObservation

public void addObservation(java.lang.String obs)
This method adds an observation to the agent's observation list.
-----
Este método agrega una observación a la lista de observaciones del agente.

Parameters:
obs - String. Observation that must be added to the list of observations.
-----
obs - String. Observación que debe agregarse a la lista de observaciones del agente.

addObservationSensor

public void addObservationSensor(int n,
                                 java.lang.String[] obs)
This method is used for agents that implements sensors. It assigns to a determined sensor its respectve observations required to activate such sensor.
-----
Este método se usa en aquellos agentes que implementan sensores. El método asigna a un determinado sensor aquellas observaciones que son requeridas para su activación.

Parameters:
n - int. It is the number associated to the sensor.
-----
n - int. Número del sensor.

obs - String[]. It is an array that contains the observations required to activate the determined sensor.
-----
obs - String[]. Arreglo que contiene las observaciones requeridas para activar el sensor n.

rcycle

public void rcycle()
The main cycle/locus of control of the agent. It includes some agent actions like observing, reasoning and executing.
-----
Este método es el ciclo de control principal del agente. Incluye algunas acciones como observar, razonar y ejecutar.


cycle

public void cycle()
The main cycle/locus of control of the agent. It includes some agent actions like observing, reasoning and executing.
-----
Este método es el ciclo de control principal del agente. Incluye algunas acciones como observar, razonar y ejecutar.


run

public void run()
The agent's starting point when used as a thread.

Overrides:
run in class Agent