Python Merge Experimentation Library
pip install mergexp==0.3.0
This is the repository for XIR. The format of the representation is described below. Installation instructions for language bindings are in the READMEs of their respective directories.
XIR is a json based intermediate representation for MergeTB experiments. XIR models contain two major components
The top level XIR has the following format
{
xpid: "experiment id",
structure: {
<experiment structural model goes here>
},
behavior: {
<experiment behavioral model goes here>
}
}
The structural side of XIR is a very simple recursive network (network of networks) model. The general schema is shown below.
net:
id: uuid
nodes: [node]
links: [link]
nets: [net]
node:
id: uuid
endpoints: [endpoint]
props: {}
link:
id: uuid
endpoints: [[uuid],[uuid]]
props: {}
endpoint:
id: uuid
props: {}
The net object is a recursive representation of a network. Each network is a collection of nodes, links and subnetworks. Every element in XIR is identified by a UUID.
The node object encapsulates a property map and a set of endpoints. Each endpoint can be connected to a link.
The link object encapsulates a property map and two sets of endpoints. This by having two sets of endpoints instead of simply two endpoints, we retain the ability to model 1:1, 1:* and *:* links. Each endpoint is a uuid reference to an endpoint that is logically owned by a node.
The endpoint object encapsulates a set of properties. It is the junction between nodes and links.
The purpose of XIR is to model networked systems as a set of constraints. These constraints are represented as inline JSON objects as defined below.
The equality operator constrains the matching value space to elements that match the constraint value exactly. The following example constrains the matching value space to elements that have a key named "proc" and a value that is an object that contains a key "cores" that is exactly 4.
{ "cores": { "constraint__": "=", "value__": 4 } }
The greater operator constrains the matching value space to elements that are greater than the constraint value. The following example constrains the matching value space to elements that have a key named "proc" and a value that is an object that contains a key "cores" that is greater than 4.
{ "cores": { "constraint__": ">", "value__": 4 } }
The lesser operator constrains the matching value space to elements that are less than the constraint value. The following example constrains the matching value space to elements that have a key named "proc" and a value that is an object that contains a key "cores" that is less than 4.
{ "cores": { "constraint__": "<", "value_": 4 } }
The ordered choice operator constrains the matching value space to elements that are equal to at least one of the constraint values with a decreasing order of precedence. The following example constrains the matching value space to elements that have a key named "proc" and a value that is an object that contains a key "cores" that is greater than 4 or greater than 2 with a preference for greater than 4.
{ "cores": { "constraint__": "?", "value__": [4, 2] } }
This repository comes with a Dockerfile, a build script. The container is built with installed versions of all the language runtimes, plus the examples. See the dockerfile for mor details.