Skip to content

Everything required for exercise 6 in the FS23 Web-based Autonomous Systems course

Notifications You must be signed in to change notification settings

HSG-WAS-SS24/exercise-6

Repository files navigation

Exercise 6: Interacting Agents on the Web

This repository contains a partial implementation of a JaCaMo application where BDI agents interact with their environment based on W3C Web of Things (WoT) Thing Descriptions, and coordinate with each other to assist a user through their daily activities.

Table of Contents

Project structure

├── mockserver
│   └── room-services.json // the initializer for the mockserver that mocks the HTTP APIs of a calendar service, a wristband, a set of blinds, and a set of lights
├── src
│   ├── agt
│   │   ├── personal_assistant.asl // agent program of the personal assistant agent
│   │   ├── wristband_manager.asl // agent program of the wristband manager agent
│   │   ├── calendar_manager.asl // agent program of the calendar manager agent
│   │   ├── blinds_controller.asl // agent program of the blinds controller agent 
│   │   └── lights_controller.asl // agent program of the lights controller agent
│   └── env
│       └── room
│           └── DweetArtifact.java // artifact that can be used for sending messages to agents via the dweet.io API
└── task.jcm // the configuration file of the JaCaMo application

Task 1

Task 1.1

Complete the implementation of following:

  • the DweetArtifact.java for enabling agents to send messages via the dweet.io API;
  • the personal_assistant.asl so that the personal assistant can create a DweetArtifact instance, and achieve the goal of sending a message by using the artifact.
    • HINT: The CArtAgO By Example guide provides documentation and examples on how to program CArtAgO artifacts and their operations, and how to program agents that create artifacts and invoke artifact operations

Task 1.2

Complete the implementation of following:

Task 1.3

Complete the implementation of following so that the agents can inform the personal_assistant.asl about the state of the environment:

Task 1.4

Complete the implementation of following so that the agents can coordinate with each other based on the FIPA Contract Net Interaction Protocol:

Documentation

How to run the project

1. Run the mockserver that mocks the devices' HTTP APIs

Run MockServer with Docker:

docker run -v "$(pwd)"/mockserver/room-services.json:/tmp/mockserver/room-services.json -e MOCKSERVER_INITIALIZATION_JSON_PATH=/tmp/mockserver/room-services.json -d --rm --name      mockserver -p 1080:1080 mockserver/mockserver

The above command will run a Docker container in the background and will print the container ID. To stop a container run: docker stop <CONTAINER_ID>. You can use this Postman collection to inspect the behavior of the devices' mockserver.

2. Run the JaCaMo application

You can run the project directly in Visual Studio Code or from the command line with Gradle 7.4.

  • In VSCode: Click on the Gradle Side Bar elephant icon, and navigate through GRADLE PROJECTS > exercise-6 > Tasks > jacamo > task.
  • On MacOS and Linux run the following command:
./gradlew task
  • On Windows run the following command:
gradle.bat task

About

Everything required for exercise 6 in the FS23 Web-based Autonomous Systems course

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages