fork download
  1. ; Simulation of parts production and inspection
  2.  
  3. ; PARAMETERS
  4. ; 10% parts are type B, 90% type A
  5.  
  6. GENERATE 10,0 ; Parts created every 10 minutes (mean interarrival time 10)
  7. ASSIGN 1, RND ; Assign a random number to decide part type
  8.  
  9. ; Determine part type based on random number
  10. TEST L RND(1,100) LE 10 ; 10% chance for part B
  11. TRANSFER LE 10, PART_B ; If <= 10, part B
  12. TRANSFER GT 10, PART_A ; Else part A
  13.  
  14. PART_A:
  15. SEIZE INSPECTOR_A
  16. ADVANCE 6, 2 ; Inspection time for type A: 6 +- 2 minutes (uniform)
  17. TEST L RND(1,100) LE 10 ; 10% rejection chance
  18. TRANSFER LE 10, REJECTED_A
  19. RELEASE INSPECTOR_A
  20. TERMINATE 1
  21.  
  22. PART_B:
  23. SEIZE INSPECTOR_B
  24. ADVANCE 10, 2 ; Inspection time for type B: 10 +- 2 minutes (uniform)
  25. TEST L RND(1,100) LE 10 ; 10% rejection chance
  26. TRANSFER LE 10, REJECTED_B
  27. RELEASE INSPECTOR_B
  28. TERMINATE 1
  29.  
  30. REJECTED_A:
  31. ; Logic for rejected A parts (optional)
  32. RELEASE INSPECTOR_A
  33. TERMINATE 1
  34.  
  35. REJECTED_B:
  36. ; Logic for rejected B parts (optional)
  37. RELEASE INSPECTOR_B
  38. TERMINATE 1
  39.  
  40. START 100 ; Simulate 100 parts
  41. END
  42.  
Success #stdin #stdout #stderr 0.01s 5320KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Error: near line 1: near "Simulation": syntax error