Skip to content

Latest commit

 

History

History
89 lines (75 loc) · 3.88 KB

README.md

File metadata and controls

89 lines (75 loc) · 3.88 KB

Exercise 1: Writing Your First Autonomous Agent!

A partial JADE implementation of the Room Automation Use Case.

Table of Contents

JADE agents

The system features a main container where four different agents register in total:

  • A Building Environment Agent (ENV) that models the building environment.
  • A Room Manager Agent (MNG) that perceives the environment and manages the room conditions.
  • A Blinds Controller Agent (BLINDS) that controls the blinds in the room (e.g. it raises the blinds).
  • A Lamp Controller Agent (LAMP) that controls the light in the room (e.g. it turns on the light).

Agents' provided services

Service Provided by (Agent) Searched by (Agent) Associated FIPA Interaction Protocol
read-illuminance ENV MNG Subscribe
read-weather ENV MNG Subscribe
set-weather ENV BLINDS, LAMP Request
increase-illuminance BLINDS, LAMP MNG Contract Net

Agent-to-agent communication

  • Initiators:
    • Agents: MNG
    • Associated Behaviors: PerceiveEnvironment, HandleIlluminancePercept, HandleWeatherPercept
  • Participants:
    • Agents: ENV
    • Associated Behaviors: SubscriptionServer, NotificationServer
  • Initiators:
    • Agents: BLINDS, LAMP
    • Associated Behaviors: RequestSetIlluminance
  • Participants:
    • Agents: ENV
    • Associated Behaviors: SetIlluminanceServer
  • Initiators:
    • Agents: MNG
    • Associated Behaviors: PerformContractNetProtocol
  • Participants:
    • Agents: BLINDS, LAMP
    • Associated Behaviors: OfferProposalsServer, SatisfyOffersServer

Project structure

The project is structured as follows:

├── cnp
│   ├── initiators
│   │   └── RoomManagerAgent.java
│   └── participants
│       ├── BlindsControllerAgent.java
│       └── LampControllerAgent.java
├── environment
│   ├── BuildingEnvironmentAgent.java
│   └── BuildingEnvironmentGUI.java
└── common
│   ├── BaseAgent.java
│   ├── CNPInitiator.java
│   └── CNPParticipant.java

How to run the project

Run with Gradle 7.4:

  • MacOS and Linux: run the following commands
  • Windows: replace ./gradlew with gradle.bat

To start the main container only with the Room Environment Agent (required for Task 1):

./gradlew.bat runEnv

To start the main container with all the agents in the environment (required for Task 2):

./gradlew.bat runRoomAll