Skip to content

Commit

Permalink
Add EloBenchmark in dry mode (no writes) [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Jul 28, 2016
1 parent a113fa7 commit 6fd6398
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 8 deletions.
@@ -0,0 +1,4 @@
benchmark
benchDryElo
"Does not write any data"
data dryAdjustPlayerScores
@@ -0,0 +1,4 @@
benchmark
benchDryEloWithAllInstances
"Does not write any data"
data dryAdjustPlayerScoresWithAllInstances
Expand Up @@ -2,6 +2,8 @@
"class" : {
},
"instance" : {
"benchDryElo" : "fn 7/28/2016 11:13",
"benchDryEloWithAllInstances" : "fn 7/28/2016 11:13",
"benchElo" : "toma 5/11/2016 14:29",
"benchEloWithAllInstances" : "fn 7/12/2016 20:46",
"benchOpponentMatching" : "toma 5/11/2016 16:29",
Expand Down
@@ -1,9 +1,7 @@
elo-ranking
adjustPlayerScores


| expected delta |
expected := self blackPlayer chanceOfDefeating: (self whitePlayer).
delta := (self outcome - expected) * EloMatch maxMovedPoints.
self blackPlayer scorePoints: delta from: self whitePlayer.
self blackPlayer scorePoints: delta from: self whitePlayer.

@@ -0,0 +1,7 @@
elo-ranking
dryAdjustPlayerScores
| expected delta |
expected := self blackPlayer chanceOfDefeating: (self whitePlayer).
delta := (self outcome - expected) * EloMatch maxMovedPoints.
"self blackPlayer scorePoints: delta from: self whitePlayer."

Expand Up @@ -2,11 +2,12 @@
"class" : {
"maxMovedPoints" : "toma 5/10/2016 19:16" },
"instance" : {
"adjustPlayerScores" : "toma 5/11/2016 11:33",
"adjustPlayerScores" : "fn 7/28/2016 11:01",
"blackPlayer" : "toma 5/10/2016 16:00",
"blackPlayer:" : "toma 5/10/2016 16:00",
"date" : "toma 5/10/2016 16:00",
"date:" : "toma 5/10/2016 16:00",
"dryAdjustPlayerScores" : "fn 7/28/2016 11:02",
"id" : "toma 5/10/2016 16:00",
"id:" : "toma 5/10/2016 16:00",
"outcome" : "toma 5/10/2016 16:00",
Expand Down
@@ -0,0 +1,4 @@
elo-ranking
dryAdjustPlayerScores
"Estimate all player's Elo score given the match results"
self matches do: [:match | match dryAdjustPlayerScores]
@@ -0,0 +1,4 @@
elo-ranking
dryAdjustPlayerScoresWithAllInstances
"Estimate all player's Elo score given the match results"
EloMatch allInstancesDo: [:match | match dryAdjustPlayerScores]
Expand Up @@ -4,6 +4,8 @@
"instance" : {
"adjustPlayerScores" : "fn 7/12/2016 20:45",
"adjustPlayerScoresWithAllInstances" : "fn 7/12/2016 20:46",
"dryAdjustPlayerScores" : "fn 7/28/2016 11:02",
"dryAdjustPlayerScoresWithAllInstances" : "fn 7/28/2016 11:02",
"findOpponentFor:goodEnough:" : "toma 5/11/2016 14:54",
"matches" : "toma 5/10/2016 17:37",
"matches:" : "toma 5/10/2016 17:37",
Expand Down
2 changes: 1 addition & 1 deletion repository/SQPyte.package/monticello.meta/version
@@ -1 +1 @@
(name 'SQPyte-fn.1' message 'Merge all packages into SQPyte package' id 'f5ae1847-ab7d-457e-9295-04ace7c39b9a' date '27 July 2016' time '7:01:05.449548 pm' author 'fn' ancestors () stepChildren ())
(name 'SQPyte-fn.2' message 'Add Elo dry mode' id 'cff22168-a9b5-48b0-9139-0f51e07fc695' date '28 July 2016' time '12:22:18.38458 pm' author 'fn' ancestors ((name 'SQPyte-fn.1' message 'Merge all packages into SQPyte package' id 'f5ae1847-ab7d-457e-9295-04ace7c39b9a' date '27 July 2016' time '7:01:05.449548 pm' author 'fn' ancestors () stepChildren ())) stepChildren ())
21 changes: 18 additions & 3 deletions scripts/bench_sqpyte.sh
Expand Up @@ -26,25 +26,40 @@ while [ ${MATCHES} -le ${MAX} ]; do
"${RSQUEAK}" ${ARGS} -r "|b| DBObject Mode: 0. b := (EloBenchmark new) setUp: ${MATCHES}. ^ [b benchElo] timeToRun" "${IMAGE}"
echo "for ${MATCHES} matches without database"
echo "======================================================================="
"${RSQUEAK}" ${ARGS} -r "|b| DBObject Mode: 0. b := (EloBenchmark new) setUp: ${MATCHES}. ^ [b benchEloWithAllInstances] timeToRun." "${IMAGE}"
"${RSQUEAK}" ${ARGS} -r "|b| DBObject Mode: 0. b := (EloBenchmark new) setUp: ${MATCHES}. ^ [b benchEloWithAllInstances] timeToRun" "${IMAGE}"
echo "for ${MATCHES} matches without database and with Object>>allInstancesDo:"
echo "======================================================================="
"${RSQUEAK}" ${ARGS} -r "|b| DBObject Mode: 1. b := (EloBenchmark new) setUp: ${MATCHES}. ^ [b benchElo] timeToRun" "${IMAGE}"
echo "for ${MATCHES} matches with DBObject+SQLite"
echo "======================================================================="
"${RSQUEAK}" ${ARGS} -r "|b| DBObject Mode: 1. b := (EloBenchmark new) setUp: ${MATCHES}. ^ [b benchEloWithAllInstances] timeToRun." "${IMAGE}"
"${RSQUEAK}" ${ARGS} -r "|b| DBObject Mode: 1. b := (EloBenchmark new) setUp: ${MATCHES}. ^ [b benchEloWithAllInstances] timeToRun" "${IMAGE}"
echo "for ${MATCHES} matches with RFFI+SQLite and DBObject>>allInstancesDo:"
echo "======================================================================="
"${RSQUEAK}" ${ARGS} -r "|b| DBObject Mode: 2. b := (EloBenchmark new) setUp: ${MATCHES}. ^ [b benchElo] timeToRun" "${IMAGE}"
echo "for ${MATCHES} matches with DBObject+SQPyte"
echo "======================================================================="
"${RSQUEAK}" ${ARGS} -r "|b| DBObject Mode: 2. b := (EloBenchmark new) setUp: ${MATCHES}. ^ [b benchEloWithAllInstances] timeToRun." "${IMAGE}"
"${RSQUEAK}" ${ARGS} -r "|b| DBObject Mode: 2. b := (EloBenchmark new) setUp: ${MATCHES}. ^ [b benchEloWithAllInstances] timeToRun" "${IMAGE}"
echo "for ${MATCHES} matches with RFFI+SQPyte and DBObject>>allInstancesDo:"
echo "======================================================================="

"${RSQUEAK}" ${ARGS} -r "|b| DBObject Mode: 0. b := (EloBenchmark new) setUp: ${MATCHES}. ^ [b benchDryElo] timeToRun" "${IMAGE}"
echo "for ${MATCHES} matches in dry-mode without database"
echo "======================================================================="
"${RSQUEAK}" ${ARGS} -r "|b| DBObject Mode: 0. b := (EloBenchmark new) setUp: ${MATCHES}. ^ [b benchDryEloWithAllInstances] timeToRun" "${IMAGE}"
echo "for ${MATCHES} matches in dry-mode without database and with Object>>allInstancesDo:"
echo "======================================================================="
"${RSQUEAK}" ${ARGS} -r "|b| DBObject Mode: 2. b := (EloBenchmark new) setUp: ${MATCHES}. ^ [b benchDryElo] timeToRun" "${IMAGE}"
echo "for ${MATCHES} matches in dry-mode with DBObject+SQPyte"
echo "======================================================================="
"${RSQUEAK}" ${ARGS} -r "|b| DBObject Mode: 2. b := (EloBenchmark new) setUp: ${MATCHES}. ^ [b benchDryEloWithAllInstances] timeToRun" "${IMAGE}"
echo "for ${MATCHES} matches in dry-mode with RFFI+SQPyte and DBObject>>allInstancesDo:"
echo "======================================================================="

MATCHES=$((${MATCHES}+${STEPS}))
done

exit

echo ""

POINTS=1000
Expand Down

0 comments on commit 6fd6398

Please sign in to comment.