A | B | |
---|---|---|
A | 10, 10 | 0, 0 |
B | 0, 0 | 10, 10 |
//Here we define the payoffs of the coordination game
coord_pay=10;
miscoord_pay=0;
//Input variables
input_A=-99;
//computed variables
payoff=-99;
input_A_other=subjects.find(same(Group) & not(same(Subject)), input_A);
if(input_A_other+input_A==2 | input_A_other+input_A==0){//coordination achieved
payoff=coord_pay;
}else{//coordination not achieved
payoff=miscoord_pay;
}
tokens_sent_proposer=subjects.find(same(Group) & Proposer==1,tokens_sent);
if(Proposer==1){
accept_other=subjects.find(same(Group) & Proposer==0, accept);
Payoff=(Endowment-tokens_sent)*accept_other;
}else{
Payoff=tokens_sent_proposer*accept;
}
RECORDS.new{
Period=:Period;
Group=:Group;
Sent=:tokens_sent;
Accept=:accept_other;
}
RECORDS.new{
Period=:Period;
Group=:Group;
Sent=:tokens_sent;
Accept=:accept_other;
}
//retrieve values from RECORDS
Offer=RECORDS.find(same(Group) & same(Period), Sent);
Accept=RECORDS.find(same(Group) & same(Period), Accept);
//compute payoffs
if(Proposer==1){
Payoff=(Endowment-Offer)*Accept;
}else{
Payoff=Offer*Accept;
}
Choice of the other | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | |
Your choice |
A z-Tree course: Introduction to Experiments in Economics
Matteo Ploner