Project Overview - aantakli/AJAN-service GitHub Wiki
In the following, all sub-projects of the AJAN-service are listed. The most important ones are: Executionservice, where the actual service was implemented and the agent is managed; Common, where the configuration for the triplestores was implemented and which contains several utility classes and the general AJAN vocabulary; and Behaviour, where all AJAN native SPARQL-BT nodes, events and queries were implemented.
Project Structure:
- AJAN Parent Project
- Build-Resources
- RDFBeans
- Behaviour
- Common
- Triplestore
- Executionservice
- PluginSystem
- Loader
- Plugins
- StandardBTNodes
- MOSIMPlugin
- ASPPlugin
- MappingPlugin
- StripsPlugin
Via the PluginSystem project new SPARQL-BT nodes (e.g. domain-specific like MOSIMPlugin) can be defined or implemented. Furthermore, such plugins can be used to extend AJAN with new interfaces. How to create plugins is explained in the subchapter Plugins. One of the most important plugins is the standard BTNodes plugin, which implements the standard behavior tree nodes like Sequence, Parallel, Repeat, etc. according to the BT logic defined by gdx-ai.
This section assumes that the user has some knowledge about Java and Maven. For the sake of example the following variables have been considered:
$ajan = de.dfki.asr.ajan$name = DummyPlugin$pkgName = $ajan.pluginsystem.dummyplugin$className = $ajan.pluginsystem.dummyplugin.DummyPlugin$actionFile = $ajan.pluginsystem.dummyplugin.extensions.DummyAction$mosimPkg = $ajan.pluginsystem.mosimplugin
How to create a new Plugin and a Plugin Action:
The easiest way to create a new plugin is to clone an existed plugin from the location ajan-service\pluginsystem\plugins in the same directory. The following things have to be changed before the newly created plugin could function properly.
-
Rename the folder of the cloned plugin to
$name. -
In
ajan-service\pluginsystem\plugins\pom.xmladd<module>$name</module>in the<modules>tag. -
Change the
<artifactId>and<name>inajan-service\pluginsystem\plugins\$name\pom.xmlto$name. -
Rename the directories such that it is consistent with the
$pkgName. Make sure that package names in the classes are compatible with the$pkgNameas well. -
Rename the class
$classNameand change the content related to debugging. -
In file
ajan-service\pluginsystem\plugins\$name\plugin.properties, make the following changes:- Change
plugin.classto$className - Change
plugin.idto$name - Change
plugin.providerandplugin.versionaccordingly.
- Change
-
In file
ajan-service\pluginsystem\plugins\$name\src\main\resources\META-INF\MANIFEST.MF, make the changes consistent tostep 6. -
Important: In case you're using new namespaces, make sure they're listed in
package-info.javafile (in the package$pkgName.extensions). -
Important: Change the content of
$actionFileaccording to the requirements. Make sure that the name of annotation@RDFBeanand theResourcein the methodgetType()are consistent withIRIused in thettlfiles.
How to define a BTNode:
In order to create a new BTNode:
- Create a class in the package
$pkgName.extensions. - The newly created class must extend
$ajan.behaviour.nodes.common.AbstractTDBLeafTask.javaand implements$ajan.pluginsystem.extensionpoints.NodeExtension.java.
How to define a Thrift Endpoint:
Similar to MOSIMPlugin:
- The
thriftcompiled files must be placed in the package$pkgName.endpoint. - Create an interface similar to
$mosimPkg.endpoint.ThriftAction.javain the package$pkgName.endpoint. - Define a new thrift endpoint class in the package
$pkgName.extensionswhich should implement the newly created interface.
For more details please have a look into the implementation of $mosimPkg.extensions.AbstractInstruction.java