django - Python sports game outcome algorithm -


i create algorithm generate score both teams in game using both element of random, , teams overall rating. far have similar following.

# determine score home_overall = 78 away_overall = 85 home_score = numpy.random.choice(range(4), p=[.2, .4, .3, .1]) away_score = numpy.random.choice(range(4), p=[.2, .4, .3, .1]) 

as example of i'm looking do, i'd have such if team rated 95 playing against team 75, have higher chance of getting higher score lower rated team. calculate p based on teams rating somehow? team 95 rating have

p=[.1,.2,.5,.3] 

and lower rated team have

p=[.3,.4,.2,.1] 

i'm not sure algorithm since values of p have add 1 , i'd want recalculate p every time game run.


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -