This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

PyMCDP is an interpreter and solver for Monotone Co-Design Problems

Project Description

**PyMCDP** is a Python interpreter and solver for Monotone Co-Design Problems.
It is currently in beta-testing. Please email if you wish to help.

Please see <> for an introduction (or some [examples][examples]).


*Below, an example of a graphical representation of an MCDP (left)
along with the MCDPL snippet that describes it (right)*

<td><img src="out_expected/battery_minimal-clean.png" width="400px"/></td>
<td><img src="out_expected/battery_minimal-syntax_pdf.png" width="300px"/>

## Installation

### Prerequisites

On Ubuntu:

$ sudo apt-get install python-numpy python-matplotlib python-yaml python-pip
$ sudo apt-get install graphviz wkhtmltopdf git
$ sudo apt-get install texlive-extra-utils # pdfcrop

### Option 2: Install using pip

Run this command:

$ sudo pip install -U PyMCDP conftools quickapp decentparams decentlogs

Note that if you omit the ``sudo``, modern Ubuntu 16 will install
correctly in the directory ``~/.local/``. In this case,
make sure you have ``~/.local/bin/`` in your ``PATH``.

### Option 1: Installation from source

Clone the repo using:

$ git clone

Jump into the directory:

$ cd mcdp

Then install the main module:

$ sudo python develop

Omit the sudo if you have already set up a virtual environment.

## Getting started

#### Running the web interface

Run the command:

$ mcdp-web

Then point your browser to the address <>.

#### Solving Monotone Co-Design Problems

The program ``mcdp-solve`` is a solver.

$ mcdp-solve -d <library> <model_name> <functionality>

For example, to solve the MCDP specified in the file ``battery.mcdp`` in
the library ``mcdp_data/libraries/examples/example-battery.mcdplib``, use:

$ mcdp-solve -d mcdp_data/libraries/examples/example-battery.mcdplib battery "<1 hour, 0.1 kg, 1 W>"

The expected output is:

Iteration result: ConvergedToFinite
Fixed-point iteration converged to: {x ∣ x ≥ (0.03941 kg, 0.13941 kg) }
Minimal resources needed: mass = {x ∣ x ≥ 0.03941 kg }

This is the case of unreasonable demands (1 kg of extra payload):

$ mcdp-solve -d mcdp_data/libraries/examples/example-battery.mcdplib battery "<1 hour, 1.0 kg, 1 W>"

This is the expected output:

Iteration result: ConvergedToTop
Fixed-point iteration converged to: {x ∣ x ≥ (⊤, ⊤) }
Minimal resources needed: mass = {x ∣ x ≥ ⊤ }

#### Visualization of Co-Design Problems

The programs ``mcdp-plot`` will parse and plot the MCDP in a variety of representations.

$ mcdp-plot -d <library> <model name>

For example, the command

$ mcdp-plot -d mcdp_data/libraries/examples/example-battery.mcdplib battery

will produce these graphs:

<td>Syntax highlighting</td>
<td><a href="out_expected/battery-syntax_pdf.png">
<img src="out_expected/battery-syntax_pdf.png" height="500px"/>
<tr><td>Verbose graph</td><td><a href="out_expected/battery-default.png"><img src="out_expected/battery-default.png"/></a></td></tr>
<tr><td>Cleaned-up graph</td><td ><a href="out_expected/battery-clean.png">
<img src="out_expected/battery-clean.png" height="300px"/></a></td></tr>
<tr><td>Tree representation</td><td><img src="out_expected/battery-dp_tree.png"/></td></tr>

<h2>Visualization of the solution</h2>

To solve an MCDP, one constructs a chain of antichains in the product poset of resources.

The animations below show the sequence of antichains being
constructed to solve two variations of the same problem.

(Whether the problem statement describes an MCDP is
absolutely not obvious using the formula representation; it becomes obvious when writing the problem as a graph
of monotone problems.)

<tr><td colspan="2">
<img src="animations/model.png" width="500px"/>
<td><img src="animations/plusinvnat2-nat4-problem.png" width="300px"/></td>
<td><img src="animations/plusinvnat2-nat10-problem.png" width="300px"/>
<td><img src="animations/plusinvnat2-nat4.gif" width="300px"/></td>
<td><img src="animations/plusinvnat2-nat10.gif" width="300px"/></td>
<td colspan="2"><img src="animations/legend.png" width="500px"/></td>

<h2>More information</h2>

For more information, please see <>.

Release History

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
PyMCDP_devel-2.0.13.tar.gz (4.0 MB) Copy SHA256 Checksum SHA256 Source Jul 9, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting