Metadata-Version: 2.4
Name: spade_bdi
Version: 0.3.3
Summary: Plugin for SPADE 3 MAS platform to implement BDI Agents.
Author-email: Javi Palanca <jpalanca@gmail.com>
Maintainer-email: Javi Palanca <jpalanca@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://spadeagents.eu/plugins/spade-bdi/
Project-URL: Repository, https://github.com/javipalanca/spade_bdi
Project-URL: Documentation, https://spade-bdi.readthedocs.io
Keywords: spade,spade_bdi,bdi,cognitive
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Microsoft :: Windows
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Internet :: XMPP
Requires-Python: <=3.14,>=3.10
Description-Content-Type: text/x-rst
License-File: LICENSE
License-File: AUTHORS.rst
Requires-Dist: spade>=4.1.4
Requires-Dist: agentspeak>=0.2.2
Requires-Dist: loguru>=0.7.3
Provides-Extra: dev
Requires-Dist: bump-my-version==1.3.0; extra == "dev"
Requires-Dist: wheel==0.47.0; extra == "dev"
Requires-Dist: watchdog==6.0.0; extra == "dev"
Requires-Dist: ruff>=0.15.13; extra == "dev"
Requires-Dist: black>=26.3.1; extra == "dev"
Requires-Dist: tox>=4.54.0; extra == "dev"
Requires-Dist: coverage==7.14.0; extra == "dev"
Requires-Dist: pytest==9.0.3; extra == "dev"
Provides-Extra: docs
Requires-Dist: Sphinx==8.1.3; extra == "docs"
Requires-Dist: sphinx-rtd-theme==3.1.0; extra == "docs"
Dynamic: license-file

=========
Spade-BDI
=========

.. image:: https://img.shields.io/pypi/v/spade_bdi.svg
        :target: https://pypi.python.org/pypi/spade

.. image:: https://img.shields.io/pypi/pyversions/spade_bdi.svg
    :target: https://pypi.python.org/pypi/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.python.org/pypi/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.


* Free software: MIT License
* Documentation: https://spade-bdi.readthedocs.io.


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.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
