-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
29 lines (25 loc) · 887 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# simulation for FMD2 experiment
from server import Server
# instantiate a server, number of clients produced can be changed
server = Server(200)
# value keeps track of successful experiments
x = 0
n = 10
# run this experiment n times
for i in range(n):
try:
# run the server/FMD2 experiment,
# false positive rate can be changed
server.run(1 / 2)
except AssertionError:
# can be triggered because there are false negatives,
# p is not in the right form or false positive rate is false
print("FMD2 experiment "+str(i+1)+" was unsuccessful!")
print("Experiment done :(, try again!")
print("")
else:
x += 1
print("FMD2 experiment "+str(i+1)+" was successful!")
print("Experiment done :), try with other values!")
print("")
print("Experiment was "+str(x/n*100)+"% successful!")