Naturally Pacifist Marsupials
    Have ideas to improve npm?Join in the discussion! »

    behaviour-js

    0.0.1 • Public • Published

    Behaviour-js

    Behaviour-js is a module to create and manipulate behaviours. Behaviour is the parent class that contains several methods. The children's classes like OneShotBehaviour, CyclicBehaviour and others in the future, inherits from parent class. Many methods are used only as part of an agent or FSM. The documentation is located in the folder behaviour-js_doc. In the future, I hope to use this module for implement a plateform for system multi-agent.

    Installation

    Package

    Via npm:

    $ npm install behaviour-js

    Getting started

    // Add module for OneShotBehaviour
    var OneShotBehaviour = require('behaviour-js').OneShotBehaviour;
     
    // To create class "DesiredBehaviour" inherits from OneShotBehaviour
    function DesiredBehaviour(){
     
      OneShotBehaviour.call(this);
     
      // To retrieve the content of parent's methods : optional
      DesiredBehaviour.prototype = new OneShotBehaviour();
     
      // The behaviour's action
      this.action = function(){
     
        console.log("Hello world!");
      };
    };
     
    // To create a new DesiredBehaviour
    var behaviour = new DesiredBehaviour();
     
    // Call the method action
    behaviour.action();

    Author

    If you have any questions or suggestions, please don't hesitate to contact me : belaich.david@outlook.fr .

    Install

    npm i behaviour-js

    DownloadsWeekly Downloads

    0

    Version

    0.0.1

    License

    MIT

    Last publish

    Collaborators

    • avatar