Skip to content

Commit

Permalink
collusion test
Browse files Browse the repository at this point in the history
  • Loading branch information
sara-santana committed Nov 29, 2024
1 parent 86d78c8 commit 2364015
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions beacon/scripts/collusion_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ def update_user_budget_to_initial(individual_id):
{"individualId": individual_id},
{"$set": {"budget": -(math.log10(0.5))}},
)
print("!!!!!!!!!!!!!!!!!!!!!!!!!!!")
print("THE BUDGET WAS UPDATED, SO 1 MORE USER")
print("The budget is now: ", client.beacon['budget'].find_one({"individualId": individual_id},))
print("!!!!!!!!!!!!!!!!!!!!!!!!!!!")
except Exception as e:
return None

Expand Down Expand Up @@ -151,16 +147,15 @@ def main():
if individual_id in stdout:
print("!!!!!!!!!!!!!!!!!!!!!!!!!!!")
print(f"The individual {individual_id} was removed in variant number {var_count}")
print("!!!!!!!!!!!!!!!!!!!!!!!!!!!")
total_risk -= (current_budget - client.beacon.get_collection('budget').find_one({"individualId": individual_id})['budget'])
print("!!!!!!!!!!!!!!!!!!!!!!!!!!!")
print("The total risk is now: ", total_risk)
print("!!!!!!!!!!!!!!!!!!!!!!!!!!!")
if total_risk <= 0:
print("The number of users after the re-identification limit is: ", user_count)
break
user_count += 1
update_user_budget_to_initial(individual_id)
print("THE NUMBER OF COLLUDING USERS IS NOW: ", user_count)
print("!!!!!!!!!!!!!!!!!!!!!!!!!!!")
if stderr:
print("Error:", stderr)

Expand Down

0 comments on commit 2364015

Please sign in to comment.