mdp
rewards
[time] l<4 : 1;
endrewards
const int N=20;
const int K;
const double old = 1/4;
const double new = (1-old);
const int CONSEC = 2;
const int TRANSTIME = 1;
const int LONGWAIT = 60;
const int TIME_MAX_X = 60;
const int TIME_MAX_Z = 1;
const int MAXCOLL = 10;
formula ip_mess = ip;
module host0
x : [0..TIME_MAX_X];
coll : [0..MAXCOLL];
probes : [0..K];
mess : [0..1];
ip : [1..2];
l : [0..4] init 1;
[reset] l=0 -> (l'=1);
[rec0] (l=1) -> true;
[rec1] (l=1) -> true;
[host] l=1 -> 1/3*old : (l'=2) & (ip'=1) & (x'=0)
+ 1/3*old : (l'=2) & (ip'=1) & (x'=1)
+ 1/3*old : (l'=2) & (ip'=1) & (x'=2)
+ 1/3*new : (l'=2) & (ip'=2) & (x'=0)
+ 1/3*new : (l'=2) & (ip'=2) & (x'=1)
+ 1/3*new : (l'=2) & (ip'=2) & (x'=2);
[time] l=1 & coll=MAXCOLL & x<LONGWAIT -> (x'=min(x+1,TIME_MAX_X));
[host] l=1 & coll=MAXCOLL & x=LONGWAIT -> 1/3*old : (l'=2) & (ip'=1) & (x'=0)
+ 1/3*old : (l'=2) & (ip'=1) & (x'=1)
+ 1/3*old : (l'=2) & (ip'=1) & (x'=2)
+ 1/3*new : (l'=2) & (ip'=2) & (x'=0)
+ 1/3*new : (l'=2) & (ip'=2) & (x'=1)
+ 1/3*new : (l'=2) & (ip'=2) & (x'=2);
[time] l=2 & x<2 -> (x'=min(x+1,2));
[send1] l=2 & ip=1 & x=2 & probes<K -> (x'=0) & (probes'=probes+1);
[send2] l=2 & ip=2 & x=2 & probes<K -> (x'=0) & (probes'=probes+1);
[host] l=2 & x=2 & probes=K -> (l'=3) & (probes'=0) & (coll'=0) & (x'=0);
[rec0] l=2 & ip!=0 -> (l'=l);
[rec1] l=2 & ip!=1 -> (l'=l);
[rec1] l=2 & ip=1 -> (l'=0) & (coll'=min(coll+1,MAXCOLL)) & (x'=0) & (probes'=0);
[time] l=3 & mess=0 & x<CONSEC -> (x'=min(x+1,TIME_MAX_X));
[rec1] l=3 & mess=0 & ip=1 -> (l'=0) & (probes'=0) & (x'=0);
[rec0] l=3 & mess=0 & ip!=0 -> (l'=l);
[rec1] l=3 & mess=0 & ip!=1 -> (l'=l);
[send1] l=3 & ip=1 & mess=1 -> (mess'=0);
[send2] l=3 & ip=2 & mess=1 -> (mess'=0);
[send1] l=3 & ip=1 & mess=0 & x=CONSEC & probes<1 -> (x'=0) & (probes'=probes+1);
[send2] l=3 & ip=2 & mess=0 & x=CONSEC & probes<1 -> (x'=0) & (probes'=probes+1);
[send1] l=3 & ip=1 & mess=0 & x=CONSEC & probes=1 -> (l'=4) & (x'=0) & (probes'=0);
[send2] l=3 & ip=2 & mess=0 & x=CONSEC & probes=1 -> (l'=4) & (x'=0) & (probes'=0);
[host] l=4 -> true;
endmodule
module timer
t : [0..2];
[send1] t=0 -> (t'=1);
[send2] t=0 -> (t'=1);
[rec0] t=0 -> (t'=2);
[rec1] t=0 -> (t'=2);
[] t>0 -> (t'=0);
[time] t=0 -> true;
[reset] t=0 -> true;
[host] t=0 -> true;
endmodule