Skip to main content

SMarTalloc

A collection of utility functions for using Microsoft's Z3 theorem prover to find the maximal allocation of limited resources given a prioritized list of discrete tasks to be executed.

Resources and Tasks

smartalloc is designed to be as thin of a wrapper around the Z3 library as possible, so it does not define classes called "Resource" or "Task."

Instead, Z3 primitives, such as Int or Real, are considered the resources, and tasks that they are allocated for are represented by (collections of) Z3 constraints.

Allocation

The main workhorse of smartalloc is the allocate() function. It takes two arguments: the intrinsic constraints on the resources, and a list of the constraints required for each task.

Intrinsic resource constraints are applied immediately, and if the system already has no solution then an exception will be raised. After this, the constraints for each task are added to the system. If the system is still satisfiable then the task is considered "worked" and the next task will be added. If the system is not satisfiable, that task will be removed from the system before moving to the next. All tasks provided will be attempted to be added to the system; the ordering of the tasks determines which tasks get to claim their necessary resources first.

The allocate() function returns a tuple of two items. The first is the allocation description object (in the form of a Z3 model). The value of a resource variable can be retrieved from it by using it like a dictionary with the resource variable as the key. The second is a list of the indices of the tasks from the input are "worked" in the allocation result.

Release files for smartalloc 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smartalloc 0.0.1
File Size Uploaded
smartalloc-0.0.1.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for smartalloc 0.0.1
File Interpreter ABI Platform
smartalloc-0.0.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 8.7 kB

Release files / smartalloc-0.0.1.tar.gz

Download URL smartalloc-0.0.1.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
32f70deb352654e1a16db7e991403666c522e06f2baac1f95a2661c8746d2192
BLAKE2b-256 checksum
How to use checksums
21a63c272b2295fe42d57b796ed600f9996ebbfbd48ec4bbef48e86b2ab99e44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

Release files / smartalloc-0.0.1-py2.py3-none-any.whl

Download URL smartalloc-0.0.1-py2.py3-none-any.whl
Size 4.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
de4934a0803f5bda233a451b1c63fdb456dc08fcb4745dce9e3e1cfcee2713e1
BLAKE2b-256 checksum
How to use checksums
1dd612fe89edfb88367ff66083b0c7e23ea3b5419463bb1c89187a56bc537565
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page