ࡱ> h size distribution; A = .1, .2, .3, .4; ! Number of batches arriving per day; LMDA = 1.5; ! Number of servers; S = 7; ! Number of customers a server can process per day; MU = 2; ENDDATA ! LAST = number of STATES; LAST = @SIZE( STATE); ! Balance equations for states where the number of customers in the system is less than or equal to the number of servers; @FOR( STATE( N)| N #LE# S: P( N) * (( N - 1)* MU + LMDA) = P( N + 1) * MU * N + LMDA * @SUM( BSIZE( I)| I #LT# N: A( I) * P( N - I)) ); ! Balance equations for states where number in system is greater than the number of servers, but less than the limit; @FOR( STATE( N)| N #GT# S #AND# N #LT# LAST: P( N) * ( S * MU + LMDA) = P( N + 1) * MU * S + LMDA * @SUM( BSIZE( I)| I #LT# N: A( I) * P( N - I)) ); ! Probabilities must sum to 1; @SUM( STATE: P) = 1; END MODEL: ! Model of a queue with arrivals in batches. In this particular example, arrivals may show up in batches of 1, 2, 3, or 4 units; SETS: ! Look at enough states so that P( i) for large i is effectively zero, where P( i) is the steady state probability of i customers in the system; STATE/ 1..41/: P; ! Potential batch sizes are 1, 2, 3 or 4 customers, and A( i) = the probability that an arriving batch contains i customers; BSIZE/ 1..4/: A; ENDSETS DATA: ! BatcRoot EntryCONTENTS Root Entry*0_^@qe Contents   !" P( N + 1) * MU * N + \par LMDA * \cf1 @SUM\cf2 ( BSIZE( I)| I #LT# N: A( I) \par * P( N - I)) \par ); \par \par \cf3 ! Balance equations for states where number in \par system is greater than the number of servers, but \par less than the limit;\cf2 \par \cf1 @FOR\cf2 ( STATE( N)| N #GT# S #AND# N #LT# LAST: \par P( N) * ( S * MU + LMDA) = \par P( N + 1) * MU * S + \par LMDA * \cf1 @SUM\cf2 ( BSIZE( I)| I #LT# N: A( I) * \par P( N - I)) \par ); \par \par \cf3 ! Probabilities must sum to 1;\cf2 \par \cf1 @SUM\cf2 ( STATE: P) = 1; \par \par \cf1 END\cf2 \par \par } {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Courier New;}} {\colortbl ;\red0\green0\blue255;\red0\green0\blue0;\red0\green175\blue0;} \viewkind4\uc1\pard\cf1\f0\fs20 MODEL\cf2 : \par \cf3 ! Model of a queue with arrivals in batches. In \par this particular example, arrivals may show up in \par batches of 1, 2, 3, or 4 units;\cf2 \par \par \cf1 SETS\cf2 : \par \cf3 ! Look at enough states so that P( i) for large i \par is effectively zero, where P( i) is the steady \par state probability of i customers in the system;\cf2 \par STATE/ 1..41/: P; \par \par \cf3 ! Potential batch sizes are 1, 2, 3 or 4 customers, \par and A( i) = the probability that an arriving batch \par contains i customers;\cf2 \par BSIZE/ 1..4/: A; \par \cf1 ENDSETS\cf2 \par \par \cf1 DATA\cf2 : \par \cf3 ! Batch size distribution;\cf2 \par A = .1, .2, .3, .4; \par \cf3 ! Number of batches arriving per day;\cf2 \par LMDA = 1.5; \par \cf3 ! Number of servers;\cf2 \par S = 7; \par \cf3 ! Number of customers a server can \par process per day;\cf2 \par MU = 2; \par \cf1 ENDDATA\cf2 \par \par \cf3 ! LAST = number of STATES;\cf2 \par LAST = \cf1 @SIZE\cf2 ( STATE); \par \par \cf3 ! Balance equations for states where the number of \par customers in the system is less than or equal to \par the number of servers;\cf2 \par \cf1 @FOR\cf2 ( STATE( N)| N #LE# S: \par P( N) * (( N - 1)* MU + LMDA) = \par