forio Toggle navigation

World Manager

As discussed under the World API Adapter, a run is a collection of end user interactions with a project and its model. For building multiplayer simulations you typically want multiple end users to share the same set of interactions, and work within a common state. Epicenter allows you to create "worlds" to handle such cases.

The World Manager provides an easy way to track and access the current world and run for particular end users. It is typically used in pages that end users will interact with. (The related World API Adapter handles creating multiplayer worlds, and adding and removing end users and runs from a world. Because of this, typically the World Adapter is used for facilitator pages in your project.)

Using the World Manager

When you instantiate a World Manager, the world's account id, project id, and group are automatically taken from the session (thanks to the Authentication Service).

Note that the World Manager does not create worlds automatically. (This is different than the Run Manager.) However, you can pass in specific options to any runs created by the manager, using a run object.

For example:

var wMgr = new F.manager.WorldManager({
    account: 'acme-simulations',
    project: 'supply-chain-game',
    run: { model: '' },
    group: 'team1'


Constructor options

Required? Name Type Description
  group string The group name to use for filters / new runs
Yes run object Options to use when creating new runs with the manager, e.g. run: { files: ['data.xls'] }. See RunService for details.
Yes run.model string The name of the primary model file for this project.
  account string The account id. In the Epicenter UI, this is the Team ID (for team projects) or User ID (for personal projects). Defaults to undefined. If left undefined, taken from the URL.
  project string The project id. Defaults to undefined. If left undefined, parsed from the URL.
  token string For projects that require authentication, pass in the user access token (defaults to undefined). If the user is already logged in to Epicenter, the user access token is already set in a cookie and automatically loaded from there. (See more background on access tokens). @see Authentication API Service for getting tokens.
  transport JQueryAjaxOptions Options to pass on to the underlying transport layer. All jquery.ajax options are supported.
  server object string The value of host is usually the string, the URI of the Forio API server. This is automatically set, but you can pass it explicitly if desired. It is most commonly used for clarity when you are hosting an Epicenter project on your own server
  server.protocol https / http Defaults to https


getCurrentWorld([userId, groupName])

Returns the current world (object) and an instance of the World API Adapter.


Required? Name Type Description
  userId string The id of the user whose world is being accessed. Defaults to the user in the current session.
  groupName string The name of the group whose world is being accessed. Defaults to the group for the user in the current session.


    .then(function(world, worldAdapter) {


Returns the current run (object) and an instance of the Run API Service.


Required? Name Type Description
  model string The name of the model file. Required if not already passed in as run.model when the World Manager is created.


    .then(function(run, runService) {