Giter Site home page Giter Site logo

timkam / js-son Goto Github PK

View Code? Open in Web Editor NEW
38.0 3.0 10.0 10.72 MB

Light-weight reasoning-loop agent library for JavaScript

Home Page: https://arxiv.org/pdf/2003.04690.pdf

License: BSD 2-Clause "Simplified" License

JavaScript 100.00%
multi-agent-systems multiagent-systems

js-son's Issues

Support all valid JSON data types as beliefs

At the moment JS-son returns a warning when a belief is not a JSON object. Ideally, JS-son should support JSON data types as well, which are:

  • string
  • number
  • array
  • boolean
  • null

Jupyter example: fix variable handover from Node.js to Python

pixiedust_node features a store command to explicitly handover Node.js variables to Python, see: this blog post. We should use this in the Jupyter example and get rid of the terrible sleep statement. Edit: The store function is deprecated and does not differ from a global variable assignment, which also allows hand-overs. I.e., it is not possible to fix the handover delay problem properly. As a slightly better solution than the current fixed sleep(), we can add a waiting loop:

while not 'histories' in globals():
  time.sleep(1)

Specify default preferenceFunction

In many use cases, intentions equal desires, simply because the desire generation function can jump straight to intentions (the intermediate step is in practice not always relevant).
Hence, we should specify a default determinePreferences value for the Agent object type that assumes the generated desires can be fed as intentions straight into the plans.
This default value would be: (beliefs, desires) => desireKey => desires[desireKey](beliefs).

When the update is released, some of the examples should be adjusted as well.

Transpile node module with Babel

At the moment, JS-son does not bundle/transpile the source code. This means that it only works with state-of-the-art JavaScript execution environments (and it is generally inconvenient for users). It makes sense to set up a proper build process with Babel.js compilation/transpilation.

Add Sphinx documentation

It makes sense on the long run to have one set of documentation that includes both JSDoc and high-level usage instructions/tutorials.
For this, we can use Sphinx and sphinx-js--an extension for documenting JavaScript projects with Sphinx.

Enable agent instantiation with configuration object

The agent function has seven parameters, many of which are optional. It makes sense to allow for a configuration using a single configuration object so that users don't need to worry about parameter order or pass undefined to "skip" an optional parameter.

Priority belief revision function: enable keeping initial priorities

For now, the priority belief revision function always adopts the priorities of the "defeating" beliefs.
This can be undesirable, as it means that in case of a serious of defeats, the priority of the corresponding beliefs necessarily increases (with the exception of 0-priority beliefs).
Hence, it makes sense to make it configurable whether a belief should have a fixed priority or adopt the priority of the defeater.
This can be done globally or per belief.

Bundle with webpack

While JS-son already uses Babel to transpile to legacy-compliant JavaScript, it does not properly bundle the files. Configure a webpack workflow for this.

Enable generation of JS doc

Docs Generating JS doc still fails because of unused legacy code. Remove the dead code and make sure the JS doc can be generated.

Add example: website

Add an example that shows how to use JS-son in the context of a website/web application.

Decrease code duplication in test cases

To test the different JS-son components, we often use only slightly different code for generating, agents, BDI-plan sets, and environments. Move this code into a dedicated module and get rid of unnecessary duplication.

Add further contribution guidelines

Contributors should:

  • Add/update tests.
  • Add/update JS doc comments.
  • Ensure ESLint does not show any error and warnings.
  • Reference issues in their commits and branch names.

Change entry point

The current entry point--index.js in the root directory just "forwards" imports from src/js-son and can be removed if the entry point in package.json is adjusted accordingly.

Implement support for custom belief revision function

At the moment, the initial handling of a JS-son agent's belief update is somewhat dictated by the environment, i.e., a JS-son agent executes it as follows:

this.beliefs = {
      ...this.beliefs,
      ...beliefs
    }

Here, beliefs are the beliefs the agent gets handed over from the environment. As we can see, these beliefs overwrite all beliefs with the same key that the agent has held before.

This enhancement will implement support of a belief revision function that a) addresses this issue, allowing the agent to reject updates from the environment and b) providing a first-class abstraction for belief revision as a first step in the agent's reasoning loop.

The update will be backwards compatible, i.e., the default belief revision function will be along this line:

(oldBeliefs, newBeliefs) => ({ ...oldBeliefs, ...newBeliefs })

Change package name

npm refuses to publish the package: Package name too similar to existing packages.
Rename the package to js-son-agent.

Allow for additional parameters in Environment's state update and state filter functions

The current functions for state update and state filter (i.e., deciding which state properties are provided to an agent) lack parameters for some use cases:

  1. stateFilter should be called with an agent's ID, so different agents can get different state updates.

  2. update should be called with the current state, so properties of the current state can be manipulated.

Document: dependencies

js-son only has dev dependencies; i.e. adding it as a dependency does not require any additional library. This is worth mentioning in the README.

Provide built-in support for distributed MAS

At the moment, JS-son is by default an entirely centralized MAS; distributed interactions are not treated as a first-class citizen. This should change, for example by adding the following features:

  • Allow distributed agents to connect to JS-son environments.
  • Allow peer-to-peer interactions between distributed JS-son agents.

Update usage instructions in README

The usage instructions in the README are incomplete and outdated.
Improve the instructions, possibly by using an example as can be found in the test specifications.

Add grid world environment

To improve the out-of-the-box capabilities of JS-son, add a grid-world environment plus a running multi-agent example for agents that act in such an environment.

Implement new belief abstraction: beliefs depending on other beliefs

Currently, beliefs in JS-son are JSON objects and there are no dependencies between beliefs, at least not as first-class abstractions. Extend JS-son beliefs so that a belief can be a function of other beliefs. Here, we need the following (initial idea):

  1. A belief can have a function, where the input variables are other beliefs, either beliefs in the agent's belief base or beliefs in the update that the agent receives.
  2. The belief's value is used as a backup in case any of the input variables is undefined.
  3. Beliefs with functions are ordered, i.e. they have an order number assigned that determines the order with which belief functions are called. Beliefs that are simple values are updated before the functions are called.

Update entry point

The entry point (index.js) does not yet work, as it does not consider the structure of the JS-son exports. Fix this.

Allow agents to manipulate themselves

In the current JS-son version, all updates to an agent's beliefs are processed by the environment first, i.e. an agent can only update its own beliefs by requesting the update through the environment. Updates of plans, desires and preference functions (the preference function generates the agent's intentions based on its desires or beliefs) are not possible.
A new feature is planned to be implemented to change this. Agents should be able to manipulate themselves with no restrictions, directly via their plans. Because this feature enables an extreme degree of dynamic evolution, agents should be configurable to not support this feature.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.