csg
player investor1 investor1 endplayer
player investor2 investor2 endplayer
player market market endplayer
const int months;
module month
m : [0..1];
r : [0.. months];
[] m=0 & r<months & (!((i1=1 & b1=0) | i1=2) | !((i2=1 & b2=0) | i2=2)) -> (m'=1);
[] m=1 -> (m'=0) & (r'=r+1);
[] m=0 & !(r<months & (!((i1=1 & b1=0) | i1=2) | !((i2=1 & b2=0) | i2=2))) -> true;
endmodule
module investor1
i1 : [0..2];
[noinvest1] m=0 & (i1=0 | (i1=1 & b1=1)) & r<months -> (i1'=0);
[invest1] m=0 & (i1=0 | (i1=1 & b1=1)) & r<months -> (i1'=1);
[cashin1] m=0 & i1=1 & b1=0 -> (i1'=2);
endmodule
module investor2=investor1[i1=i2,b1=b2,noinvest1=noinvest2,invest1=invest2,cashin1=cashin2]
endmodule
module market
b1 : [0..1] init 1;
b2 : [0..1] init 1;
[nobar] m=0 & r<months & !(((i1=1 & b1=0) | i1=2) & ((i2=1 & b2=0) | i2=2)) -> (b1'=0) & (b2'=0);
[bar1] m=0 & b1=0 & r<months & !((i1=1 & b1=0) | i1=2) -> (b1'=1) & (b2'=0);
[bar2] m=0 & b2=0 & r<months & !((i2=1 & b2=0) | i2=2) -> (b2'=1) & (b1'=0);
[bar12] m=0 & b1=0 & b2=0 & r<months & !(((i1=1 & b1=0) | i1=2) & ((i2=1 & b2=0) | i2=2)) -> (b1'=1) & (b2'=1);
endmodule
module value
v : [0..10] init 5;
[] m=1 -> p/10 : (v'=min(v+1,c)) + (1-p/10) : (v'=min(max(v-1,0),c));
endmodule
module probability
p : [0..10] init 5;
[] m=1 & v<5 -> 2/3 : (p'=min(p+1,10)) + 1/3 : (p'=max(p-1,0));
[] m=1 & v=5 -> 1/2 : (p'=min(p+1,10)) + 1/2 : (p'=max(p-1,0));
[] m=1 & v>5 -> 1/3 : (p'=min(p+1,10)) + 2/3 : (p'=max(p-1,0));
endmodule
module cap
c : [0..10] init 10;
[] m=1 -> 1/2 : (c'=max(c-1,0)) + 1/2 : (c'=c);
endmodule
label "finished1" = m=0 & (i1=2 | ((i1=0 | i1=1 & b1=1) & r=months));
label "finished2" = m=0 & (i2=2 | ((i2=0 | i2=1 & b2=1) & r=months));
label "finished12" = m=0 & (i1=2 | ((i1=0 | i1=1 & b1=1) & r=months)) & (i2=2 | ((i2=0 | i2=1 & b2=1) & r=months));
rewards "profit1"
[cashin1] m=0 & i1=1 & b1=0 & !(i2=1 & b2=0) : v;
[cashin1] m=0 & i1=1 & b1=0 & i2=1 & b2=0 : v*0.75;
endrewards
rewards "profit12"
[cashin1] m=0 & i1=1 & b1=0 & !(i2=1 & b2=0) : v;
[cashin1] m=0 & i1=1 & b1=0 & i2=1 & b2=0 : v*0.75;
[cashin2] m=0 & i2=1 & b2=0 & !(i1=1 & b1=0) : v;
[cashin2] m=0 & i2=1 & b2=0 & i1=1 & b1=0 : v*0.75;
endrewards
rewards "profit1_lc"
[cashin1] m=0 & i1=1 & b1=0 & !(i2=1 & b2=0) : v*(1 + (r-1)/months);
[cashin1] m=0 & i1=1 & b1=0 & i2=1 & b2=0 : v*(1 + (r-1)/months)*0.75;
endrewards
rewards "profit12_lc"
[cashin1] m=0 & i1=1 & b1=0 & !(i2=1 & b2=0) : v*(1 + (r-1)/months);
[cashin1] m=0 & i1=1 & b1=0 & i2=1 & b2=0 : v*(1 + (r-1)/months)*0.75;
[cashin2] m=0 & i2=1 & b2=0 & !(i1=1 & b1=0) : v*(1 + (r-1)/months);
[cashin2] m=0 & i2=1 & b2=0 & i1=1 & b1=0 : v*(1 + (r-1)/months)*0.75;
endrewards
rewards "profit1_mc"
[cashin1] m=0 & i1=1 & b1=0 & !(i2=1 & b2=0) : v*(1 + (r-1)/months)*(1 + mod(r,4)/3);
[cashin1] m=0 & i1=1 & b1=0 & i2=1 & b2=0 : v*(1 + (r-1)/months)*(1 + mod(r,4)/3)*0.75;
endrewards
rewards "profit12_mc"
[cashin1] m=0 & i1=1 & b1=0 & !(i2=1 & b2=0) : v*(1 + (r-1)/months)*(1 + mod(r,4)/3);
[cashin1] m=0 & i1=1 & b1=0 & i2=1 & b2=0 : v*(1 + (r-1)/months)*(1 + mod(r,4)/3)*0.75;
[cashin2] m=0 & i2=1 & b2=0 & !(i1=1 & b1=0) : v*(1 + (r-1)/months)*(1 + mod(r,4)/3);
[cashin2] m=0 & i2=1 & b2=0 & i1=1 & b1=0 : v*(1 + (r-1)/months)*(1 + mod(r,4)/3)*0.75;
endrewards
rewards "profit1_ec"
[cashin1] m=0 & i1=1 & b1=0 & !(i2=1 & b2=0) : v*(1 + months/(5*(r+1)));
[cashin1] m=0 & i1=1 & b1=0 & i2=1 & b2=0 : v*(1 + months/(5*(r+1)))*0.75;
endrewards
rewards "profit12_ec"
[cashin1] m=0 & i1=1 & b1=0 & !(i2=1 & b2=0) : v*(1 + months/(5*(r+1)));
[cashin1] m=0 & i1=1 & b1=0 & i2=1 & b2=0 : v*(1 + months/(5*(r+1)))*0.75;
[cashin2] m=0 & i2=1 & b2=0 & !(i1=1 & b1=0) : v*(1 + months/(5*(r+1)));
[cashin2] m=0 & i2=1 & b2=0 & i1=1 & b1=0 : v*(1 + months/(5*(r+1)))*0.75;
endrewards