What You Will Build

In this document, you will build an environment to develop agent-based systems with Jason language.

Jason Installation

  1. Install Java 21

  2. Install Visual Sudio Code

  3. [windows] Install a terminal & shell tool like GitBash

  4. Install Jason:

    Unix and Windows

    Download a Jason release from here (download the file named jason-bin-…​..zip) and decompress it. The zip file contains documentation, examples, and a sub-directory bin with the file jason. It is a unix executable file, if not, change its properties with chmod +x jason. Finally, adds the directory bin in your machine PATH so that the command jason can be executed in a terminal.

    Linux

    You can use apt-get to install Jason (details here):

    echo "deb [trusted=yes] http://packages.chon.group/ chonos main" | sudo tee /etc/apt/sources.list.d/chonos.list
    sudo apt update
    sudo apt install jason-cli

To test the installation, run the command jason --version in a terminal. The output should be as follows:

Jason CLI 3.3.0

(You may need to close and open VSCode again to have Jason in its PATH terminal)

Create and run a new application

In a terminal, you can create a new Jason application, named app1, with the following command:

jason app create app1

A folder app1 is created for the application. Now you can open it with VSCode:

application

It has two agents (bob and alice) sharing a common environment. The code of the agents are in src/agt. The code of the environment is in src/env.

It would be useful to install a VSCode plugin that provides syntax highlight for Jason.

You can execute the application with

cd app1
jason app1.mas2j -v

The two agents print a hello world message.

The first time you run a Jason application, it may take a while to start, since Gradle is being used and it downloads all dependencies.

You can now change the code of your application and evolve the code of your agents.

Just as an example, change the code of alice.asl to

!start.

+!start <- .send(bob,tell,hello).

executes the system again, open the mind inspector, and see bob’s beliefs.

More on Jason CLI

To add more agents in your project:

jason app add-agent karlos

More commands for the application are shown with

jason app

and commands to monitor/control running applications with

jason mas

More about JasonCLI here.