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