You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.5 KiB

  1. // Stochastic Job Scheduling, based on []
  2. // Encoding by Junges & Quatmann
  3. // RWTH Aachen University
  4. // Please cite Quatmann et al: Multi-objective Model Checking of Markov Automata
  5. ma
  6. const double x_j1 = 1.0;
  7. const double x_j2 = 2.0;
  8. const double x_j3 = 3.0;
  9. formula is_running = r_j1 + r_j2 + r_j3 > 0;
  10. formula num_finished = f_j1 + f_j2 + f_j3;
  11. module main
  12. r_j1 : [0..1];
  13. r_j2 : [0..1];
  14. r_j3 : [0..1];
  15. f_j1 : [0..1];
  16. f_j2 : [0..1];
  17. f_j3 : [0..1];
  18. <> (r_j1 = 1) -> x_j1 : (r_j1' = 0) & (r_j2' = 0) & (r_j3' = 0) & (f_j1' = 1);
  19. <> (r_j2 = 1) -> x_j2 : (r_j1' = 0) & (r_j2' = 0) & (r_j3' = 0) & (f_j2' = 1);
  20. <> (r_j3 = 1) -> x_j3 : (r_j1' = 0) & (r_j2' = 0) & (r_j3' = 0) & (f_j3' = 1);
  21. [] (!is_running) & (num_finished = 2) & (f_j1 = 0) -> 1: (r_j1' = 1);
  22. [] (!is_running) & (num_finished = 2) & (f_j2 = 0) -> 1: (r_j2' = 1);
  23. [] (!is_running) & (num_finished = 2) & (f_j3 = 0) -> 1: (r_j3' = 1);
  24. [] (!is_running) & (num_finished <= 1) & (f_j1 = 0) & (f_j2 = 0) -> 1: (r_j1' = 1) & (r_j2' = 1);
  25. [] (!is_running) & (num_finished <= 1) & (f_j1 = 0) & (f_j3 = 0) -> 1: (r_j1' = 1) & (r_j3' = 1);
  26. [] (!is_running) & (num_finished <= 1) & (f_j2 = 0) & (f_j3 = 0) -> 1: (r_j2' = 1) & (r_j3' = 1);
  27. endmodule
  28. init
  29. r_j1 = 0 &
  30. r_j2 = 0 &
  31. r_j3 = 0 &
  32. f_j1 = 0 &
  33. f_j2 = 0 &
  34. f_j3 = 0
  35. endinit
  36. label "all_jobs_finished" = num_finished=3;
  37. label "half_of_jobs_finished" = num_finished=2;
  38. label "one_job_finished" = num_finished=1;
  39. label "slowest_before_fastest" = f_j1=1 & f_j3=0;
  40. rewards "avg_waiting_time"
  41. true : (3-num_finished)/3;
  42. endrewards