Agent plugin architecture
Overview
Agents are the parts of an element that define their behaviour.
The behaviour of elements ultimately define the physiology or the
behaviour of the overall simulation created with the G System.
This makes agents a very important part of the G System. In particular
agents are exactly what is used to customize the simulation to the
needs of the particular usage. This also means that agents need to
be created by people not directly developing the G System itself. To
allow everyone to develop custom agents, a plugin architecture is used.
Agents can thus be developed independently of the G System framework
distribution. The plugin architecture takes care of dynamically loading
agents into the simulation. It is even possible to update agents
during runtime by unloading and reloading a particular plugin.
Plugin management in the GWE
The G World Engine actually takes care of loading and creating
GCS::GAgent objects from libraries.
The responsible class is the GWE::GAgentPluginManager
which implements dynamic library loading and plugin instantiation.
Any kind of agents can be loaded this way.
The GWE::GAgentPluginManager class is also used
by the GWE::GCoreXmlSerializer class to actually
create agents specified by the XML document.
Distributing the plugin libraries
Since the G System is a distributed simulation, it is necessary
to somehow inject a plugin into a running simulation.
This works by installing the plugin into the topmost GWE Server,
this server automatically further distributes the library file
to all direct child GWE Servers which in turn do the same. This
way a new plugin gets automatically known to the complete
server infrastructure.
Developing an agent plugin
TO BE WRITTEN