mirror of
https://github.com/samsapti/bachelor-project.git
synced 2024-11-22 12:57:56 +00:00
Delete / change comments
This commit is contained in:
parent
35bd5b5f86
commit
137854380b
|
@ -36,8 +36,8 @@ class Matchmaker:
|
||||||
same_as_old = self.int_type(rank_patient) != self.int_type(rank_old_patient)
|
same_as_old = self.int_type(rank_patient) != self.int_type(rank_old_patient)
|
||||||
leaving = paired * matches_exp * same_as_old
|
leaving = paired * matches_exp * same_as_old
|
||||||
|
|
||||||
print_str('therapist: %s, patient: %s, old patient: %s, ', # worst therapist: %s, ',
|
print_str('therapist: %s, patient: %s, old patient: %s, ',
|
||||||
*(x.reveal() for x in (therapist, patient, old_patient))) # , worst_therapist)))
|
*(x.reveal() for x in (therapist, patient, old_patient)))
|
||||||
print_ln('rank patient: %s, rank old patient: %s, paired: %s, leaving: %s',
|
print_ln('rank patient: %s, rank old patient: %s, paired: %s, leaving: %s',
|
||||||
*(x.reveal() for x in
|
*(x.reveal() for x in
|
||||||
(rank_patient, rank_old_patient, paired, leaving)))
|
(rank_patient, rank_old_patient, paired, leaving)))
|
||||||
|
@ -76,7 +76,7 @@ class Matchmaker:
|
||||||
pref = self.int_type(p_cases[patient][0]) # patient suffers from pref
|
pref = self.int_type(p_cases[patient][0]) # patient suffers from pref
|
||||||
therapist = types.MemValue(self.int_type(0))
|
therapist = types.MemValue(self.int_type(0))
|
||||||
|
|
||||||
# Get index of next free therapist who has experience with pref
|
# Get index of first free therapist who has experience with pref
|
||||||
@for_range(self.N)
|
@for_range(self.N)
|
||||||
def _(i):
|
def _(i):
|
||||||
(_,), free = self.paired_patients.read(i)
|
(_,), free = self.paired_patients.read(i)
|
||||||
|
@ -101,9 +101,6 @@ class Matchmaker:
|
||||||
@for_range(init_rounds)
|
@for_range(init_rounds)
|
||||||
def _(i):
|
def _(i):
|
||||||
print_ln('patient %s : therapist %s', i, self.paired_therapists[i].reveal())
|
print_ln('patient %s : therapist %s', i, self.paired_therapists[i].reveal())
|
||||||
#print_ln('therapist %s : patient %s', i, self.paired_patients[i].reveal())
|
|
||||||
#types.cint(i).print_reg('ther')
|
|
||||||
#self.paired_patients[i].reveal().print_reg('pati')
|
|
||||||
|
|
||||||
def __init__(self, p_cases, t_exps, N, M=None, reverse=False,
|
def __init__(self, p_cases, t_exps, N, M=None, reverse=False,
|
||||||
oram_type=OptimalORAM, int_type=types.sint):
|
oram_type=OptimalORAM, int_type=types.sint):
|
||||||
|
@ -125,7 +122,6 @@ p_shares = Matrix(rows=PLAYERS, columns=MATCHING_SIZE, value_type=types.sint)
|
||||||
t_shares = Matrix(rows=PLAYERS, columns=MATCHING_SIZE, value_type=types.sint)
|
t_shares = Matrix(rows=PLAYERS, columns=MATCHING_SIZE, value_type=types.sint)
|
||||||
|
|
||||||
# Fill data from players into the matrices
|
# Fill data from players into the matrices
|
||||||
# The matrix is ordered as m[row:player][col:share]
|
|
||||||
@for_range(PLAYERS)
|
@for_range(PLAYERS)
|
||||||
def _(i):
|
def _(i):
|
||||||
@for_range(2 * MATCHING_SIZE)
|
@for_range(2 * MATCHING_SIZE)
|
||||||
|
@ -141,7 +137,7 @@ def _(i):
|
||||||
def _():
|
def _():
|
||||||
t_shares[i][index] = sint.get_input_from(i)
|
t_shares[i][index] = sint.get_input_from(i)
|
||||||
|
|
||||||
# Add entire column together to reveal secret-shared input
|
# Add entire columns together to recreate secret-shared input in ORAM
|
||||||
p_cases = OMatrix(N=MATCHING_SIZE, M=1, oram_type=OptimalORAM, int_type=types.sint)
|
p_cases = OMatrix(N=MATCHING_SIZE, M=1, oram_type=OptimalORAM, int_type=types.sint)
|
||||||
t_exps = OMatrix(N=MATCHING_SIZE, M=1, oram_type=OptimalORAM, int_type=types.sint)
|
t_exps = OMatrix(N=MATCHING_SIZE, M=1, oram_type=OptimalORAM, int_type=types.sint)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue