Skip to content

Instantly share code, notes, and snippets.

Last active June 29, 2017 17:27
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
A small code to illustrate the behaviour of how KaizenHarvester from loklak server project
Kaizen Harvester -
loklak server project -
import random
from matplotlib import pyplot
m = []
for i in range(101):
fraction = i / 100.
count = 0
for j in range(10000):
n = random.uniform(0, 1)
if n < fraction:
count += 1
m.append((fraction, count))
pyplot.xlabel("Ratio of queue filled")
pyplot.ylabel("Harvest attempts out of 10,000")
pyplot.title("Harvesting frequency vs. Filled queue ratio")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment