This commit is contained in:
		@@ -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
 | 
			
		||||
    else:
 | 
			
		||||
        avg = 1.0 * sum(h1) / len(h1)
 | 
			
		||||
        if avg <= 0.5:
 | 
			
		||||
            return 0
 | 
			
		||||
        else:
 | 
			
		||||
    if avg(h2) > 0.51:
 | 
			
		||||
        return 1
 | 
			
		||||
    else:
 | 
			
		||||
        return 0
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user