Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Dogopher
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gabriel Santamaria
Dogopher
Commits
3778777a
Unverified
Commit
3778777a
authored
9 months ago
by
Gabriel Santamaria
Browse files
Options
Downloads
Patches
Plain Diff
Updating statistics
parent
f639dc6c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
compute.py
+20
-12
20 additions, 12 deletions
compute.py
game/strategy.py
+1
-1
1 addition, 1 deletion
game/strategy.py
with
21 additions
and
13 deletions
compute.py
+
20
−
12
View file @
3778777a
...
...
@@ -50,8 +50,8 @@ def is_mcts(ply, num_simul):
# The ultimate goal is to find the perfect couple
# that will make MCTS win most of the time.
ucb
=
[
UCB
.
ucb
,
UCB
.
ucb_tuned
]
weights
=
np
.
arange
(
0.5
,
10
,
2
)
levels
=
np
.
arange
(
8
,
10
,
1
)
weights
=
np
.
arange
(
0.5
,
10
,
1
)
levels
=
[
10
]
def
game
(
ce
,
fucb
,
level
,
i
):
...
...
@@ -79,18 +79,26 @@ def game(ce, fucb, level, i):
while
not
rules
.
game_over
(
grid
):
if
ply
==
1
:
s
=
time
.
time
()
action
=
player_one
.
get_action
(
grid
,
ply
)
if
is_mcts
(
ply
,
i
):
ttime
+=
time
.
time
()
-
s
niter
+=
1
grid
.
move
(
action
,
ply
)
try
:
action
=
player_one
.
get_action
(
grid
,
ply
)
if
is_mcts
(
ply
,
i
):
ttime
+=
time
.
time
()
-
s
niter
+=
1
grid
.
move
(
action
,
ply
)
except
RuntimeError
:
print
(
"
Runtime error, retrying...
"
)
continue
else
:
s
=
time
.
time
()
action
=
player_two
.
get_action
(
grid
,
ply
)
if
is_mcts
(
ply
,
i
):
ttime
+=
time
.
time
()
-
s
niter
+=
1
grid
.
move
(
action
,
ply
)
try
:
action
=
player_two
.
get_action
(
grid
,
ply
)
if
is_mcts
(
ply
,
i
):
ttime
+=
time
.
time
()
-
s
niter
+=
1
grid
.
move
(
action
,
ply
)
except
RuntimeError
:
print
(
"
Runtime error, retrying...
"
)
continue
ply
=
other
(
ply
)
...
...
This diff is collapsed.
Click to expand it.
game/strategy.py
+
1
−
1
View file @
3778777a
...
...
@@ -23,7 +23,7 @@ from .rules import Rules, Dodo
sys
.
setrecursionlimit
(
10
**
6
)
WORKERS_DIVISOR
=
1
WORKERS_DIVISOR
=
2
class
Strategy
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment