Click here to Skip to main content
Click here to Skip to main content

Experiencing Jack (Agent development Environment)

, 1 Apr 2006
Rate this:
Please Sign up or sign in to vote.
I have discussed how to set up Jack and what it defines an agent to be, plus a step-by-step procedure to compile and run an example in it

Background

For the past six months, I have been carrying out research on Agent Oriented Software Engineering. Although this buzzword has been around now for a long time, I still haven't seen any large-scale implementations based on it. My part of research concentrates more on the design issues associated with it.

Now, prior to continuing with this text, I expect the reader to have an understanding of Agents and Distributed Artificial Intelligence, alternatively, Multi-Agent Systems. Please refer to my Introductory Article in case you don't know where to look for them: Agents and Multi-Agent Systems.

JACK (Agent Development Environment)

While comparing the different designing practices and methodologies, I noticed a fair bit of ambiguity existing as to what should be the part of an agent and an agents-based system. To clear things in my mind, I wanted to go through the whole development life-cycle once at least, based on the agent-oriented programming paradigm.

And that's how I came across Jack. Developed under Agent-Software, Jack is an agent development IDE that extends Java to incorporate the concepts of agent-oriented programming. So in place of objects, under AOSE, we talk about agents. From an implementation perspective, these agents having the same fundamental members as in objects (data members, functionalities), have additionally the following constituents:

  • Capabilities is the name given to the reusable components of agents, just like the modules in object-orientation. They encapsulate the reasoning constituents (events, plans, sub-capabilities, etc.) to provide a certain ability to any agent.
  • Plans are similar to functions in object-oriented classes. They are the instructions the agent follows to try to achieve its goals and handle its designated events.
  • Events trigger plans. Just like we have event handlers in .NET, we have plans in Jack. And they are executed as soon as certain events occur.
  • Belief Sets represent agent beliefs using a generic relational model. Queries can be applied on them and, when some changes occur, events can be associated with those changes.

Setting Up Jack with Java

Before installing Jack, you should set up Java Development Kit (JDK) on your system. Now what I installed was: j2sdk1.4.0. I downloaded it from Java.sun.com and it's a package sized around 35 MB. That's not it. Java Classpath and Path are two Environment Variables that must be set to certain values. Under Windows XP, follow these steps:

  • Go to System in control panel
  • In the Advanced Tab, click on Environment Variables
  • There will be two Group boxes: User Variables for [Username], System Variables
  • Under User Variables, edit CLASSPATH attribute as follows. (Format: location;location;location..)
  • Add this: C:\j2sdk1.4.0\jre\lib;C:\j2sdk1.4.0\lib; (Any references made to Java classes are supposed to follow these directories)
  • Now under System Variables, edit PATH attribute as follows
  • Add this: C:\j2sdk1.4.0\bin; (This folder contains Java program compiler, executer and other necessary tools that we can use either from the command prompt or from within any IDE or JDE)
  • Okay everything to save the new entries
  • To check if you are able to compile/execute, go to command prompt and enter "javac". If it says "command unrecognized", then there is a problem, else you are ready to move on!

Now you need Jack. An evaluation copy of Jack can be downloaded from this link.

Once you have downloaded and installed Jack, you may execute the IDE from your Program Shortcuts:

Start->Programs->Agent Software->JACK Developer

A black DOS screen will appear, and within seconds the IDE will load up itself. The DOS screen sticks with the IDE until you shut it down, so ignore it. The Interface looks like this:

Once you are on this screen, you do start with the following options in the file menu:

  1. Create a new project
  2. Open an existing project

Before doing any of these, remember the following file extensions to ease the usability:

Now when you will create a new project, suppose 'sss', you may notice this expanded file tree on the Solution Explorer Panel:

Every file can have a documentation associated with it. You can have as many design fragments as you want to. Any available agent-oriented engineering methodology can be used to design diagrams and interaction models. Whatever you have to add to the project you can do it from the menus, and that's as easy as Microsoft Paint.

Now I am not going into the details of things here, as you can very easily find everything in the documentation of Jack, more than you can consume.

Basically what seems to be ambiguous is where to start, like what should be the first step of developing an Agent Based System. And that really is the purpose why I am writing this text. Anyways, in short as in OOP we make classes; here we will make agents!

A Jack agent can exhibit reasoning behavior both proactively and reactively. It has:

  • A set of beliefs(ideas) about the world (its belief set)
  • A set of events(happenings) that it may respond to
  • A set of goals that it may desire to achieve as a consequence of an event
  • A set of plans that describe how it can handle the goals or events that may arise.

The systems works under the perception that agent lies in any environment and waits for events to occur. When an event occurs, it explores its belief set to see if it can handle the event. If it believes it knows the solution, that means it definitely has some plan that can be executed as a consequence. This whole scenario (event, beliefset and plan) is encapsulated in a capability definition. Besides this event-driven behavior, an agent can be declared to show proactive behavior by instantiating goals for itself or for any other agent.

Compiling and Executing a Sample Project

Jack comes with several examples that demonstrate typical agent behaviors in the respective atmospheres. Now to conclude this article, I will demonstrate how to compile and execute an agent-based system developed on Jack. Follow the steps listed below to execute the ATM-Graphical example:

  • Help -> Create Project from Example -> atm-graphical
  • Choose a folder where you want the project to be loaded and where Jack will place the Name.prj file. You may create one of your own folder prior to this.
  • Within a few seconds, the project will be loaded and you will be on this screen:

  • Jack has provided a compiler utility. You may open it from Tools(Ctrl+shift+C)
  • There are five tabs in it. Options are already set; don't modify anything for the time being.
  • Click on Compiler Application.
  • Don't transfer or move anything, simply click the COMPILE Button.
  • Jack will generate appropriate Java compliant files, and will switch the compiler utility to Output/Errors Tab.
  • In the same tab, if you see this: [JackBuild Done], that means compilation was successful and that Jack has transformed the source code into pure Java form, followed by Javac's successful final compilation.
  • Else if you see "couldn't execute Javac" that means you haven't properly defined the JDK/bin path in the system environment variable "PATH". Even in this case don't change the entries in the Option Tab, that won't change anything.
  • Now you are ready to go. Click the Run Application Tab.
  • Every Java application has one entry point main() which is always in a *.class file.
  • In this example, it is Main.class.
  • Double click it, and wait.
  • A simple GUI of the Graphical ATM Machine will appear.
  • Your account number is 10, pin code is 10 and you have 1000USDs initially.
  • Play with it. Enjoy!

The abilities of intelligent agents to autonomously perform simple tasks can be very beneficial. The key characteristics that make them attractive are as follows:

  • Ability to say "No" and "Go"
  • A higher-level of abstraction above object-oriented constructs
  • Flexibility associated with pro-active and reactive behaviors
  • Demonstration of Distributed Artificial Intelligence(DAI)
  • Ability to work co-operatively in groups (Multi-Agent Systems)

History

  • 1st April, 2006: Initial post

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Salman Jamali
Web Developer
China China
No Biography provided

Comments and Discussions

 
QuestionTo Salman Jamali PinmemberFiras T. Ahmed14-May-13 22:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web04 | 2.8.140821.2 | Last Updated 1 Apr 2006
Article Copyright 2006 by Salman Jamali
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid