Skip to content

javipalanca/spade_bdi

master
Switch branches/tags
Code
This branch is 21 commits ahead of sfp932705:master.
Contribute

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Spade-BDI

MIT License Downloads Documentation Status

Create hybrid agents with a BDI layer for the SPADE MAS Platform.

Features

  • Create agents that parse and execute an ASL file written in AgentSpeak.
  • Supports Agentspeak-like BDI behaviours.
  • Add custom actions and functions.
  • Send TELL, UNTELL and ACHIEVE KQML performatives.

Examples

basic.py:

import getpass
from spade_bdi.bdi import BDIAgent

server = input("Please enter the XMPP server address: ")
password = getpass.getpass("Please enter the password: ")

a = BDIAgent("BasicAgent@" + server, 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).

Examples

basic.py:

import getpass
from spade_bdi.bdi import BDIAgent

server = input("Please enter the XMPP server address: ")
password = getpass.getpass("Please enter the password: ")

a = BDIAgent("BasicAgent@" + server, 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

Packages

No packages published

Languages

  • Python 83.4%
  • Makefile 16.6%