<commit_before>.. _extending:

============================
Extending SPADE with plugins
============================

This release of SPADE is designed as a very light version of the platform (compared with SPADE<3.0) which provides only
the core features that a MAS platform should have. This implies that some of the features that were provided by previous
versions of the platform are now not included.

*How makes that sense?* Well, all that previous features are not lost, but
are going to be turned into plugins that you can connect to your MAS application.

This way it is very easy to add new features to SPADE without disturbing the core development.

We have planned three different ways to design plugins for the SPADE platform, but of course we are open to suggestions.

.. warning::
    A plugin needs to complain with some requirements to be accepted as a SPADE plugin and be listed as an official
    plugin on the main page:
        #. It must be open source (of course!) and published in PyPi.
        #. The package must be called spade-* (e.g.: spade-bdi, spade-owl, etc.) and be imported as ``import spade_*``.
        #. It must be tested.
        #. It must follow the `PEP8 <https://www.python.org/dev/peps/pep-0008/>`_.

You can develop *new behaviours*, *new mixins* that modify behaviours, and of course *new libraries* that your agents
can use inside your behaviours. Let's see some examples of each of these ones:


New Behaviours
--------------

Developing new behaviours is as easy as creating a new class that inherits from ``spade.behaviour.CyclicBehaviour`` (or
any of its subclassed behaviours) and overload the methods that are needed. Pay atention to the methods that are related
with the control flow of a behaviour like ``_step``, ``done`` and ``_run``. And remember that you *should not* overload<commit_msg>Little correction<commit_after>.. _extending:

============================
Extending SPADE with plugins
============================

This release of SPADE is designed as a very light version of the platform (compared with SPADE<3.0) which provides only
the core features that a MAS platform should have. This implies that some of the features that were provided by previous
versions of the platform are now not included.

*How makes that sense?* Well, all that previous features are not lost, but
are going to be turned into plugins that you can connect to your MAS application.

This way it is very easy to add new features to SPADE without disturbing the core development.

We have planned three different ways to design plugins for the SPADE platform, but of course we are open to suggestions.

.. warning::
    A plugin needs to comply with some requirements to be accepted as a SPADE plugin and be listed as an official
    plugin on the main page:
        #. It must be open source (of course!) and published in PyPi.
        #. The package must be called spade-* (e.g.: spade-bdi, spade-owl, etc.) and be imported as ``import spade_*``.
        #. It must be tested.
        #. It must follow the `PEP8 <https://www.python.org/dev/peps/pep-0008/>`_.

You can develop *new behaviours*, *new mixins* that modify behaviours, and of course *new libraries* that your agents
can use inside your behaviours. Let's see some examples of each of these ones:


New Behaviours
--------------

Developing new behaviours is as easy as creating a new class that inherits from ``spade.behaviour.CyclicBehaviour`` (or
any of its subclassed behaviours) and overload the methods that are needed. Pay atention to the methods that are related
with the control flow of a behaviour like ``_step``, ``done`` and ``_run``. And remember that you *should not* overload
{'fraction_non_alphanumeric': 0.09626825310978908, 'fraction_numerical': 0.0037858301784748512, 'mean_word_length': 3.81640625, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5274344', 'n_tokens_mistral': 975, 'n_tokens_neox': 909, 'n_words': 548}