Skip to content

Plugin for SPADE 3 MAS platform to implement BDI Agents.

License

Notifications You must be signed in to change notification settings

sfp932705/spade_bdi

Repository files navigation

Spade-BDI

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.

About

Plugin for SPADE 3 MAS platform to implement BDI Agents.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published