Wiki

Clone wiki

scenariotools-sml / runtime configuration

For simulation of an SDL specification, some data must be provided, namely an instance model and a set of role bindings. This data is provided in the form of runtime configuration files, or, runconfigs in short. The structure of a runconfig is defined by an xtext grammar in the project org.scenariotools.sdl.runtime.configuration.

run configuration example

This is an example configuration file for the productioncell specification. It states that it configures the productioncell specification, that it imports an instance model (objects) from the resource "Cell.xmi" and how the objects from that resource are to be mapped to the static roles in the specification.

configure specification ProductionCell 
// You can import arbitrary many xmi files.
use instancemodel "Cell.xmi" 

role bindings for collaboration Productioncell {
 object Cell1.a plays a
 object Cell1.p plays p
 object Cell1.controller plays c
 object Cell1.ts plays ts
}

XMI-Import mechanism

In theory, it is possible to import any resource type for which a resource factory has been registered in the emf resource factory registry. (TBC)

validation

A configuration file is validated by the xtend class org.scenariotools.sdl.runtime.ConfigurationValidator. If the file is validated successfully, we can assume that the input data is correct. In particular, no runtime class should need to check the provided data.

access

~~Configuration data may be accessed as described in this stackoverflow post.

automatic generation (todo)

It should be relatively easy to infer a configuration file from an existing specification. In order to do this, the number of objects for each declared type must be computed. A possible heuristic would be the following:

  • For a type t, find the use case, which has the highest number n of roles of type t
  • one object may not play several roles in one use case, therefore we need at least n objects of type t. After computing the number of required objects, role bindings for each use case must be defined.

See this issue for further information.

Updated