Commit 6ff389ed authored by Vivien Kraus's avatar Vivien Kraus
Browse files

Resolve "Implement the predictors"

parent 8b73bddd
......@@ -34,6 +34,10 @@ deb:
- public
expire_in: 1 week
generate:
stage: check
script: "./ci/generate.sh"
pages:
stage: manual
script: "./ci/pages.sh"
......
......@@ -45,7 +45,6 @@ include screenshots/Makefile.am
include nsi/Makefile.am
include debian/Makefile.am
include flatpak/Makefile.am
include dataset/Makefile.am
include model/Makefile.am
AM_CPPFLAGS += \
......@@ -60,6 +59,7 @@ AM_CFLAGS += \
$(NETTLE_CFLAGS) $(XML_CFLAGS)
AM_LDADD += \
$(NETTLE_LIBS) $(XML_LIBS)
BUILT_SOURCES += tuneconfig.h
if WITH_GOBJECT
AM_CFLAGS += $(GOBJECT_CFLAGS)
......@@ -68,5 +68,9 @@ endif # WITH_GOBJECT
.PHONY: safe
safe:
$(MAKE) $(AM_MAKEFLAGS) doc/org-stamp
$(MAKE) $(AM_MAKEFLAGS) $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) src/tarot-app/tarot
$(MAKE) $(AM_MAKEFLAGS) doc/tarot-figures/example.png
$(MAKE) $(AM_MAKEFLAGS) doc/tarot-figures/example-tree.png
$(MAKE) $(AM_MAKEFLAGS) games/generated.xml
......@@ -22,4 +22,6 @@ EXTRA_DIST += \
%reldir%/check.sh \
%reldir%/mingw.sh \
%reldir%/flatpak.sh \
%reldir%/generate.sh \
%reldir%/generate-seed.sh \
%reldir%/deb.sh
#!/bin/sh
seed="$1"
for n_players in 3 4 5
do
>&2 echo "Generating $seed, $n_players players"
(tarot --generate=mcts -n $n_players -s $seed > $seed-${n_players}p.tarot-t \
&& mv $seed-${n_players}p.tarot-t dataset/generated/mcts/${n_players}p.tarot) \
|| >&2 echo "It failed."
(tarot --generate=stacking -n $n_players -s $seed > $seed-${n_players}p.tarot-t \
&& mv $seed-${n_players}p.tarot-t dataset/generated/stacking/${n_players}p.tarot) \
|| >&2 echo "It failed."
if [ "x$n_players" = "x5" ]
then
>&2 echo "Generating $seed, 5 players with call"
(tarot --generate=mcts -n 5 -c -s $seed > $seed-5pc.tarot-t \
&& mv $seed-5pc.tarot-t dataset/generated/mcts/$seed-5pc.tarot) \
|| >&2 echo "It failed."
(tarot --generate=stacking -n 5 -c -s $seed > $seed-5pc.tarot-t \
&& mv $seed-5pc.tarot-t dataset/generated/stacking/$seed-5pc.tarot) \
|| >&2 echo "It failed."
fi
done
#!/bin/sh
apt-get update
apt-get upgrade -y
apt-get install -y \
build-essential \
dbus \
dbus-x11 \
git \
libcairo2-dev \
libgirepository1.0-dev \
libglib2.0-dev \
libgtk-3-dev \
libreadline-dev \
libxml2 \
libxml2-dev \
nettle-dev \
parallel \
pkg-config \
valgrind
VERSION=$(cat dist/version)
cp dist/tarot-$VERSION.tar.gz . || exit 1
tar xf tarot-$VERSION.tar.gz || exit 1
mkdir build || exit 1
cd build/
../tarot-$VERSION/configure \
--enable-silent-rules=yes \
--enable-valgrind=yes \
|| (cat config.log; exit 1)
make -j 16 || exit 1
make install || exit 1
export PATH="/usr/local/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
mkdir /root/.ssh || exit 1
echo "$SSH_KEY" > /root/.ssh/id_rsa || exit 1
echo "$SSH_KEY_PUB" > /root/.ssh/id_rsa.pub || exit 1
echo "$SSH_KNOWN_HOSTS" > /root/.ssh/known_hosts || exit 1
chmod go-rwx /root/.ssh/id_rsa || exit 1
git config --global user.email "vivien@planete-kraus.eu" || exit 1
git config --global user.name "Gitlab CI for the tarot package" || exit 1
git clone git@framagit.org:play-tarot/datasets.git dataset/ || exit 1
rm -rf dataset/generated/mcts
rm -rf dataset/generated/stacking
mkdir -p dataset/generated/mcts || exit 1
mkdir -p dataset/generated/stacking || exit 1
seq 1 100 | parallel ../tarot-$VERSION/ci/generate-seed.sh {}
if test "x$CI_COMMIT_TAG" != "x" \
|| test "x$CI_COMMIT_REF_NAME" = "xmaster" \
|| test "x$CI_COMMIT_REF_NAME" = "xdevelop"
then
cd dataset
git checkout -b "update-generated-from-$VERSION" || exit 1
if git add .
then
git commit -m"Add the generated datasets from version $VERSION" || exit 1
git push origin "update-generated-from-$VERSION" || exit 1
fi
DATA=$(cat <<EOF
{
"id": $CI_PROJECT_ID,
"source_branch": "update-generated-from-$VERSION",
"target_branch": "master",
"title": "Update with the generated games for version $VERSION",
"remove_source_branch": true
}
EOF
)
curl \
--request POST \
--header "Content-Type: application/json" \
--header "PRIVATE-TOKEN: $PRIVATE_TOKEN" \
--data "$DATA" \
"$CI_API_V4_URL/projects/46125/merge_requests" \
|| exit 1
fi
<?xml version="1.0"?>
<tarot:game xmlns:tarot="http://planete-kraus.eu/tarot">
<tarot:setup n-players="3" with-call="no"/>
<tarot:deal-all>
<tarot:player player="P1"/>
<tarot:player player="P3"/>
<tarot:player player="P3"/>
<tarot:player player="P2"/>
<tarot:player player="P1"/>
<tarot:player player="P2"/>
<tarot:player player="P1"/>
<tarot:player player="P3"/>
<tarot:player player="P1"/>
<tarot:player player="P3"/>
<tarot:player player="P1"/>
<tarot:player player="P1"/>
<tarot:player player="P2"/>
<tarot:player player="P1"/>
<tarot:player player="P2"/>
<tarot:player player="P2"/>
<tarot:player player="P3"/>
<tarot:player player="P2"/>
<tarot:player player="P4"/>
<tarot:player player="P3"/>
<tarot:player player="P1"/>
<tarot:player player="P3"/>
<tarot:player player="P2"/>
<tarot:player player="P2"/>
<tarot:player player="P3"/>
<tarot:player player="P3"/>
<tarot:player player="P3"/>
<tarot:player player="P1"/>
<tarot:player player="P1"/>
<tarot:player player="P2"/>
<tarot:player player="P2"/>
<tarot:player player="P1"/>
<tarot:player player="P2"/>
<tarot:player player="P1"/>
<tarot:player player="P1"/>
<tarot:player player="P3"/>
<tarot:player player="P2"/>
<tarot:player player="P4"/>
<tarot:player player="P2"/>
<tarot:player player="P2"/>
<tarot:player player="P2"/>
<tarot:player player="P4"/>
<tarot:player player="P1"/>
<tarot:player player="P4"/>
<tarot:player player="P1"/>
<tarot:player player="P2"/>
<tarot:player player="P3"/>
<tarot:player player="P1"/>
<tarot:player player="P3"/>
<tarot:player player="P3"/>
<tarot:player player="P1"/>
<tarot:player player="P1"/>
<tarot:player player="P3"/>
<tarot:player player="P1"/>
<tarot:player player="P2"/>
<tarot:player player="P1"/>
<tarot:player player="P3"/>
<tarot:player player="P1"/>
<tarot:player player="P2"/>
<tarot:player player="P2"/>
<tarot:player player="P3"/>
<tarot:player player="P1"/>
<tarot:player player="P3"/>
<tarot:player player="P3"/>
<tarot:player player="P3"/>
<tarot:player player="P3"/>
<tarot:player player="P2"/>
<tarot:player player="P2"/>
<tarot:player player="P2"/>
<tarot:player player="P1"/>
<tarot:player player="P2"/>
<tarot:player player="P3"/>
<tarot:player player="P4"/>
<tarot:player player="P1"/>
<tarot:player player="P3"/>
<tarot:player player="P4"/>
<tarot:player player="P2"/>
<tarot:player player="P3"/>
</tarot:deal-all>
<tarot:bid bid="straight-keep"/>
<tarot:bid bid="pass"/>
<tarot:bid bid="pass"/>
<tarot:decl slam="no"/>
<tarot:decl slam="yes"/>
<tarot:handful/>
<tarot:card card="21T"/>
<tarot:handful/>
<tarot:card card="EXC"/>
<tarot:handful/>
<tarot:card card="18T"/>
<tarot:card card="4H"/>
<tarot:card card="10H"/>
<tarot:card card="CH"/>
<tarot:card card="14T"/>
<tarot:card card="15T"/>
<tarot:card card="19T"/>
<tarot:card card="16T"/>
<tarot:card card="6T"/>
<tarot:card card="13T"/>
<tarot:card card="8T"/>
<tarot:card card="2T"/>
<tarot:card card="12T"/>
<tarot:card card="11T"/>
<tarot:card card="7T"/>
<tarot:card card="10S"/>
<tarot:card card="3T"/>
<tarot:card card="9T"/>
<tarot:card card="9S"/>
<tarot:card card="5T"/>
<tarot:card card="CS"/>
<tarot:card card="4T"/>
<tarot:card card="10T"/>
<tarot:card card="3S"/>
<tarot:card card="4S"/>
<tarot:card card="1T"/>
<tarot:card card="6S"/>
<tarot:card card="JD"/>
<tarot:card card="8S"/>
<tarot:card card="KS"/>
<tarot:card card="QS"/>
<tarot:card card="7D"/>
<tarot:card card="2D"/>
<tarot:card card="8D"/>
<tarot:card card="2H"/>
<tarot:card card="KH"/>
<tarot:card card="6H"/>
<tarot:card card="AS"/>
<tarot:card card="QD"/>
<tarot:card card="5S"/>
<tarot:card card="JS"/>
<tarot:card card="6D"/>
<tarot:card card="QH"/>
<tarot:card card="7S"/>
<tarot:card card="4D"/>
<tarot:card card="AC"/>
<tarot:card card="QC"/>
<tarot:card card="KC"/>
<tarot:card card="4C"/>
<tarot:card card="AD"/>
<tarot:card card="CD"/>
<tarot:card card="8C"/>
<tarot:card card="9D"/>
<tarot:card card="CC"/>
<tarot:card card="AH"/>
<tarot:card card="5D"/>
<tarot:card card="JC"/>
<tarot:card card="5H"/>
<tarot:card card="3D"/>
<tarot:card card="3C"/>
<tarot:card card="7C"/>
<tarot:card card="10C"/>
<tarot:card card="6C"/>
<tarot:card card="JH"/>
<tarot:card card="9C"/>
<tarot:card card="3H"/>
<tarot:card card="9H"/>
<tarot:card card="2C"/>
<tarot:card card="8H"/>
<tarot:card card="7H"/>
</tarot:game>
<?xml version="1.0"?>
<tarot:game xmlns:tarot="http://planete-kraus.eu/tarot">
<tarot:setup n-players="4" with-call="no"/>
<tarot:deal-all>
<tarot:player player="P1"/>
<tarot:player player="P4"/>
<tarot:player player="P4"/>
<tarot:player player="P2"/>
<tarot:player player="P1"/>
<tarot:player player="P2"/>
<tarot:player player="P2"/>
<tarot:player player="P4"/>
<tarot:player player="P1"/>
<tarot:player player="P4"/>
<tarot:player player="P2"/>
<tarot:player player="P1"/>
<tarot:player player="P2"/>
<tarot:player player="P1"/>
<tarot:player player="P3"/>
<tarot:player player="P3"/>
<tarot:player player="P4"/>
<tarot:player player="P3"/>
<tarot:player player="P5"/>
<tarot:player player="P4"/>
<tarot:player player="P1"/>
<tarot:player player="P3"/>
<tarot:player player="P2"/>
<tarot:player player="P3"/>
<tarot:player player="P3"/>
<tarot:player player="P4"/>
<tarot:player player="P3"/>
<tarot:player player="P2"/>
<tarot:player player="P1"/>
<tarot:player player="P3"/>
<tarot:player player="P2"/>
<tarot:player player="P1"/>
<tarot:player player="P2"/>
<tarot:player player="P1"/>
<tarot:player player="P1"/>
<tarot:player player="P4"/>
<tarot:player player="P3"/>
<tarot:player player="P5"/>
<tarot:player player="P2"/>
<tarot:player player="P3"/>
<tarot:player player="P2"/>
<tarot:player player="P5"/>
<tarot:player player="P1"/>
<tarot:player player="P5"/>
<tarot:player player="P1"/>
<tarot:player player="P3"/>
<tarot:player player="P4"/>
<tarot:player player="P2"/>
<tarot:player player="P3"/>
<tarot:player player="P4"/>
<tarot:player player="P2"/>
<tarot:player player="P1"/>
<tarot:player player="P3"/>
<tarot:player player="P2"/>
<tarot:player player="P3"/>
<tarot:player player="P1"/>
<tarot:player player="P4"/>
<tarot:player player="P1"/>
<tarot:player player="P2"/>
<tarot:player player="P3"/>
<tarot:player player="P4"/>
<tarot:player player="P1"/>
<tarot:player player="P3"/>
<tarot:player player="P4"/>
<tarot:player player="P4"/>
<tarot:player player="P4"/>
<tarot:player player="P3"/>
<tarot:player player="P3"/>
<tarot:player player="P2"/>
<tarot:player player="P1"/>
<tarot:player player="P2"/>
<tarot:player player="P4"/>
<tarot:player player="P5"/>
<tarot:player player="P1"/>
<tarot:player player="P4"/>
<tarot:player player="P5"/>
<tarot:player player="P2"/>
<tarot:player player="P4"/>
</tarot:deal-all>
<tarot:bid bid="pass"/>
<tarot:bid bid="push"/>
<tarot:bid bid="pass"/>
<tarot:bid bid="pass"/>
<tarot:decl slam="no"/>
<tarot:decl slam="no"/>
<tarot:decl slam="yes"/>
<tarot:dog>
<tarot:card card="5C"/>
<tarot:card card="10D"/>
<tarot:card card="KD"/>
<tarot:card card="2S"/>
<tarot:card card="17T"/>
<tarot:card card="20T"/>
</tarot:dog>
<tarot:discard>
<tarot:card card="4H"/>
<tarot:card card="7H"/>
<tarot:card card="3D"/>
<tarot:card card="10D"/>
<tarot:card card="2S"/>
<tarot:card card="CS"/>
</tarot:discard>
<tarot:handful/>
<tarot:card card="7T"/>
<tarot:handful/>
<tarot:card card="EXC"/>
<tarot:handful/>
<tarot:card card="14T"/>
<tarot:handful/>
<tarot:card card="17T"/>
<tarot:card card="21T"/>
<tarot:card card="4T"/>
<tarot:card card="19T"/>
<tarot:card card="6T"/>
<tarot:card card="20T"/>
<tarot:card card="11T"/>
<tarot:card card="16T"/>
<tarot:card card="18T"/>
<tarot:card card="15T"/>
<tarot:card card="12T"/>
<tarot:card card="10T"/>
<tarot:card card="2T"/>
<tarot:card card="9S"/>
<tarot:card card="7S"/>
<tarot:card card="8S"/>
<tarot:card card="10S"/>
<tarot:card card="3S"/>
<tarot:card card="6S"/>
<tarot:card card="QS"/>
<tarot:card card="5S"/>
<tarot:card card="CD"/>
<tarot:card card="8D"/>
<tarot:card card="AD"/>
<tarot:card card="QD"/>
<tarot:card card="13T"/>
<tarot:card card="JS"/>
<tarot:card card="9T"/>
<tarot:card card="AS"/>
<tarot:card card="KC"/>
<tarot:card card="QC"/>
<tarot:card card="3C"/>
<tarot:card card="7C"/>
<tarot:card card="3T"/>
<tarot:card card="AC"/>
<tarot:card card="5T"/>
<tarot:card card="KS"/>
<tarot:card card="8T"/>
<tarot:card card="KH"/>
<tarot:card card="5D"/>
<tarot:card card="4S"/>
<tarot:card card="1T"/>
<tarot:card card="6D"/>
<tarot:card card="5C"/>
<tarot:card card="2C"/>
<tarot:card card="3H"/>
<tarot:card card="9H"/>
<tarot:card card="JH"/>
<tarot:card card="2D"/>
<tarot:card card="KD"/>
<tarot:card card="9D"/>
<tarot:card card="CC"/>
<tarot:card card="4D"/>
<tarot:card card="QH"/>
<tarot:card card="JC"/>
<tarot:card card="10H"/>
<tarot:card card="5H"/>
<tarot:card card="JD"/>
<tarot:card card="8C"/>
<tarot:card card="2H"/>
<tarot:card card="7D"/>
<tarot:card card="6H"/>
<tarot:card card="4C"/>
<tarot:card card="8H"/>
<tarot:card card="CH"/>
<tarot:card card="AH"/>
<tarot:card card="9C"/>
<tarot:card card="10C"/>
<tarot:card card="6C"/>
</tarot:game>
<?xml version="1.0"?>
<tarot:game xmlns:tarot="http://planete-kraus.eu/tarot">
<tarot:setup n-players="5" with-call="no"/>
<tarot:deal-all>
<tarot:player player="P1"/>
<tarot:player player="P5"/>
<tarot:player player="P5"/>
<tarot:player player="P3"/>
<tarot:player player="P2"/>
<tarot:player player="P3"/>
<tarot:player player="P2"/>
<tarot:player player="P4"/>
<tarot:player player="P2"/>
<tarot:player player="P5"/>
<tarot:player player="P2"/>
<tarot:player player="P1"/>
<tarot:player player="P3"/>
<tarot:player player="P1"/>
<tarot:player player="P3"/>
<tarot:player player="P4"/>
<tarot:player player="P4"/>
<tarot:player player="P3"/>
<tarot:player player="P6"/>
<tarot:player player="P4"/>
<tarot:player player="P1"/>
<tarot:player player="P4"/>
<tarot:player player="P3"/>
<tarot:player player="P3"/>
<tarot:player player="P4"/>
<tarot:player player="P5"/>
<tarot:player player="P4"/>
<tarot:player player="P2"/>
<tarot:player player="P1"/>
<tarot:player player="P4"/>
<tarot:player player="P2"/>
<tarot:player player="P1"/>
<tarot:player player="P2"/>
<tarot:player player="P1"/>
<tarot:player player="P1"/>
<tarot:player player="P5"/>
<tarot:player player="P3"/>
<tarot:player player="P5"/>
<tarot:player player="P2"/>
<tarot:player player="P4"/>
<tarot:player player="P2"/>
<tarot:player player="P6"/>
<tarot:player player="P1"/>
<tarot:player player="P5"/>
<tarot:player player="P1"/>
<tarot:player player="P3"/>
<tarot:player player="P5"/>
<tarot:player player="P2"/>
<tarot:player player="P4"/>
<tarot:player player="P5"/>
<tarot:player player="P2"/>
<tarot:player player="P2"/>
<tarot:player player="P4"/>
<tarot:player player="P2"/>
<tarot:player player="P3"/>
<tarot:player player="P1"/>
<tarot:player player="P5"/>
<tarot:player player="P1"/>
<tarot:player player="P3"/>
<tarot:player player="P3"/>
<tarot:player player="P5"/>
<tarot:player player="P1"/>
<tarot:player player="P4"/>
<tarot:player player="P4"/>
<tarot:player player="P5"/>
<tarot:player player="P4"/>
<tarot:player player="P3"/>
<tarot:player player="P3"/>
<tarot:player player="P2"/>
<tarot:player player="P1"/>
<tarot:player player="P3"/>
<tarot:player player="P4"/>
<tarot:player player="P5"/>
<tarot:player player="P1"/>
<tarot:player player="P5"/>
<tarot:player player="P6"/>
<tarot:player player="P2"/>
<tarot:player player="P5"/>
</tarot:deal-all>
<tarot:bid bid="push"/>
<tarot:bid bid="pass"/>
<tarot:bid bid="pass"/>
<tarot:bid bid="pass"/>
<tarot:bid bid="pass"/>
<tarot:decl slam="no"/>
<tarot:decl slam="yes"/>
<tarot:dog>
<tarot:card card="5C"/>
<tarot:card card="KD"/>
<tarot:card card="20T"/>
</tarot:dog>
<tarot:discard>
<tarot:card card="CH"/>
<tarot:card card="5C"/>
<tarot:card card="4D"/>
</tarot:discard>
<tarot:handful/>
<tarot:card card="21T"/>
<tarot:handful/>
<tarot:card card="12T"/>
<tarot:handful/>
<tarot:card card="10T"/>
<tarot:handful/>
<tarot:card card="EXC"/>
<tarot:handful/>
<tarot:card card="2T"/>
<tarot:card card="5H"/>
<tarot:card card="QH"/>
<tarot:card card="8H"/>
<tarot:card card="2H"/>
<tarot:card card="AH"/>
<tarot:card card="15T"/>
<tarot:card card="16T"/>
<tarot:card card="19T"/>
<tarot:card card="20T"/>
<tarot:card card="13T"/>
<tarot:card card="14T"/>
<tarot:card card="JD"/>