
Attention: This concept is not yet fully implemented.
It is also considered to provide scriptable agents that can
load scripts that define their actual behaviour. Various scripting
languages are possible, like Ruby or SPL. It is still considered
which is best suitable. A possibility would also be to provide
more than one scripting language, like GBE::GRubyAgent
and GBE::GSplAgent. Thus, more scripting
languages are usable.
Agents are the parts of an element that define their behaviour. The behaviour of elements ultimately defines 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.
The GWE 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.
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 master 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.