========= Spade-BDI
.. image:: https://img.shields.io/pypi/v/spade_bdi.svg
:target: https://pypi.org/project/spade-bdi/
.. image:: https://img.shields.io/pypi/pyversions/spade_bdi.svg
:target: https://pypi.org/project/spade-bdi/
.. image:: https://img.shields.io/pypi/l/spade_bdi
:target: https://opensource.org/licenses/MIT
:alt: MIT License
.. image:: https://pepy.tech/badge/spade_bdi
:target: https://pepy.tech/project/spade_bdi
:alt: Downloads
.. image:: https://readthedocs.org/projects/spade_bdi/badge/?version=latest
:target: https://spade-bdi.readthedocs.io?badge=latest
:alt: Documentation Status
.. image:: https://img.shields.io/pypi/format/spade_bdi.svg
:target: https://pypi.org/project/spade-bdi/
.. image:: https://coveralls.io/repos/github/javipalanca/spade_bdi/badge.svg
:target: https://coveralls.io/github/javipalanca/spade_bdi
Create hybrid agents with a BDI layer for the SPADE MAS Platform.
Features
- Create agents that parse and execute AgentSpeak ASL files.
- Manage beliefs and goals from Python or AgentSpeak.
- Add custom actions and functions.
- Exchange beliefs, goals and plans using
tell, untell, achieve,
unachieve, tellHow, untellHow and askHow.
- Handle structured message arguments and share matching plans between agents.
Only exchange plans with trusted agents: receiving a plan can change an
agent's behaviour.
Installing SPADE-BDI
SPADE-BDI supports Python 3.10 through 3.14 and requires an XMPP server.
Install the latest published release with::
pip install spade_bdi
Example
Create a basic.asl file::
!start.
+!start <- +car(red).
Then start the agent with credentials for your XMPP server::
import asyncio
import getpass
import spade
from spade_bdi.bdi import BDIAgent
async def main():
server = input("XMPP server: ")
password = getpass.getpass("Password: ")
agent = BDIAgent(f"basicagent@{server}", password, "basic.asl")
await agent.start()
try:
await asyncio.sleep(1)
print(agent.bdi.get_beliefs())
finally:
await agent.stop()
if __name__ == "__main__":
spade.run(main())
See the examples <https://github.com/javipalanca/spade_bdi/tree/master/examples>_
and documentation for messaging, custom actions and further examples.
Acknowledgements
This package was created with Cookiecutter_ and the audreyr/cookiecutter-pypackage_ project template.
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _audreyr/cookiecutter-pypackage: https://github.com/audreyr/cookiecutter-pypackage