GitXplorerGitXplorer
p

egsolver

public
1 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
4f8c500f892c10073a8e3b52cf6700ddbf2deeda

python3 compatibility

ppatricktotzke committed 2 years ago
Unverified
c65a9b0d5b4fb942636b18068a64832f8348c95d

don't output full stack traces on errors

ppazz committed 7 years ago
Unverified
e5aa3279c8591295c677ca790d3c24ba28a0af6d

fix output formatter for parity games

ppazz committed 7 years ago
Unverified
42446687bba6c3b579d21beaa028e97d13f50fe7

always end output in a newline

ppazz committed 7 years ago
Unverified
db5d823dea830d5d5f3769262fdce7528e4d3aa5

nx 2.0 compatibility

ppazz committed 7 years ago
Unverified
287a7f2e73e6adb10958562a37d86074973102f5

update dependency: nx >= 2.0

ppazz committed 7 years ago

README

The README file for this repository.

Egsolver solves finite, two-player energy games [0,1,2]. It computes the winning region and a winning strategy for the energy player using a simple progress measure refinement procedure (see e.g. [2]).

It is written in python and loosely motivated by the pgsolver suite for parity games.

Installation

Get the latest version:

git clone git@github.com:pazz/egsolver.git

In case you have pip installed, the following will do.

pip install ./egsolver

Otherwise, manually install the dependencies:

  1. numpy
  2. networkx

On debian/ubuntu:

sudo aptitude install python-networkx python-numpy

Now install egsolver using the setup script:

./setup.py install --user

This should install the executable as $HOME/.local/bin/egsolver.

Usage

There are currently three subcommands: convert, generate, and solve.

>egsolver -h

usage: egsolver [-h] [-v] [--version] [-l LOGFILE] {convert,generate,solve} ...

energy game solver

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         increase verbosity
  --version             show program's version number and exit
  -l LOGFILE, --logfile LOGFILE
                        where to log to; defaults to '-' (stdout)

commands:
  {convert,generate,solve}
    convert             convert game description to another format
    generate            generate a random game
    solve               solve a game

Also check out egsolver solve -h etc..

To generate a random game (with 5 states, edge- and owner probability 1/2 and maximal absolute effect 10):

egsolver generate 5 0.5 0.5 10

To generate and solve a random game:

egsolver generate 5 0.5 0.5 10 | egsolver solve

To further format the result in dot-format and display with xdot:

egsolver generate 5 0.5 0.5 10 | egsolver solve -f dot | xdot -

Input Format

egsolver uses a custom JSON format, designed with portability and later extensions to other types of games in mind. To see an example, just generate a random game graph.