|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectgalatea.hla.GInterface
Class GInterface definition. Clase Interface entre el GLIDER y los Agentes
This class implements an extension for the DEVS simulation process of
Galatea, which, by de way, is the same as in GLIDER. This extension,
specified in UML diagrams in [Uzcategui, 2002], provides for agent management
in simulations. Agents are feeded by the simulator and their outputs, a list
of actions to be executed, are collected as part of the code in the "process"
method of this class. As we explain elswhere [Davila, Uzcategui:2002], this
executing intentions are called INFLUENCES and this class is, basically, an
influence manager.
The name of the class suggests that it serves as the interface between the
simulator and the agentes. As a matter of fact, the interface agent-simulator
is specific to each simulation model (to each system being simulated). What
this GInterface class does is to load the file with the actual interface
(that is, a Java file with a list of methods that describe the interface for
a particular model) and, thereafter, deal with the managing of the method
there contained (an example in the file Interface.java).
The new stage of the simulation process consists, therefore, of 1) the
loading of the interface class, 2) at the time of an event, the collection of
the influences from all the agents (gatherInfluences) and 3) the actual
execution of the methods associated to those influences (collected with
findMethods).
It is worth noticing that all this managing of interface class, influences
and their methods is only possible thanks to the reflection capabilities
provided by Java.
-------
La clase GInterface implementa una extensión al proceso de simulación de
eventos discreto de Galatea (que es idéntico, hasta este punto, al de
GLIDER). La extensión está especificada, con diagramas UML, en [Uzcátegui,
2002] y tiene como objetivo incorporar a los agentes al proceso de
simulación, alimentándoles con información (sus entradas) y, mas importante,
recogiendo todas las acciones que los agentes postulan para ser ejecutadas en
el ambiente del sistema controlado por el simulador Galatea. Siguiendo la
teoria de simulación que especifica a Galatea, esas intenciones de ejecución
(acciones por ejecutar, no ejecutadas) son llamadas INFLUENCIAS.
El nombre de la clase se refiere a que sirve como interfaz entre el simulador
y los agentes. Estríctamente, sin embargo, la interfaz entre el simulador y
los agentes es una clase específica de cada modelo de simulación Galatea,
pues contiene el listado de métodos y atributos específicos del modelo.
GInterface simplemente gestiona la "carga" dinámica de esta clase, en tiempo
de ejecución, y luego provee los servicios para que agentes y simulador
interactúen sobre los métodos de esa interfaz específica (un ejemplo de tal
interfaz se almacena, para efectos de referencia en el archivo
Interface.java).
Esquemáticamente, el "proceso" de simulación con los agentes puede ser
descrito así: 1) el simulador carga la clase con los métodos que el modelista
usa para describir como el agente observa y cómo ejecuta acciones. 2) durante
el proceso de simulación, el simulador, luego de ejecutar un evento de
simulación como en DEVS, revisa el estado de los agentes y recoge las
influencias que ellos postulan (gatherInfluences) para luego, usando los
métodos Java asociados a esas influences (ubicados con findMethod), ejecutar
esos códigos sobre el estado actual del simulador.
Es importante notar que los servicios de carga dinámica de clases y de
gestión d métodos de la nueva clase son posibles a través de las previsiones
para REFLEXION del lenguaje Java (provistas por la clase java.lang.Class).
| Field Summary | |
static LAgents |
agentList
This variable represents the Agents' list. |
static LInfluences |
influencesList
This variable represents the list of the agents' influences. |
static java.lang.Class |
interf
This variable represents the interface to simulate the agents. |
static java.lang.Object |
interfObject
This is the interface to simulate the agents but as an Object variable. |
| Constructor Summary | |
GInterface()
|
|
| Method Summary | |
static java.lang.reflect.Method |
findMethod(java.lang.String methodId)
This method finds a method from the list of methods in the Interface. |
static void |
gatherInfluences_test()
This method gather all the influences generated by all the agents at a determined time. |
static void |
init(java.lang.Object interfaz)
This method returns the reference to the user's interface. |
static void |
process_test()
This method executes each influence at the influence list, while invoking the related methods to each influence. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static LInfluences influencesList
public static LAgents agentList
public static java.lang.Class interf
public static java.lang.Object interfObject
| Constructor Detail |
public GInterface()
| Method Detail |
public static void init(java.lang.Object interfaz)
interfaz - Object. public static void process_test()
public static void gatherInfluences_test()
public static java.lang.reflect.Method findMethod(java.lang.String methodId)
methodId - String.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||