JDEManual2 Overview

来源:http://aosgrp.com/

 

2 Overview

JACK™ Intelligent Agents supports two agent reasoning models:

  • a basic agent model
  • a teams agent model.

These models are implemented as extensions of the Java language. These extensions:

  • provide new base classes, interfaces and methods
  • extend Java syntax to support the new classes, definitions and statements
  • provide semantic extensions that change the execution engine to support a BDI execution model.

clip_image002

Figure 2-1: JDE menu bar and work area

The class level constructs provided by the two models are discussed in detail in the Agent Manual and Teams Manual. These constructs are the primary building blocks of every JACK application and can be defined in any text editor. For some, this is the preferred method of program development. However, others prefer to use graphical environments for code development. The JDE provides support for this mode of development through conventional drag-and-drop functionality and context sensitive menus.

The JDE also supports aspects of the software development life cycle other than code generation and execution. In particular, tools are provided to support the design process and the tracing of design and plan execution. These tools are fully integrated with the basic code generation/compilation/execution functionality of the JDE. The Design Tool, the Graphical Plan Editor and the Plan Tracing Tool are each explained separately within their own documents.

When the JDE is invoked, a window is created which initially consists of a menu bar and a work area.

Within the JDE a project consists of a collection of programming elements. Through the JDE menu bar, one can create a new project or open an existing project. When this occurs, a special instance of a JDE browser window is opened. This is known as the project window.

Directly below the JDE menu bar is the JDE Tool Bar. The JDE Tool Bar provides a series of shortcut buttons that can be clicked to bypass the drop-down menus of the menu bar for many of the basic functions of the JDE. The buttons available to the left perform various actions in the JDE, and are referred to as action buttons.

There are also three buttons to the right end of the JDE Tool Bar. These buttons toggle various modes on and off, and are referred to as toggle buttons.

Further details about these buttons and their functions are provided in the JDE Tool Bar chapter of this document.

The project window provides the primary interface for code development including access to the Graphical Plan Editor. It also enables the user to create and access design views for the JACK Agent Model or JACK Teams Model.

The project window is configured differently depending on whether one is developing an agent model or a teams model – the appropriate mode is selected via the View menu from the JDE menu bar. The JDE menu bar also provides access to the Compiler Utility which enables the user to compile and execute agent and teams models.

 

2.1 JDE menu bar

The JDE menu bar contains the following drop-down menus:

  • JACK Developer menu (Macintosh only)
  • File menu
  • Edit menu
  • View menu
  • Entity menu
  • Trace menu
  • Tools menu
  • Window menu
  • Help menu.

These menus provide access to the high level functions of the JDE, such as loading and saving projects, and editing projects in various ways. These menus are outlined briefly below, and are explained in greater detail elsewhere in the Menu Bar chapter of this document.

 

2.1.1 JACK Developer menu (Macintosh only)

The JACK Developer menu exists only in the Macintosh environment. The JACK Developer menu contains the following options:

  • About JACK Developer
  • Preferences
  • Services
  • Hide JACK Developer
  • Hide Others
  • Show All
  • Quit JACK Developer.

 

2.1.2 File menu

The File menu contains the following options:

  • New Project
  • Open Project
  • Save Project
  • Load External Edits
  • Copy/Move Project
  • Convert Old Project
  • Close Project
  • Update JACK Files
  • Generate All JACK Files
  • Remove JACK Files
  • Generate Project Report...
  • Page Setup...
  • Print Project Report...
  • Exit (non-Macintosh platforms only).

These options are discussed in detail in the JDE menu bar chapter of this document.


Note: To the left of the File menu on the Macintosh appears the JACK Developer menu. The Quit function is listed within this menu on the Macintosh rather than in the File menu.


 
2.1.3 Edit menu

The Edit menu contains the following options:

  • Cut Text
  • Copy Text
  • Paste Text.
 
2.1.4 View menu

The View menu contains the following options:

  • Full Package Path
  • Documentation Nodes
  • Teams Mode
  • Show Tool Bar.

These options can all be toggled on or off providing alternatives affecting the various functions of the JDE. Checks indicate which of the options is currently toggled on.

 
2.1.5 Entity menu

The Entity menu contains the following options:

  • Add Design...
  • Add Agent...
  • Add Capability...
  • Add Plan...
  • Add Event...
  • Add Team...
  • Add TeamPlan...
  • Add Role...
  • Add Named Role...
  • Add Named Data...
  • Add Beliefset...
  • Add View...
  • Add TeamData...
  • Add External Class....

Note: Some of the above menu options are only enabled in Teams mode.


 
2.1.6 Trace menu

The Trace menu contains the following options:

  • Connect To Nameserver...
  • Connect To Portal...
  • Configure Design Tracing...
  • Design Tracing Controller
  • Ping Agent....
 
2.1.7 Tools menu

The Tools menu contains the following options:

  • Compiler Utility
  • Design Palette
  • Plan Editor Palette
  • Error Log
  • Preferences... (non-Macintosh platforms only).

Note: On the Macintosh, the Preferences option appears in the JACK Developer menu.


 
2.1.8 Window menu

The Window menu maintains a list of titles of all currently opened (not minimised) JDE browser windows. Initially, the Project window will be listed here. Selecting a title form the list will bring a particular window to the front of the JDE.

 
2.1.9 Help menu

The Help menu contains the following options:

  • JACK Documentation
  • JACK Frequently Asked Questions
  • Agent Oriented Software Homepage
  • Create Project from Example
  • About JACK Intelligent Agents(non-Macintosh platforms only).

Note: On the Macintosh, the About JACK Intelligent Agents option is named About JACK Developer and is located in the JACK Developer menu.


 

2.2 Project window

Within a JDE session only one project can be active at a time. When a project is first opened, a special JDE browser window is opened which is known as the project window.

Additional JDE browser windows can be opened by selecting items from the project window, and dragging them onto the JDE work area. For example, if a subtree of the project window's folder hierarchy is dragged and dropped into the JDE work area, a new JDE browser window is opened for browsing the selected subtree.


Note: Additional JDE browser windows can be opened, but there can only be one project window.


 
2.2.1 Opening the project window

The project window is opened when an existing project is loaded or a new project is created. This is achieved via the File menu on the JDE menu bar. The project window displays the name of the current project in the title bar. It also displays a hierarchical tree structure of folders which contain the project components. The window may be moved around the JDE window and resized according to the needs of the user.

 
2.2.2 Closing the project window

The project can be closed via the File menu on the JDE menu bar. Note that closing the project window also closes the project. If a project has unsaved changes, a prompt will appear asking whether the changes should or should not be saved. A project can be explicitly saved via the File menu at any time during a JDE session.

Saving a project via the File menu causes any entities that have been changed (highlighted in red in the project window) to be saved. The project file is updated to include any references to newly created or loaded files and any new or updated entity files are saved. A project is stored as a file in JACOB syntax with a .prj extension. To learn more about JACOB, refer to the JACOB Manual. When saving a project, a prompt may appear asking the user to create all required folders necessary for that project.

 
2.2.3 Features of the project window

The project window contains project details (such as Project Name and Documentation) and the Design Views folder. It also holds the Agent Model container and the Data Model container, both of which contain folders for storing the various programming elements of the project. Finally, the project window also contains the Other Files folder, enumerating non-JACK files of interest.

These folders allow grouping of entities in a project. For large projects, some folders will contain many entities. In such situations, it is useful to group the entities within a folder into sub-folders. This is achieved through the use of nested containers. Containers can be nested within containers, without limit to the number of nesting levels. Entities of the same type can be moved between nested containers.

The elements in the project window's folder hierarchy can be expanded or contracted by clicking on the '+' symbol or arrow to the left of the element or by double-clicking on the element's folder or name. When an element is expanded, the '+' symbol becomes a '-' symbol, or the right arrow becomes a down-arrow on the Macintosh. Clicking on the '-' symbol or down-arrow (or, equivalently, double-clicking on the element next to the '-' symbol or down-arrow) collapses the expanded tree.

Context-sensitive menus are provided for performing operations on folders and folder elements. The menus are accessed by placing the mouse cursor over an item and pressing the right mouse button. A menu then appears providing operations that can be applied to that item.

Drag-and-drop is used to associate one entity with another (such as a plan with an agent). The element to be dragged is first selected by clicking and holding the left mouse button down while over the icon. The left button is then kept down while the mouse is moved until the cursor is over the destination item. Releasing the left mouse button will then associate the dragged element with the destination element. Multiple drag-and-drop can also be performed as described in the JDE Browser chapter.

Note that if a drop operation is permitted, the Drop Allowed cursor is displayed.

clip_image003

Figure 2-2: Drop Allowed cursor

If the operation is not permitted, the No Drop Allowed cursor is displayed.

clip_image004

Figure 2-3: No Drop Allowed cursor

 
2.2.3.1 Project details

A project as a whole encapsulates all of the resources related to an agent model and any extra (non-JACK) files such as regular Java files and data files required.

The project details are the first item in the project window. It has the following seven attributes:

Attribute

Description

Project Name

The name of the project e.g. NewProject.

Documentation

Documentation associated with the project.

Root Package

The top-level Java package to which all project components belong.

Save-folder

This is where the G-Code is stored. G-Code is the graphical file format used by the JDE. The folder is called gcode_ProjectName by default.

Generated JACK Sub-folder

This is the sub-folder (of the folder where the project file is located) where the generated JACK code will be stored.

Generated Java Sub-folder

This is where the JACK compiler stores the Java files generated while compiling the JACK files.

Generated Class Sub-folder

This is where the java compiler stores the class files generated from the Java files.

Table 2-1: Project attributes

The type definition files created within the JDE are stored as G-Code files in the Save folder. Compiling an application results firstly in JACK files being generated from the G-Code files. The JACK files are written to the Generated JACK Sub-folder. The files in the Generated JACK Sub-folder are then translated to Java code; these files are stored in the Generated Java Sub-folder. Finally, the generated Java code is compiled along with any other Java source files needed. The resulting class files are stored in the Generated Class Sub-folder. Note that the G-Code to JACK code step can be performed independent of the other steps if desired.

Applications that have been developed outside of the JDE can be imported into the JDE. This can be done through the Compiler Utility. Alternately, the G-Code and a project file can be generated by entering the following command in the directory which is the root of the application source tree:

java aos.main.JackBuild -r -x -E myproject.prj -dj backup

myproject can then be opened in the normal way from within the JDE.

The -dj option results in the application files being copied to a directory called backup. If this option is omitted, and the resulting G-Code was compiled with the default setting for the Generated JACK Sub-folder, the original JACK files would be overwritten.

The user can also import components from other projects into the current project. This is discussed in the JDE Browser chapter of this document.

 
2.2.3.2 Design Views folder

It is possible to design and build an application using the Design Tool. The Design Tool can be accessed by right-clicking on the Design Views folder. Existing designs can be accessed from within the Design Views folder. Entities that exist in the JDE browser can be incorporated into a design by dragging them onto the design canvas. Any new entities or links between entities that are created while building a design will result in corresponding changes to the contents of the JDE browser window.

The Design Tool is discussed in greater detail in the Design Tool Manual.

 
2.2.3.3 Agent Model container

The following folders are contained within the Agent Model container:

  • Agent Types folder
    Agents are added to the Agent Types folder in the Agent Model container. They are further elaborated by dragging plans, events, named data and capabilities from the other folders and dropping them onto the appropriate target folders within the Agent Types folder.
  • Capability Types folder
    Capabilities are added to the Capability Types folder of the current project and are further elaborated by dragging plans, events, named data and other capabilities from the folders below and dropping them onto the appropriate target folders within the Capability Types folder.
  • Plan Types folder
    Plans are added to the Plan Types folder in the Agent Model container. They are further elaborated by dragging events and named data from the folders below and dropping them onto the appropriate target folders within the Plan Types folder.
    Plan reasoning methods can be edited using a text editor or the Graphical Plan Editor. The Graphical Plan Editor is discussed in more detail in the Graphical Plan Editor Manual.
    If the plan reasoning methods were created using the Graphical Plan Editor, the Plan Tracing Tool can be used to display and trace the execution of Graphical Plans in JACK applications.
    For further information on the Plan Tracing Tool, refer to the Plan Tracing Tool Technical Brief.
  • Event Types folder
    Events are added to the Event Types folder in the Agent Model container. They are further elaborated by dragging named data from the other folders and dropping them onto the appropriate target folders within the Event Types folder.
  • Named Data folder
    Named Data are added to the Named Data folder in the Agent Model container. The Named Data folder contains named data that can be used by JACK components. The type of the named data is any data model element.
  • Team Types folder
    Teams are added to the Team Types folder in the Agent Model container. They are further elaborated by dragging plans, events, capabilities, team plans and named data from the other folders and dropping them onto the appropriate target folders within the Team Types folder. The Team Types folder is only visible within the JDE browser when the JDE is in Teams Mode (when the Teams Mode option in the View menu is checked).
  • TeamPlan Types folder
    Teamplans are added to the TeamPlan Types folder in the Agent Model container. They are further elaborated by dragging events, roles, named data and named roles from the other folders and dropping them onto the appropriate target folders within the TeamPlan Types folder. The TeamPlan Types folder is only visible within the JDE browser when the JDE is in Teams Mode (when the Teams Mode option in the View menu is checked).
  • Role Types folder
    Roles are added to the Role Types folder in the Agent Model container. They are further elaborated by dragging events and named data from the other folders and dropping them onto the appropriate target folders within the Role Types folder. The Role Types folder is only visible within the JDE browser when the JDE is in Teams Mode (when the Teams Mode option in the View menu is checked).
  • Named Roles folder
    The Named Roles folder contains named roles of a type defined in the Role Types folder.

Of these folders, Team Types, TeamPlan Types, Role Types and Named Roles are available only when the Teams mode option is checked in the View menu.

When the JDE is in Teams Mode, the Agent Types folder may be included or excluded (as per your preference settings).

 
2.2.3.4 Data Model container

The following folders are located within the Data Model container:

  • Beliefset Types folder
    Beliefsets are added to the Beliefset Types folder in the Data Model container. They may be further elaborated by dragging events from the other folders and dropping them onto the appropriate target folders within the Beliefset Types folder.
  • View Types folder
    Views are added to the View Types folder in the Data Model container. They may be further elaborated by dragging named data from the other folders and dropping them onto the appropriate target folders within the View Types folder.
  • TeamData Types folder
    TeamData are added to the TeamData Types folder in the Data Model container. The TeamData Types folder is only visible in the Data Model container when the JDE is in Teams Mode (when the Teams Mode option in the View menu is checked).
  • External Classes folder
    This provides the ability to identify Java classes that are external to the project. The External Classes folder is used to provide a type for named data.
 
2.2.3.5 Other Files folder

Other files associated with the project are listed here. These files include regular Java files and data files of interest within the project.

 

2.3 Code Editor

The Code Editor appears whenever a text item is edited, unless an external editor is used. Using an external editor is discussed in the Preferences section.

The kinds of items that are edited with the Code Editor include:

  • documentation
  • Java code (contained in the Other Code folder of an entity)
  • reasoning methods (only textual, not graphically edited reasoning methods)
  • posting methods
  • external files (contained in the Other Files folder).

The Code Editor has a number of features designed to facilitate writing JACK code. It has a tool bar located in the top-left corner of the Code Editor window. The functions of the Code Editor are discussed in further detail in the Code Editor chapter of this document.

 
2.3.1 Opening the Code Editor

To open the Code Editor:

  1. Right-click on a text item and choose the appropriate menu item from the context menu. For example, a reasoning method or any documentation of a programming element (pencil icon). Alternatively, use a double left-click on the element.
  2. The Code Editor will open, either as the default Code Editor supplied with the JDE package, or the external editor specified in the user's Preferences options.
 
2.3.2 Closing the Code Editor
2.3.2.1 Saving changes internally

When editing an internal JDE text item (i.e. not an external file), the Code Editor window has two buttons to the right: Save and Close.

  • the Save button stores the user's work but leaves the window open so that work can be continued
  • the Close button closes the window without storing work (after providing a confirmation prompt).
 
2.3.2.2 Saving changes to external files

Saving changes to external files is discussed in detail in the Code Editor chapter of this document.

 

2.4 Using an External Editor

The JDE allows the user to specify an alternative to the Code Editor. This is discussed in the Preferences section of this document.

 

2.5 Compiler Utility

JACK-based applications can be compiled and run from within the JDE with the Compiler Utility. It provides a graphical user interface to the standard command-line based aos.main.JackBuild utility provided with JACK. Refer to the relevant section of the Agent Manual for further details.

 
2.5.1 Opening the Compiler Utility

Open the Compiler Utility at any time by selecting Compiler Utility from the Tools menu on the JDE menu bar, or by clicking on the Compiler Utility icon in the tool bar. If the Compiler Utility is already open, its window will be brought to the front.

clip_image005

Figure 2-4: Compiler Utility icon

 
2.5.2 Closing the Compiler Utility

To close the window at any time, click the Close button.

 
2.5.3 Features of the Compiler Utility

The Compiler Utility window consists of the tabs listed below. Further details are provided in the Compiler Utility chapter of this document.

  • Options tab
    Use this tab to set options used in compiling JACK code with the Compiler Utility.
  • Compile application tab
    Use this tab to convert an application from source code into an executable form.
  • Run application tab
    Use this tab to execute a compiled application (or any other Java application).
  • Convert Non-JDE JACK tab
    Use this option tab to generate a new JDE project from existing JACK code which was not developed using the JDE.
  • Output/Errors tab
    This tab displays the output from compiling or running an application as well as any output associated with the generation of G-Code.

你可能感兴趣的:(view)