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.

111 lines
2.3 KiB

  1. // kanban manufacturing example [CT96]
  2. // dxp/gxn 3/2/00
  3. ctmc
  4. // number of tokens
  5. const int t = 1;
  6. // rates
  7. const double in1 = 1.0;
  8. const double out4 = 0.9;
  9. const double synch123 = 0.4;
  10. const double synch234 = 0.5;
  11. const double back = 0.3;
  12. const double redo1 = 0.36;
  13. const double redo2 = 0.42;
  14. const double redo3 = 0.39;
  15. const double redo4 = 0.33;
  16. const double ok1 = 0.84;
  17. const double ok2 = 0.98;
  18. const double ok3 = 0.91;
  19. const double ok4 = 0.77;
  20. module k1
  21. w1 : [0..t];
  22. x1 : [0..t];
  23. y1 : [0..t];
  24. z1 : [0..t];
  25. [in] (w1<t) & (x1<t) -> in1 : (w1'=w1+1) & (x1'=x1+1);
  26. [] (x1>0) & (y1<t) -> redo1 : (x1'=x1-1) & (y1'=y1+1);
  27. [] (x1>0) & (z1<t) -> ok1 : (x1'=x1-1) & (z1'=z1+1);
  28. [] (y1>0) & (x1<t) -> back : (y1'=y1-1) & (x1'=x1+1);
  29. [s1] (z1>0) & (w1>0) -> synch123 : (z1'=z1-1) & (w1'=w1-1);
  30. endmodule
  31. module k2
  32. w2 : [0..t];
  33. x2 : [0..t];
  34. y2 : [0..t];
  35. z2 : [0..t];
  36. [s1] (w2<t) & (x2<t) -> 1 : (w2'=w2+1) & (x2'=x2+1);
  37. [] (x2>0) & (y2<t) -> redo2 : (x2'=x2-1) & (y2'=y2+1);
  38. [] (x2>0) & (z2<t) -> ok2 : (x2'=x2-1) & (z2'=z2+1);
  39. [] (y2>0) & (x2<t) -> back : (y2'=y2-1) & (x2'=x2+1);
  40. [s2] (z2>0) & (w2>0) -> 1 : (z2'=z2-1) & (w2'=w2-1);
  41. endmodule
  42. module k3
  43. w3 : [0..t];
  44. x3 : [0..t];
  45. y3 : [0..t];
  46. z3 : [0..t];
  47. [s1] (w3<t) & (x3<t) -> 1 : (w3'=w3+1) & (x3'=x3+1);
  48. [] (x3>0) & (y3<t) -> redo3 : (x3'=x3-1) & (y3'=y3+1);
  49. [] (x3>0) & (z3<t) -> ok3 : (x3'=x3-1) & (z3'=z3+1);
  50. [] (y3>0) & (x3<t) -> back : (y3'=y3-1) & (x3'=x3+1);
  51. [s2] (z3>0) & (w3>0) -> 1 : (z3'=z3-1) & (w3'=w3-1);
  52. endmodule
  53. module k4
  54. w4 : [0..t];
  55. x4 : [0..t];
  56. y4 : [0..t];
  57. z4 : [0..t];
  58. [s2] (w4<t) & (x4<t) -> synch234 : (w4'=w4+1) & (x4'=x4+1);
  59. [] (x4>0) & (y4<t) -> redo4 : (x4'=x4-1) & (y4'=y4+1);
  60. [] (x4>0) & (z4<t) -> ok4 : (x4'=x4-1) & (z4'=z4+1);
  61. [] (y4>0) & (x4<t) -> back : (y4'=y4-1) & (x4'=x4+1);
  62. [] (z4>0) & (w4>0) -> out4 : (z4'=z4-1) & (w4'=w4-1);
  63. endmodule
  64. // reward structures
  65. // tokens in cell1
  66. rewards "tokens_cell1"
  67. true : x1+y1+z1;
  68. endrewards
  69. // tokens in cell2
  70. rewards "tokens_cell2"
  71. true : x2+y2+z2;
  72. endrewards
  73. // tokens in cell3
  74. rewards "tokens_cell3"
  75. true : x3+y3+z3;
  76. endrewards
  77. // tokens in cell4
  78. rewards "tokens_cell4"
  79. true : x4+y4+z4;
  80. endrewards
  81. // throughput of the system
  82. rewards "throughput"
  83. [in] true : 1;
  84. endrewards