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.

115 lines
3.6 KiB

  1. // Workstation cluster [HHK00]
  2. // dxp/gxn 11/01/00
  3. ctmc
  4. const int N; // Number of workstations in each cluster
  5. const int left_mx = N; // Number of work stations in left cluster
  6. const int right_mx = N; // Number of work stations in right cluster
  7. // Failure rates
  8. const double ws_fail = 1/500; // Single workstation: average time to fail = 500 hrs
  9. const double switch_fail = 1/4000; // Switch: average time to fail = 4000 hrs
  10. const double line_fail = 1/5000; // Backbone: average time to fail = 5000 hrs
  11. // Left cluster
  12. module Left
  13. left_n : [0..left_mx] init left_mx; // Number of workstations operational
  14. left : bool; // Being repaired?
  15. [startLeft] !left & (left_n<left_mx) -> 1 : (left'=true);
  16. [repairLeft] left & (left_n<left_mx) -> 1 : (left'=false) & (left_n'=left_n+1);
  17. [] (left_n>0) -> ws_fail*left_n : (left_n'=left_n-1);
  18. endmodule
  19. // Right cluster
  20. module Right = Left[left_n=right_n,
  21. left=right,
  22. left_mx=right_mx,
  23. startLeft=startRight,
  24. repairLeft=repairRight ]
  25. endmodule
  26. // Repair unit
  27. module Repairman
  28. r : bool; // Repairing?
  29. [startLeft] !r -> 10 : (r'=true); // Inspect Left
  30. [startRight] !r -> 10 : (r'=true); // Inspect Right
  31. [startToLeft] !r -> 10 : (r'=true); // Inspect ToLeft
  32. [startToRight] !r -> 10 : (r'=true); // Inspect ToRight
  33. [startLine] !r -> 10 : (r'=true); // Inspect Line
  34. [repairLeft] r -> 2 : (r'=false); // Repair Left
  35. [repairRight] r -> 2 : (r'=false); // Repair Right
  36. [repairToLeft] r -> 0.25 : (r'=false); // Repair ToLeft
  37. [repairToRight] r -> 0.25 : (r'=false); // Repair ToRight
  38. [repairLine] r -> 0.125 : (r'=false); // Repair Line
  39. endmodule
  40. // Line/backbone
  41. module Line
  42. line : bool; // Being repaired?
  43. line_n : bool init true; // Working?
  44. [startLine] !line & !line_n -> 1 : (line'=true);
  45. [repairLine] line & !line_n -> 1 : (line'=false) & (line_n'=true);
  46. [] line_n -> line_fail : (line_n'=false);
  47. endmodule
  48. // Left switch
  49. module ToLeft = Line[line=toleft,
  50. line_n=toleft_n,
  51. line_fail=switch_fail,
  52. startLine=startToLeft,
  53. repairLine=repairToLeft ]
  54. endmodule
  55. // Right switch
  56. module ToRight = Line[line=toright,
  57. line_n=toright_n,
  58. line_fail=switch_fail,
  59. startLine=startToRight,
  60. repairLine=repairToRight ]
  61. endmodule
  62. // Formulas + labels
  63. // Minimum QoS requires 3/4 connected workstations operational
  64. const int k = floor(0.75*N);
  65. // left_operational_i : left_n>=i & toleft_n
  66. // right_operational_i : right_n>=i & toright_n
  67. // operational_i : (left_n+right_n)>=i & toleft_n & line_n & toright_n
  68. // minimum_k : left_operational_k | right_operational_k | operational_k
  69. formula minimum = (left_n>=k & toleft_n) |
  70. (right_n>=k & toright_n) |
  71. ((left_n+right_n)>=k & toleft_n & line_n & toright_n);
  72. label "minimum" = (left_n>=k & toleft_n) | (right_n>=k & toright_n) | ((left_n+right_n)>=k & toleft_n & line_n & toright_n);
  73. // premium = minimum_N
  74. label "premium" = (left_n>=left_mx & toleft_n) | (right_n>=right_mx & toright_n) | ((left_n+right_n)>=left_mx & toleft_n & line_n & toright_n);
  75. // Reward structures
  76. // Percentage of operational workstations stations
  77. rewards "percent_op"
  78. true : 100*(left_n+right_n)/(2*N);
  79. endrewards
  80. // Time that the system is not delivering at least minimum QoS
  81. rewards "time_not_min"
  82. !minimum : 1;
  83. endrewards
  84. // Number of repairs
  85. rewards "num_repairs"
  86. [repairLeft] true : 1;
  87. [repairRight] true : 1;
  88. [repairToLeft] true : 1;
  89. [repairToRight] true : 1;
  90. [repairLine] true : 1;
  91. endrewards