Skip to main content

Plugin for SPADE 3 MAS platform to implement BDI Agents.

Project description

Spade-BDI

https://img.shields.io/pypi/v/spade_bdi.svg https://img.shields.io/travis/sfp932705/spade_bdi.svg Documentation Status Updates

Implement BDI Agents based on the SPADE MAS Platform

Features

  • Create agents that parse and execute an ASL file written in AgentSpeak.

Examples

basic.py:

import argparse
from spade_bdi.bdi import BDIAgent

parser = argparse.ArgumentParser(description='spade bdi master-server example')
parser.add_argument('--server', type=str, default="localhost", help='XMPP server address.')
parser.add_argument('--password', type=str, default="bdipassword", help='XMPP password for the agents.')
args = parser.parse_args()

a = BDIAgent("BasicAgent@" + args.server, args.password, "basic.asl")
a.start()

a.bdi.set_belief("car", "blue", "big")
a.bdi.print_beliefs()

print(a.bdi.get_belief("car"))
a.bdi.print_beliefs()

a.bdi.remove_belief("car", 'blue', "big")
a.bdi.print_beliefs()

print(a.bdi.get_beliefs())
a.bdi.set_belief("car", 'yellow')

basic.asl:

!start.

+!start <-
    +car(red);
    .a_function(3,W);
    .print("w =", W);
    literal_function(red,Y);
    .print("Y =", Y);
    .custom_action(8);
    +truck(blue).

+car(Color)
 <- .print("The car is ",Color).

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.4 (2019-07-10)

  • Allow to send messages to JIDs stored as beliefs.

0.1.3 (2019-07-08)

  • Allow .send to a list of receivers.
  • Allow to receive messages with lists of lists.
  • Fixed readme.

0.1.1 (2019-06-18)

  • Moved from pyson to python-agentspeak
  • Added some helpers like pause_bdi, resume_bdi.
  • Now the asl file in the constructor is mandatory.
  • Allow to send tell messages with no args.
  • Allow sending messages with variables.
  • Extended the examples.

0.1.0 (2019-03-09)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for spade-bdi, version 0.1.4
Filename, size File type Python version Upload date Hashes
Filename, size spade_bdi-0.1.4-py2.py3-none-any.whl (6.5 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size spade_bdi-0.1.4.tar.gz (12.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page