Skip to main content

mx — Model Execution Platform

mx executes a populated Shlaer-Mellor metamodel: a scenario drives the mx engine against a system repository and its initialized domain populations

mx is a Shlaer-Mellor Executable UML model execution engine. It takes a populated metamodel — one or more modeled domains produced by xuml-populate — and executes it: driving state machines, running state and method activities, evaluating actions, and dispatching events, the way a compiled xUML model would run, but interpreted directly against the model.

mx does not parse model text. It reads serialized TclRAL .ral databases that already hold the populated metamodel and domain data, and interprets them at runtime.

Using mx as a library

mx is primarily a library package, intended to be driven by the Model Debugger (mdb). The mdb loads a system, injects stimuli, steps execution, and inspects results while mx does the underlying model execution work. Control is handed back and forth between the two: mx announces significant events (state entries, dispatched signals, external events) and suspends so a supervisor like mdb can observe and decide what happens next.

Install into the environment that hosts mdb (or your own driver):

pip install mi-mx

Then drive it from your own code much as mdb does — create the System singleton, load a system and a playground, inject stimuli, and run:

from pathlib import Path
from mx.system import System

s = System()
s.initialize(system_path=Path("path/to/elevator"), verbose=False)
s.load_domains(playground="one_bank_one_shaft")
# ... inject stimuli and call s.go() ...

Running mx standalone ("demo" mode)

You can also exercise mx on its own, independently of mdb, to put it through its paces. The mx command runs a built-in demonstration driver, mx/_mdb.py — a stand-in for the real Model Debugger that loads a system, selects a playground, and injects a hard-coded scenario:

mx -s path/to/elevator      # -s / --system : path to a system directory
mx -s path/to/elevator -v   # verbose console output
mx -s path/to/elevator -L   # keep the mx.log diagnostic file (removed on exit otherwise)
mx -V                       # print version

An example system ships in the repo, so from a source checkout you can run:

mx -s src/mx/systems/elevator

Demo mode is for shaking out the engine in isolation. The playground and scenario it runs are currently fixed in _mdb.py; real, varied scenarios are meant to be driven through mdb.

What a "system" looks like

The three pieces in the banner above map to the on-disk layout that mx -s <system> expects:

<system>/
  models/
    mmdb_<name>.ral          # System Repository: the populated metamodel — all modeled
                             # domains, no instance data. Exactly one .ral file lives here.
    <ALIAS>_types.yaml       # per-domain user-type -> TclRAL type mapping (prefixed by domain alias)
  playgrounds/
    <playground_name>/
      population/
        <ALIAS>.ral          # an Initialized Domain: one domain database populated with instance
        <ALIAS>_*.sip        # data + initial states (one .ral / .sip per domain, named by alias)
      scenarios/
        <name>.yaml          # a Scenario: the sequence of interactions that drives execution
  • System Repository (mmdb_<name>.ral) — the populated Shlaer-Mellor metamodel holding every modeled domain, but no instance data. In the elevator example this is the Elevator Management (EVMAN) domain; a system may hold several (e.g. EVMAN, TRANS, SIO).
  • Initialized Domains (playgrounds/<name>/population/) — each domain's starting instance population and initial state-machine states, so a run can begin from a known configuration. Instance populations are defined in .sip (Scenario Instance Population) files; see the sip-parser wiki for the grammar. A single system can host many playgrounds, and you can run different scenarios against each.
  • Scenario (playgrounds/<name>/scenarios/*.yaml) — a sequence of interactions (e.g. a cabin is requested up from the lobby, it arrives, a floor is selected, doors close, the cabin transits and arrives with doors opening). Interactions inject events into the loaded system and collect the responses and status updates of interest along the way, for validation or exploration.

Each *_types.yaml and *.sip file name must begin with a domain name or alias (case-insensitive), so mx can associate it with the right domain.

Documentation

See the project wiki for more detail.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mi_mx-0.6.0.tar.gz (70.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mi_mx-0.6.0-py3-none-any.whl (108.8 kB view details)

Uploaded Python 3

File details

Details for the file mi_mx-0.6.0.tar.gz.

File metadata

  • Download URL: mi_mx-0.6.0.tar.gz
  • Upload date:
  • Size: 70.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for mi_mx-0.6.0.tar.gz
Algorithm Hash digest
SHA256 3cb3a0b8b2f2454eb92e6f8edd6e57ede72ae71ba2bd8080c58258fe5a598bd1
MD5 255d764e1052ffe1e91db922c4dd38a8
BLAKE2b-256 2f34d5f5b94ed2d422d66e709cbb2514603f40ea6825081fbde384d0c7804007

See more details on using hashes here.

File details

Details for the file mi_mx-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: mi_mx-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 108.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for mi_mx-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 35e904d28cafc20ec56ca30c40b8e064868c760e56c29121b003130dd2f6263e
MD5 27ef6ceb42d0cb50916c6739da7d8e47
BLAKE2b-256 1d5df19f19f68d9445074f81171fa13bb620e5ea988a341aa08ba9c35f7f1ade

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 files

0.5.1

2 files

0.5.0

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.9

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page