Project Internship – Intelligent Agents

Setting up the required environment

In the project internship we use Python with multiple packages. To simplify the setup, we provide a Docker-Container based on a prebuilt image containing all necessary dependencies for the project internship. The entire Docker-Container is prepared to cover all three exercises of the project internship, you will not need all packages and software for the first exercise.

Used Software

Provided Package

We provide a package, in which all exercises of the project internship may be solved. The packages contains a test scripts to check the setup and also some utility functions/ classes. The package is meant as a structure to fill with the solutions of all three exercises, however, each group may also create its own different structure.

The package is available as zip file from Moodle.

./project
├── docker-compose.yml # contains the configuration for the Docker-Container provided by us
├── run.sh # runs the Docker-Container starting a shell inside it
└── src # the main Python package
    ├── exercise1 # folder for exercise 1
    │   ├── agent_auctioneer.py # stub for exercise 1 
    │   ├── agent_bidder.py # stub for exercise 1
    │   ├── data # a folder containing data for exercise 1
    │   │   ├── corpus.txt
    │   │   └── sell.txt
    │   └── main.py # stub for exercise 1
    ├── test # contains test scripts 
    │   ├── moin_agent.py # one of the agents used by test_agent.py
    │   ├── test_agent.py # runs a simple agent, testing SPADE and the XMPP server
    │   └── visitor_agent.py # second agent used by test_agent.py
    └── utils # contains some util classes and functions
        ├── external.py
        ├── functions.py # write and read (json) files
        ├── random.py # seeded random
        └── wikipedia.py # class downloading articles from wikipedia  (uses a cache-file to speed up recurrent fetches of same article)

The package is meant to run as a Python package called src. If not using Docker, you may have to change the imports, e.g., change the lines 9-13 in ./project/src/test/test_agent.py.

Setup

We strongly recommend to use the Docker-Container provided by us. The container contains all dependencies and is already configured to work with our provided package and source code. However, it is also possible to install the packages on your own and use your own setup.

Setup using Docker

We prepared an Docker-Image on Docker Hub here. Using Docker and Docker-Compose, the Docker-Container starts as a shell inside the prepared environment.

  1. Install Docker
  2. Download our provided package from Moodle
  3. Open a terminal in the folder of the provided package
  4. Run the ./run.sh (or docker-compose run ia)
  5. Check the container using the scripts in the test section of our provided package
  6. Check out the Docker-Container

We have tested the Docker-Image and Docker-Container together with the scrips on macOS and Linux.

Attention: As everything is running in a stateless Docker-Container, only changes in the folder /home/user/src/ are stored on the host machine after the container has been terminated!

Manual Setup

Install all needed dependencies manually and run the code from our provided package outside of a Docker-Container.

  1. Install Python 3.10
  2. Install the needed packages
  3. Install an XMPP-Server (see XMPP-Server)
  4. Download our provided package from Moodle
  5. Check the setup using the scripts in the test section of our provided package