This guide is currently outdated and will be updated in an upcoming release.

The <imports> tag is used to specify, which classes and packages can be used by Java expressions throughout an agent or capability definition file. The import section with an ADF resembles very much the Java import section of a class file. A Jadex import statement has the same syntax as in Java allowing single classes as well as whole packages being included.

Figure 1: The Jadex imports XML schema part

The imports are used for searching Java classes as well as non-Java agent artifacts such as agent.xml or capability.xml files. It is not necessary to declare an import statement for the actual package of the ADF as this is automatically considered.

Import Examples

In the following some simple code snippets from an ADF are shown that demonstrate how import statements are declared and subsequently used, e.g., in facts of beliefs, or to include a capability from another package.

    <!-- Import only the HashMap class. -->

    <!-- Import all classes of the awt package. -->

    <!-- Import a movement package containing, e.g., a Move capability. -->

    <!-- Use the imported movement.Move capability. -->
    <capability name="movecap" file="Move"/>

    <!-- Use the imported java.util.HashMap. -->
    <belief name="data">
        <fact>new HashMap()</fact>

    <!-- Use the imported java.awt.Frame. -->
    <belief name="gui">
        <fact>new Frame()</fact>