Welcome to the repository of the IAMS-Lab! ๐ค
Buckle up, because we're about to dive into the fascinating world of AgentSpeak programming using Jason. Whether you're a code wizard or just starting your journey, this repository is your go-to resource for presentations, code examples, exercises, and more.
- helpful slides about the AgentSpeak programming language and the Jason interpreter.
- code examples for both single and multi-agent systems
- engaging challenges to test your skills and understanding
- Course book: Programming Multi-Agent Systems in AgentSpeak Using Jason.
NOTE: Don't forget to check out the official Jason API for more details on its packages and classes. To access the complete Jason documentation and resources, visit the official website.
Follow these steps to set up your development environment in Visual Studio Code with Jason:
-
First, grab the Java SE Development Kit 17.0.8 from Oracle's official website. After installation, make sure it's working by running
java --version
in your terminal.Attention: Jason is only compatible with JDK version 17.0.8! Additionally, you might need to set the JAVA_HOME path within your system variables.
-
If you don't already have it, download and install Visual Studio Code.
-
If you're on Windows, don't forget to install a terminal and shell tool like GitBash.
-
Now, let's set up Jason:
4.1. Head over to SourceForge to download the jason-bin-3.2.0 file. Once you've got it, decompress it and place it wherever you like. Just one tip: avoid storing it in the "Program Files" directory!
4.2. Fire up Visual Studio Code and select the Git Bash terminal (View > Terminal > Choose Git Bash).
4.3. In the terminal, type
cd "your_jason_directory\bin"
to get to your Jason directory's bin folder.4.4. Make the jason file Unix executable with this command:
chmod +x jason
.4.5. For a smooth experience, add your_jason_directory/bin to your system's PATH. This way you can execute the jason command from anywhere! Here are some instructions to help you with this step. To check if it's working, try running
jason --version
in a different directory.4.1. Open your terminal and type
echo "deb [trusted=yes] http://packages.chon.group/ chonos main" | sudo tee /etc/apt/sources.list.d/chonos.list
to enable the installation of packages from Chonos repository onto your system.4.2. Next, run
sudo apt update
to update your package list.4.3. Finally, install the Jason CLI with
sudo apt install jason-cli
. -
To make life easier, install the Visual Studio Code plugin that provides syntax highlighting for Jason. Look for JaCaMo4Code in the VS Code Extensions marketplace and give it a click.
These steps simply show you how to build the default hello world app. This app serves as a simple starting point that you can use as a template for your own applications. Feel free to modify or remove the agents, environment, and configuration file to build your own custom app:
-
Go to the Jason bin directory:
cd "your_jason_directory\bin"
-
Create a default app:
jason app create your_app
. This app comes by default with the system configuration (.mas2j), a basic environment (.java) and two agents: bob and alice (.asl). These agents simply say "hello world" to each other, once you run the application. -
Add an extra agent to your app:
jason app add-agent your_agentname
. This agent simply bahaves like bob and alice, saying "hello world". -
Navigate to your app's directory:
cd your_app
-
Run your app:
jason your_app.mas2j -v
This repository uses the Jason Interpreter. We would like to thank the developers and contributors for their dedication in creating and maintaining this invaluable tool.