Skip to main content

Simulation Modelling Integration Framework

Project description

Simulation Modelling Integration Framework

Build status (Linux/OSX) Build status (Windows) Documentation Status Code Coverage https://zenodo.org/badge/67128476.svg

Description

smif is a framework for handling the creation of system-of-systems models. The framework handles inputs and outputs, dependencies between models, persistence of data and the communication of state across years.

This early version of the framework handles simulation models that simulate the operation of a system within a year. smif exposes an interface to a planning module which will allows different algorithms to be used against a common API.

Setup and Configuration

smif is written in Python (Python>=3.5) and has a number of dependencies. See requirements.txt for a full list.

Using conda

The recommended installation method is to use conda, which handles packages and virtual environments, along with the conda-forge channel which has a host of pre-built libraries and packages.

Create a conda environment:

conda create --name smif_env python=3.6

Activate it (run each time you switch projects):

activate smif_env

Note that you source activate smif_env on OSX and Linux (or e.g. Git Bash on Windows).

Add the conda-forge channel, which has smif available:

conda config --add channels conda-forge

Finally install smif:

conda install smif

GLPK

The optimisation routines currently use GLPK - the GNU Linear Programming Kit. To install the glpk solver:

  • on Linux or Mac OSX, you can likely use a package manager, e.g. apt install python-glpk glpk-utils for Ubuntu or brew install glpk for OSX.
  • on Windows, GLPK for Windows provide executables. For 64bit Windows, download and unzip the distribution files then add the w64 folder to your PATH.

fiona, GDAL and GEOS

We use fiona, which depends on GDAL and GEOS libraries.

On Mac or Linux these can be installed with your OS package manager, then install the python packages as usual using:

# On debian/Ubuntu:
apt-get install gdal-bin libspatialindex-dev libgeos-dev

# or on Mac
brew install gdal
brew install spatialindex
brew install geos

Installing smif with other methods

Once the dependencies are installed on your system, a normal installation of smif can be achieved using pip on the command line:

pip install smif

Versions under development can be installed from github using pip too:

pip install git+http://github.com/nismod/smif

To install from the source code in development mode:

git clone http://github.com/nismod/smif
cd smif
python setup.py develop

Running smif from the command line

Follow the getting started guide to help set up the necessary configuration.

To set up an sample project in the current directory, run:

$ smif setup

To list available model runs:

$ smif list
demo_model_run
...

To start the smif app, a user-interface that helps to display, create and edit a configuration, run:

$ smif app

To run a system-of-systems model run:

$ smif run demo_model_run
...
Model run complete

By default, results will be stored in a results directory, grouped by model run and simulation model.

To see all options and flags:

$ smif --help
usage: smif [-h] [-V] [-v] {setup,list,run} ...

Command line tools for smif

positional arguments:
{setup,list,app,run}  available commands
    setup               Setup the project folder
    list                List available model runs
    app                 Open smif app
    run                 Run a model

optional arguments:
-h, --help        show this help message and exit
-V, --version     show the current version of smif
-v, --verbose     show messages: -v to see messages reporting on progress,
                    -vv to see debug messages.

Citation

If you use smif for research, please cite the software directly:

  • Usher, W., Russell, T. and Schoenmakers, R. (2018). smif: simulation modelling integration framework (v0.7.6) [Software]. Available online: https://github.com/nismod/smif

Here’s an example BibTeX entry:

@Misc{,
    author = {Will Usher and Tom Russell and Roald Schoenmakers},
    title = {{smif}: simulation modelling integration framework (v0.7.6)},
    year = {2018},
    url = "https://github.com/nismod/smif",
    note = {[Online; accessed <today>]}
}

A word from our sponsors

smif was written and developed at the Environmental Change Institute, University of Oxford within the EPSRC sponsored MISTRAL programme, as part of the Infrastructure Transition Research Consortium.

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
smif-0.8.2.tar.gz (3.3 MB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page