From 76a95f6a0a8102abf89ecaf611f3849527c32cbc Mon Sep 17 00:00:00 2001 From: Manos Date: Wed, 29 Sep 2021 02:20:11 +0200 Subject: [PATCH] lmdk_bgt: Added uniform_cont --- code/lib/lmdk_bgt.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/code/lib/lmdk_bgt.py b/code/lib/lmdk_bgt.py index e86e814..b51465e 100644 --- a/code/lib/lmdk_bgt.py +++ b/code/lib/lmdk_bgt.py @@ -545,6 +545,18 @@ def uniform_r(seq, lmdks, epsilon): return rls_data, bgts +def uniform_cont(seq, lmdks, epsilon): + # Released + rls_data = [None]*len(seq) + # Budgets + bgts = uniform(seq, lmdks, epsilon) + for i, p in enumerate(seq): + r = p[2] in lmdks + # [original, perturbed] + rls_data[i] = [r, lmdk_lib.randomized_response(r, bgts[i])] + return rls_data, bgts + + def utility_analysis(seq, lmdks, o, epsilon): ''' Analyze the utility.