randaut: add option --acc-type=random

Fixes #71.

* src/bin/randaut.cc: Implement option --acc-type.
* src/tgbaalgos/randomgraph.cc,
src/tgbaalgos/randomgraph.hh (random_acceptance): New function.
* src/tgbatest/randaut.test, wrap/python/tests/randaut.ipynb: Test it.
This commit is contained in:
Alexandre Duret-Lutz 2015-03-31 13:46:25 +02:00
parent d3ee61979c
commit 2f42c1c9bf
5 changed files with 2017 additions and 1830 deletions

View file

@ -81,3 +81,20 @@ test 6 = `$autfilt -c out-det1.hoa`
$autfilt -H out.hoa -o foo -c 2>stderr && exit 1
grep 'autfilt: options --output and --count are incompatible' stderr
$randaut -n 2 -S5 -A4 -H 2 | grep Acceptance: > output
$randaut --acc-type=random -n 2 -S5 -A4 -H 2 | grep Acceptance: >> output
cat output
cat >expected <<EOF
Acceptance: 4 Inf(0)&Inf(1)&Inf(2)&Inf(3)
Acceptance: 4 Inf(0)&Inf(1)&Inf(2)&Inf(3)
Acceptance: 4 (Fin(2) & Inf(3)) | Inf(0) | Fin(1)
Acceptance: 4 ((Inf(0) | Inf(1)) & Fin(3)) | Inf(2)
EOF
diff output expected
$randaut --spin --acc-type=random 2 2>stderr && exit 1
grep 'randaut: --spin.*--acc-type' stderr
$randaut --ba --acc-type=random 2 2>stderr && exit 1
grep 'randaut: --ba.*--acc-type' stderr