It consists of the following folders:
- client_src
- server_src
- src
It consists of the following folders:
-
agent_environment:
a. src: the source folder of the base codes.
b. scenarios: containing Clingo action theory files for experimenting. c. config files (files ending with "..._config.json"): defining the files needed by each agent's and environment.
The src folder contains the following files:
- agent.py: the code for running individual agent.
- env.py: the code for running the environment.
- env_misc.py: some functions that env.py needs.
- misc.py: some codes that both the environment and agent needs.
- parser_factory.py: A parser factory to generate parsers to get fluent and actions' names.
- planner.py: A planner defining the behaviour of each individual agent.
-
Install mosquitto following the instruction at https://mosquitto.org/download/:
Mosquitto is a MQTT broker (pubish-subscriber model) used to handle communication between agent and environemnt.
-
Install paho-mqtt module for agent and environment to talk to the broker:
pip install paho-mqtt
-
Start the MQTT broker (if not running yet, the instructions will be displayed at the time of install). You can run:
MacOS:
brew services start mosquitto
or MacOs:
mosquitto -c /usr/local/etc/mosquitto/mosquitto.conf
-
Start the environment:
a. In a different terminal tab/session, go to the src folder of agent_environment.
b. Run:
python3 env.py <path_to_env_config>
For example:
python3 env.py ../env_config.json
-
Start the agent
a. In a different terminal tab/session, go to the src folder of agent_environment.
b. Run:
python3 agent.py <path_to_agent_config>
For example:
python3 agent.py ../agent1_config.json
and
python3 agent.py ../agent2_config.json
-
Run environment.
make env
-
Run car producer
make ID=car_producer agent
-
Run speedy auto part
make ID=speedy_auto_part agent
-
Run supplier of speedy auto part.
make ID=supplier_of_speedy_auto_part agent