csg
player p1 mac1 endplayer
player p2 mac2 endplayer
player p3 mac3 endplayer
const int emax;
const double q1;
const double q2=q1/2;
const double q3=q1/3;
module channel
c : bool init false;
[t1,w2,w3] true -> q1 : (c'=false) + (1-q1) : (c'=true);
[w1,t2,w3] true -> q1 : (c'=false) + (1-q1) : (c'=true);
[w1,w2,t3] true -> q1 : (c'=false) + (1-q1) : (c'=true);
[t1,t2,w3] true -> q2 : (c'=false) + (1-q2) : (c'=true);
[t1,w2,t3] true -> q2 : (c'=false) + (1-q2) : (c'=true);
[w1,t2,t3] true -> q2 : (c'=false) + (1-q2) : (c'=true);
[t1,t2,t3] true -> q3 : (c'=false) + (1-q3) : (c'=true);
endmodule
module mac1
s1 : [0..1] init 0;
e1 : [0..emax] init emax;
[w1] true -> (s1'=0);
[t1] e1>0 -> (s1'=c'?0:1) & (e1'=e1-1);
endmodule
module mac2 = mac1 [ s1=s2, e1=e2, w1=w2, t1=t2 ] endmodule
module mac3 = mac1 [ s1=s3, e1=e3, w1=w3, t1=t3 ] endmodule
rewards "r1"
s1=1 : 1;
endrewards
rewards "r2"
s2=1 : 1;
endrewards
rewards "r3"
s3=1 : 1;
endrewards
rewards "r12"
s1=1 & s2=1 : 2;
s1=1 & s2=0 : 1;
s1=0 & s2=1 : 1;
endrewards