Design of Model Execution in Second Life

We want to be able to run NetLogo models in Second Life. (Alternatively each NetLogo micro-behaviour could have a parallel SL script. The advantage of the following scheme is that it will work for any model without any translation of NetLogo micro-behaviours to SL. The disadvantage is that this relies upon communication between our server and SL which is slower, constrained by Linden Labs policies, and relies upon a good net connection.)

A rough plan is

  1. Create a service (in GWT) that enables one to click a button to run a model in SL. The Modelling4All server would then launch NetLogo (headless) on the server and run the model via the NetLogo command API.
  2. Also implement (in GWT) a servlet that responds with the current state of an object when requested via HTTP. When a request arrives the servlet queries the NetLogo model for the state using the NetLogo command API. State changes include changes in position, size, visibility, shape, and colour.
  3. An SL script is created that repeatedly sends out HTTP requests to our server asking about state changes and updates its state accordingly.

Regarding SL communicating to NetLogo via our server, according to

http://wiki.secondlife.com/wiki/LlHTTPRequest

roughly one request per second is allowed per object and responses are limited to 2048 bytes. This should be adequate for a demonstrate a proof of concept.

Some limited communication back from Second Life to our server should be possible to set parameters and implement simple interactions.

Probably the best architecture is where those SL objects that are tracking a NetLogo object regularly issues HTTP requests to our server which then issues a NetLogo command to find the state of the object and sends it back to SL. An alternative architecture is to have the NetLogo model produce a stream of events that the SL objects consume. This isn't well supported by Linden Labs. But here is how it would work:

  1. Create an extension of NetLogo that produces a stream of events that can be consumed by a SL script. Events include create/destroy/show/hide new agents, move agents, resize agents, and maybe change shape.
  2. Write an SL script that consumes these events. Need to work out a scheme for identity of agents and the correspondence between the NetLogo and SL versions.
  3. Create a service (in GWT) that enables one to click a button to run a model in SL. The Modelling4All server would then launch NetLogo (headless) on the server and run the model via the NetLogo command API.
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License