average strategy
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Torma Kristóf 2020-09-11 00:45:03 +02:00
parent e2800d939d
commit c68e220be3
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047
2 changed files with 7 additions and 12 deletions

View File

@ -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:

View File

@ -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