mirror of
https://github.com/samsapti/bachelor-project.git
synced 2024-11-21 20:37:55 +00:00
Make gen_data.sh shuffle patient data and use it for therapists
This commit is contained in:
parent
70c25542b1
commit
cbdf6e9e17
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
|||
/ansible/inventory
|
||||
/ansible/.vagrant/
|
||||
/src/out-p?.txt
|
||||
|
|
|
@ -105,7 +105,7 @@ class Matchmaker:
|
|||
|
||||
# Constants
|
||||
PLAYERS = 3
|
||||
MATCHING_SIZE = 5
|
||||
MATCHING_SIZE = 10
|
||||
|
||||
p_shares = Matrix(rows=PLAYERS, columns=MATCHING_SIZE, value_type=types.sint)
|
||||
t_shares = Matrix(rows=PLAYERS, columns=MATCHING_SIZE, value_type=types.sint)
|
||||
|
@ -120,7 +120,7 @@ def _(i):
|
|||
@do_while
|
||||
def _():
|
||||
try:
|
||||
typ = sint.get_input_from(i)
|
||||
typ = cint.get_input_from(i)
|
||||
|
||||
@if_e(typ == -100)
|
||||
def _():
|
||||
|
|
|
@ -15,27 +15,23 @@ secret_share() {
|
|||
share_2="$(( secret - (share_0 + share_1) ))"
|
||||
}
|
||||
|
||||
declare -a p_data_0
|
||||
declare -a p_data_1
|
||||
declare -a p_data_2
|
||||
declare -a t_data_0
|
||||
declare -a t_data_1
|
||||
declare -a t_data_2
|
||||
|
||||
max_index=5
|
||||
iter="$1"
|
||||
|
||||
for _ in $(seq "$1"); do
|
||||
for _ in $(seq "$iter"); do
|
||||
rand="$(( (RANDOM % max_index) + 1 ))"
|
||||
secret_share "$rand"
|
||||
|
||||
p_data_s+=( "$rand" )
|
||||
p_data_0+=( "$(patient_pref $share_0)" )
|
||||
p_data_1+=( "$(patient_pref $share_1)" )
|
||||
p_data_2+=( "$(patient_pref $share_2)" )
|
||||
done
|
||||
|
||||
for _ in $(seq "$1"); do
|
||||
rand="$(( (RANDOM % max_index) + 1 ))"
|
||||
secret_share "$rand"
|
||||
t_data_s=( $(shuf -e "${p_data_s[@]}") )
|
||||
|
||||
for i in $(seq 0 "$(( iter - 1 ))"); do
|
||||
secret_share "${t_data_s[$i]}"
|
||||
|
||||
t_data_0+=( "$(therapist_pref $share_0)" )
|
||||
t_data_1+=( "$(therapist_pref $share_1)" )
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
MACHINE="$1"
|
||||
shift
|
||||
cd MP-SPDZ
|
||||
"./$MACHINE" "$@"
|
||||
|
||||
for i in $(seq 0 2); do
|
||||
eval ".//semi-party.x -N 3 -p $i gale_shapley > ../out-p$i.txt 2>&1 &"
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue