# HG changeset patch # User mmarzolla # Date 1389129833 0 # Node ID 480c265afea42a08f174db61f8ea971261e31724 # Parent a45ef706c9b41894e01b1c2d00cd172c7ccb12e2 Added test case diff -r a45ef706c9b4 -r 480c265afea4 main/queueing/inst/qnos.m --- a/main/queueing/inst/qnos.m Tue Jan 07 12:46:57 2014 +0000 +++ b/main/queueing/inst/qnos.m Tue Jan 07 21:23:53 2014 +0000 @@ -202,3 +202,15 @@ %! R_s = dot(R,V) # System response time %! N = sum(Q) # Average number in system +%!test +%! # Example 7.4 p. 287 Bolch et al. +%! S = [ 0.04 0.03 0.06 0.05 ]; +%! P = [ 0 0.5 0.5 0; 1 0 0 0; 0.6 0 0 0; 1 0 0 0 ]; +%! lambda = [0 0 0 4]; +%! V=qnosvisits(P,lambda); +%! k = [ 3 2 4 1 ]; +%! [U R Q X] = qnos( sum(lambda), S, V ); +%! assert( X, [20 10 10 4], 1e-4 ); +%! assert( U, [0.8 0.3 0.6 0.2], 1e-2 ); +%! assert( R, [0.2 0.043 0.15 0.0625], 1e-3 ); +%! assert( Q, [4, 0.429 1.5 0.25], 1e-3 );