def cdf_to_dist(self, cdf):
Convert a CDF to a distribution (keep the list format, just discount lower bounds).
lo_bound = 0.0
dist = []
for cand, hi_bound in cdf:
dist.append((cand, hi_bound - lo_bound))
lo_bound = hi_bound
return dist
def get_best_child(self, parent, cdf):
After Change
def cdf_to_dist(self, cdf):
Convert a CDF to a distribution (keep the list format, just discount lower bounds).
lo_bound = 0.0
dist = {}
for cand, hi_bound in cdf:
dist[cand] = hi_bound - lo_bound
lo_bound = hi_bound
return dist
def get_best_child(self, parent, cdf):