Skip to content

Instantly share code, notes, and snippets.

@seanavery
Created November 14, 2017 01:30
Show Gist options
  • Save seanavery/1832b257c7fc7a5d0428ad03914e0c27 to your computer and use it in GitHub Desktop.
Save seanavery/1832b257c7fc7a5d0428ad03914e0c27 to your computer and use it in GitHub Desktop.
import random
import time
class Simulation():
def __init__(self):
self.sigma = 2;
self.score = random.randint(1, 100)
print('### network score', self.score)
def simulate(self):
time.sleep(1)
self.score = round(random.gauss(self.score, self.sigma))
if self.score < 1:
self.score = 1
if self.score > 100:
self.score = 100
print('### network score', self.score)
return self.simulate()
simulation=Simulation()
simulation.simulate()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment