This commit is contained in:
parent
e2800d939d
commit
c68e220be3
@ -3,10 +3,6 @@ type: docker
|
|||||||
name: default
|
name: default
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: example_strats
|
|
||||||
image: "python:3.8"
|
|
||||||
commands:
|
|
||||||
- python3 manystrats.py
|
|
||||||
- name: run_tournament
|
- name: run_tournament
|
||||||
image: "python:3.8"
|
image: "python:3.8"
|
||||||
commands:
|
commands:
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
|
|
||||||
|
def avg(ls: list) -> int:
|
||||||
|
return sum(ls) / len(ls)
|
||||||
|
|
||||||
|
|
||||||
def decision(h1, h2):
|
def decision(h1, h2):
|
||||||
if len(h1) == 0:
|
if avg(h2) > 0.51:
|
||||||
r = np.random.randint(2)
|
|
||||||
return r
|
|
||||||
else:
|
|
||||||
avg = 1.0 * sum(h1) / len(h1)
|
|
||||||
if avg <= 0.5:
|
|
||||||
return 0
|
|
||||||
else:
|
|
||||||
return 1
|
return 1
|
||||||
|
else:
|
||||||
|
return 0
|
||||||
|
Loading…
Reference in New Issue
Block a user