This guide contains detailed installation instructions for Linux and
Windows. A detailed guide for OSX will be added soon. If you’re not proficient with
installation procedures in Python, we suggest that you stick close to the installation guide.

This guide is based on (K)ubuntu 14.04 Trusty Tahr, 64bit. It works also on
(K)ubuntu 16.04 Xenial Xerus, 64bit, the only difference is the installation of PySide which
is a little bit tricky in both cases.

Maverig comes with a demo scenario which can be used to check if the installation is working
correctly. The maverig demo requires some simulators included in mosaik-demo. For that
we install mosaik-demo first.

As common in Python we use virtualenv to create virtual Python environments to keep the
dependencies required by different projects in separate places. You can find more information
in this guide to virtualenv. We will install maverig and
mosaik-demo into a virtualenv called maverig. We also need a folder where we put maverig and mosaik-demo.
Put these folders were you usually keep your source code. In the following we assume that this is a folder called
~/Code/.

Mosaik-demo requires the libraries NumPy, SciPy and h5py. We also need to install the
version control tool Mercurial. You can use the packages shipped with Ubuntu. We use
apt-get to install NumPy, SciPy, and h5py as well as Mercurial.

Your command line prompt should now start with (maverig) and roughly look
like this: (maverig)user@kubuntu:~$. The flag –system-site-packages makes sure that
the packages installed with apt-get can be used inside the virtualenv.
The -p option makes sure that a Python3.4 interpreter is used inside the virtualenv.
Without it the standard interpreter, which is Python2.7 in Ubuntu 14.04, would be used.

You can now get the mosaik-demo repository by cloning it into a folder where you
store all your code and repositories. As mentioned above we’ll use ~/Code/:

If no errors occur, the last command will start the demo. The web visualisation
shows the demo in your browser at http://localhost:8000. You can click the nodes of the
topology graph to show a time series of their values. You can also drag them
around to rearrange them.

1a. This point is only for (K)Ubuntu 14.04. For (K)Ubuntu 16.04 refer to 1b.

Maverig requires PySide, a Python binding for Qt. Unfortunately the required
version of PySide (1.2.2) is not available for Ubunutu 14.04 via apt-get so we
have to build it ``manually´´. The build requires a number of prerequisits that we can
install using apt-get:

For some reason PySide’s post install script is not executed properly, so we have to do it
manually. If you installed everything on its default locations, as described above, you execute
the script as shown below, else you have to adapt your path.

Now we have to copy the egg-info into the site-distribtution folder. If you followed the
standard rules and everything is installed in default locations you can use the following
command, otherwise you have to adapt your path.

After all these preparations we are finally able to install maverig itself.

(maverig)$ pip install maverig

If no error occured we can now start maverig.

(maverig)$ maverig

You’ll find a demo scenario in maverig (file|open, go to folder scenarios, select demo.mvrg). If you open it
and start the simulation (simulation|run or F5) you see the animation. You can click on
any element to see further information about it on the left side. For the use of
maverig consult the manual.

Maverig comes with a demo scenario which can be used to check if the installation is working
correctly. The maverig demo requires some simulators included in mosaik-demo. For this,
we install mosaik-demo first.

As common in Python we use virtualenv to create virtual Python environments to keep the
dependencies required by different projects in separate places. You can find more information
in this guide to virtualenv. We will install maverig and
mosaik-demo into a virtualenv called maverig. We also need a folder where we put maverig and mosaik-demo.
Put these folders where you usually keep your source code. In the following we assume that this is a folder called
Code that is located in your user directory.

Download and install Mercurial. We recommend to use TortoiseHg. Download the
correct version for your operation system and follow the installation assistant.

The version of pip that comes with Python 3.4 is quite old, so we have to update it.
Open a terminal window: Press the Windows key (or click on the start menu) and enter cmd.
Your terminal prompt should look like C:\Users\yourname>.

Upgrade pip by:

C:\Users\yourname>python -m pip install --upgrade pip

Make sure that Python and Mercurial is installed correctly by checking its versions.

Depending on the versions you installed your console window should show something like this:

C:\Users\yourname>python --version
Python 3.4.4
C:\Users\yourname>pip --version
pip 9.0.1 from c:\python34\lib\site-packages (python 3.4)
C:\Users\fschloegl>hg --version
Mercurial Distributed SCM (version 4.2.1)
(see https://mercurial-scm.org for more information)
Copyright (C) 2005-2017 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

If you get error messages the program(s) is(are) not installed correctly. In
most cases the environment variable PATH is not set correctly.

As mentioned above we need to create a virtualenv called maverig.
The common location for virtualenvs is under Envs/ in your users
directory:

You can drop the command line argument -p if you have only one installed version
of Python. If you have several versions of Python the path after -p has to
point at the respective Python executable.

Your command line prompt should now start with “(maverig)” and roughly look
like this: (maverig)C:\Users\yourname>.

Note

If your Windows account type is Standard User, you need to open the
terminal with administarator privileges (right-click the Terminal icon,
then open as Administrator). Make then sure that you are in your user
directory:

C:\Windows\system32> cd \Users\yourname
C:\Users\yourname>

Mosaik uses PYPOWER as grid simulator which requires NumPy and SciPy.
Further we need h5py for the database adapter of the demo.

If no errors occur, the last command will start the demo. The web visualisation
shows the demo in your browser at http://localhost:8000. You can click the nodes of the
topology graph to show a time series of their values. You can also drag them
around to rearrange them.

You’ll find a demo scenario in maverig (file|open, go to folder scenarios, select demo.mvrg). If you open it
and start the simulation (simulation|run or F5) you see the animation. You can click on
any element to see further information about it on the left side. For the use of
maverig consult the manual.