Simulation Environment for the JavaScript Agent Machine


The design and technological implementation of smart adaptive materials is a challenge. Fundamental concepts has to be proven before any real system can br developed. Due to the strong coupling of sensing, reactive control, and information processing a multi-domain and multi-scale simulation has to be performed.

Combining physical world with MAS simulation is a challenge. Such a multi-domain simulation enables the direct derivation of sensor data from a physical model (sensing part) provision to a computational system, and the investigation of the action of this computational system on the physical system (actuating part). The goal of this multi-domain simulation is to investigate the behaviour of MAS on dynamic (or semi-static) changes of mechanical structures and vice versa.

The physical world consists of the mechanical structure given by a physical model (FEM or mass-spring multi-body), sensors, and external loading having impact on the static and dynamic reaction of the structure, including gravity. For the sake of simplicity, the mechanical structure under test is modelled with a mass-spring multi-body system. The multi-body physics simulation is well known from computer games and animations. It can be easily and efficiently integrated in computational systems like MAS simulators.

To this end, the SEJAM simulator (JAM platform + GUI + simulation control) was extended with a modified physics engine (based on Cannon.js and Three.js) enabling the direct coupling of the physical model with the computation of agents. The JAM platform and the SEJAM simulator are entirely implemented in JavaScript, executed with the Node Webkit (node.js+Chromium HTML browser).

A simulation model consists basically of three parts:

  1. The MAS behaviour models;
  2. The JAM virtual network world;
  3. The phyiscal model.

All parts are specified in JavaScript.

In this environment, the physical model can be accessed by all agents. A distributed MAS simulation consists of node and worker agents executed on different virtual JAM nodes. There is commonly one artificial agent (world agent) representing the world and managing the simulation, i.e., generating and updating sensor data accessed by the node and worker agents by using the unified tuple-space interface. The world agent can read and modify physical simulation variables, i.e., reading strain, force parameters, and setting material/structure properties (e.g., stiffness).

SEJAM2 Architecture


Simulation Model

The simulation model is specified in JSON+ format (JSON + function code) and is used to provide definitions of agent classes, the simulations world, nodes, composition of networks with nodes, initialization and initial instantiation of agents, and optionally physical multi-body physics models.

Agent classes can be embedded in the simulation or can be imported from external files by using the open statement. Each behavioural agent class is associated with a visual definition.

The following definitions give the basic structure of a simulation model and the semantic type interface.

Definition. SeJAM Simulation Model Template

simulation : model = {
  // Physical MBP model
  physics : { plate : {..}},
  // Computation and Communication: Agent behaviour Classes
  classes: {
    node :   { behaviour: function () {..}, visiual:{..} },
    ac2 : { behaviour: function () {..}, visiual:{..} },
    ac3 : { behaviour: function () {..}, visiual:{..} },
    world :  { behaviour: function () {..}, visiual:{..} },
  // Global simulation parameters used by agent and physical simu.
  parameter : {
    p1 : v1,
    p2 : v2,
  // Simulation set-up and initialization
  world: { ..
    init : { agents: {..}, physics: {..}},
    meshgrid : { node:{..}, port = {..},
    link:{..} .. } } // Network model

Definition. Semantic Type Model

type model = {
  physics : multibody component class {},
  classes : agent descriptor {},
  paramater: simulation parameter {},
  world : {
   init : function (),
   meshgrid : world class,
type world class = {
  node: node class, port:port class,
  link: link class}
type agent descriptor = {
  behaviour: agent constructor,
  visual : visu

A simulation world consists of agent processing nodes (logical/virtual JAM nodes) and some communication network enabling migration of agents and sending signals between nodes. Nodes are placed in a two-dimensional spatial simulation world, and each node has a distinct position.

Communication ports and links have either (static or dynamic) point-to-point or broad/multicast characteristics, i.e., nodes within a specific spatial range can communicate with each other.


SEJAM2 Multi-window GUI



SeJAM application package (platform independent) including node webkit, WIN32 platform, version xx