changeset 10026:aaedeb1a5ea8 octave-forge

replaced usage() with error()
author mmarzolla
date Fri, 13 Apr 2012 12:20:21 +0000
parents 0602f16722a6
children 949959857dc7
files main/queueing/inst/ctmc.m main/queueing/inst/ctmc_bd.m main/queueing/inst/ctmc_exps.m main/queueing/inst/ctmc_fpt.m main/queueing/inst/ctmc_mtta.m main/queueing/inst/ctmc_taexps.m main/queueing/inst/dtmc.m main/queueing/inst/dtmc_bd.m main/queueing/inst/dtmc_exps.m main/queueing/inst/dtmc_mtta.m main/queueing/inst/population_mix.m main/queueing/inst/qnammm.m main/queueing/inst/qnclosedab.m main/queueing/inst/qnclosedbsb.m main/queueing/inst/qnclosedgb.m main/queueing/inst/qnclosedmultimva.m main/queueing/inst/qnclosedmultimvaapprox.m main/queueing/inst/qnclosedpb.m main/queueing/inst/qnclosedsinglemva.m main/queueing/inst/qnclosedsinglemvaapprox.m main/queueing/inst/qnclosedsinglemvald.m main/queueing/inst/qncmva.m main/queueing/inst/qnconvolution.m main/queueing/inst/qnconvolutionld.m main/queueing/inst/qnjackson.m main/queueing/inst/qnmarkov.m main/queueing/inst/qnmg1.m main/queueing/inst/qnmh1.m main/queueing/inst/qnmix.m main/queueing/inst/qnmknode.m main/queueing/inst/qnmm1.m main/queueing/inst/qnmm1k.m main/queueing/inst/qnmminf.m main/queueing/inst/qnmmm.m main/queueing/inst/qnmmmk.m main/queueing/inst/qnmvablo.m main/queueing/inst/qnopenab.m main/queueing/inst/qnopenbsb.m main/queueing/inst/qnopenmulti.m main/queueing/inst/qnopensingle.m main/queueing/inst/qnsolve.m main/queueing/inst/qnvisits.m
diffstat 42 files changed, 259 insertions(+), 258 deletions(-) [+]
line wrap: on
line diff
--- a/main/queueing/inst/ctmc.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/ctmc.m	Fri Apr 13 12:20:21 2012 +0000
@@ -86,7 +86,7 @@
   [N err] = ctmc_check_Q(Q);
 
   ( N>0 ) || \
-      usage(err);
+      error(err);
 
   if ( nargin == 1 ) # steady-state analysis
 
@@ -112,10 +112,10 @@
   else # transient analysis
 
     ( isscalar(t) && t>=0 ) || \
-        usage("t must be a scalar >= 0");
+        error("t must be a scalar >= 0");
 
     ( isvector(p0) && length(p0) == N && all(p0>=0) && abs(sum(p0)-1.0)<N*eps ) || \
-        usage( "p0 must be a probability vector" );   
+        error( "p0 must be a probability vector" );   
 
     p0 = p0(:)'; # make p0 a row vector
 
--- a/main/queueing/inst/ctmc_bd.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/ctmc_bd.m	Fri Apr 13 12:20:21 2012 +0000
@@ -74,15 +74,15 @@
   endif
 
   ( isvector( birth ) && isvector( death ) ) || \
-      usage( "birth and death must be vectors" );
+      error( "birth and death must be vectors" );
   birth = birth(:); # make birth a column vector
   death = death(:); # make death a column vector
   size_equal( birth, death ) || \
-      usage( "birth and death rates must have the same length" );
+      error( "birth and death rates must have the same length" );
   all( birth >= 0 ) || \
-      usage( "birth rates must be >= 0" );
+      error( "birth rates must be >= 0" );
   all( death >= 0 ) || \
-      usage( "death rates must be >= 0" );
+      error( "death rates must be >= 0" );
 
   ## builds the infinitesimal generator matrix
   Q = diag( birth, 1 ) + diag( death, -1 );
--- a/main/queueing/inst/ctmc_exps.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/ctmc_exps.m	Fri Apr 13 12:20:21 2012 +0000
@@ -79,7 +79,7 @@
   [N err] = ctmc_check_Q(Q);
 
   (N>0) || \
-      usage(err);
+      error(err);
 
   if ( nargin == 2 )
     p = varargin{1};
@@ -89,14 +89,14 @@
   endif
 
   ( isvector(p) && length(p) == size(Q,1) && all(p>=0) && abs(sum(p)-1.0)<epsilon ) || \
-      usage( "p must be a probability vector" );
+      error( "p must be a probability vector" );
 
   p = p(:)'; # make p a row vector
 
   if ( nargin == 3 ) # non-absorbing case
     if ( isscalar(t) )
       (t >= 0 ) || \
-	  usage( "t must be >= 0" );
+	  error( "t must be >= 0" );
       ## F(x) are the transient state occupancy probabilities at time x
       ## F(x) = p*expm(Q*x) (see function ctmc()).
       F = @(x) (p*expm(Q*x));
@@ -104,7 +104,7 @@
     else
       ## FIXME: deprecate this?
       ( isvector(t) && abs(t(1)) < epsilon ) || \
-	  usage( "t must be a vector, and t(1) must be 0.0" );
+	  error( "t must be a vector, and t(1) must be 0.0" );
       t = t(:)'; # make tt a row vector
       ff = @(x,t) (x(:)'*Q+p);
       fj = @(x,t) (Q);
--- a/main/queueing/inst/ctmc_fpt.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/ctmc_fpt.m	Fri Apr 13 12:20:21 2012 +0000
@@ -89,8 +89,8 @@
       endfor
     endfor
   else
-    (isscalar(i) && i>=1 && j<=N) || usage("i must be an integer in the range 1..%d", N);
-    (isvector(j) && all(j>=1) && all(j<=N)) || usage("j must be an integer or vector with elements in 1..%d", N);
+    (isscalar(i) && i>=1 && j<=N) || error("i must be an integer in the range 1..%d", N);
+    (isvector(j) && all(j>=1) && all(j<=N)) || error("j must be an integer or vector with elements in 1..%d", N);
     j = j(:)'; # make j a row vector
     Q(j,:) = 0; # make state(s) j absorbing
     p0 = zeros(1,N); p0(i) = 1;
--- a/main/queueing/inst/ctmc_mtta.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/ctmc_mtta.m	Fri Apr 13 12:20:21 2012 +0000
@@ -71,10 +71,10 @@
   [N err] = ctmc_check_Q(Q);
 
   (N>0) || \
-      usage(err);
+      error(err);
 
   ( isvector(p) && length(p) == N && all(p>=0) && abs(sum(p)-1.0)<epsilon ) || \
-      usage( "p must be a probability vector" );
+      error( "p must be a probability vector" );
 
   L = ctmc_exps(Q,p);
   t = sum(L);
--- a/main/queueing/inst/ctmc_taexps.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/ctmc_taexps.m	Fri Apr 13 12:20:21 2012 +0000
@@ -52,12 +52,12 @@
 ## @table @var
 ##
 ## @item M
-## If this function is called with three parameters, @code{@var{M}(i)}
-## is the expected fraction of the interval @math{[0,t]} spent in state
-## @math{i} assuming that the state occupancy probability at time zero
-## is @var{p}. If this function is called with two parameters,
-## @code{@var{M}(i)} is the expected fraction of time until absorption
-## spent in state @math{i}.
+## When called with three arguments, @code{@var{M}(i)} is the expected
+## fraction of the interval @math{[0,t]} spent in state @math{i}
+## assuming that the state occupancy probability at time zero is
+## @var{p}. When called with two arguments, @code{@var{M}(i)} is the
+## expected fraction of time until absorption spent in state @math{i};
+## in this case the mean time to absorption is @code{sum(@var{M})}.
 ##
 ## @end table
 ##
@@ -80,7 +80,7 @@
 #{
   if ( nargin == 3 ) 
     (t >= 0) || \
-	usage( "t must be >= 0" );
+	error( "t must be >= 0" );
     F = @(x) (p*expm(Q*x));
     M = quadv(F,0,t) / t;
   else 
--- a/main/queueing/inst/dtmc.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/dtmc.m	Fri Apr 13 12:20:21 2012 +0000
@@ -84,7 +84,7 @@
   [N err] = dtmc_check_P(P);
   
   ( N>0 ) || \
-      usage( err );
+      error( err );
 
   if ( nargin == 1 ) # steady-state analysis
     A = P-eye(N);
@@ -96,10 +96,10 @@
     p = b/A;
   else # transient analysis
     ( isscalar(n) && n>=0 ) || \
-	usage( "n must be >=0" );
+	error( "n must be >=0" );
 
     ( isvector(p0) && length(p0) == N && all(p0>=0) && abs(sum(p0)-1.0)<N*eps ) || \
-        usage( "p0 must be a probability vector" );   
+        error( "p0 must be a probability vector" );   
 
     p0 = p0(:)'; # make p0 a row vector
 
--- a/main/queueing/inst/dtmc_bd.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/dtmc_bd.m	Fri Apr 13 12:20:21 2012 +0000
@@ -75,17 +75,17 @@
   endif
 
   ( isvector( b ) && isvector( d ) ) || \
-      usage( "birth and death must be vectors" );
+      error( "birth and death must be vectors" );
   b = b(:); # make b a column vector
   d = d(:); # make d a column vector
   size_equal( b, d ) || \
-      usage( "birth and death vectors must have the same length" );
+      error( "birth and death vectors must have the same length" );
   all( b >= 0 ) || \
-      usage( "birth probabilities must be >= 0" );
+      error( "birth probabilities must be >= 0" );
   all( d >= 0 ) || \
-      usage( "death probabilities must be >= 0" );
+      error( "death probabilities must be >= 0" );
   all( ([b; 0] + [0; d]) <= 1 ) || \
-      usage( "d(i)+b(i+1) must be <= 1");
+      error( "d(i)+b(i+1) must be <= 1");
 
   P = diag( b, 1 ) + diag( d, -1 );
   P += diag( 1-sum(P,2) );
--- a/main/queueing/inst/dtmc_exps.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/dtmc_exps.m	Fri Apr 13 12:20:21 2012 +0000
@@ -74,7 +74,7 @@
   [K err] = dtmc_check_P(P);
 
   (K>0) || \
-      usage(err);
+      error(err);
 
   if ( nargin == 2 )
     p0 = varargin{1};
@@ -84,7 +84,7 @@
   endif
 
   ( isvector(p0) && length(p0) == K && all(p0>=0) && abs(sum(p0)-1.0)<epsilon ) || \
-      usage( "p0 must be a state occupancy probability vector" );
+      error( "p0 must be a state occupancy probability vector" );
 
   p0 = p0(:)'; # make p0 a row vector
 
--- a/main/queueing/inst/dtmc_mtta.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/dtmc_mtta.m	Fri Apr 13 12:20:21 2012 +0000
@@ -91,11 +91,11 @@
   [K err] = dtmc_check_P(P);
 
   (K>0) || \
-      usage(err);
+      error(err);
   
   if ( nargin == 2 )
     ( isvector(p0) && length(p0) == K && all(p0>=0) && abs(sum(p0)-1.0)<epsilon ) || \
-	usage( "p0 must be a state occupancy probability vector" );
+	error( "p0 must be a state occupancy probability vector" );
   endif
 
   ## identify transient states
--- a/main/queueing/inst/population_mix.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/population_mix.m	Fri Apr 13 12:20:21 2012 +0000
@@ -84,10 +84,10 @@
   endif
 
   isvector( population ) && all( population>=0 ) || \
-      usage( "N must be an array >=0" );
+      error( "N must be an array >=0" );
   R = length(population); # number of classes
   ( isscalar(k) && k >= 0 && k <= sum(population) ) || \
-      usage( "k must be a scalar <= %d", sum(population));
+      error( "k must be a scalar <= %d", sum(population));
   N = zeros(1, R);
   const = min(k, population);
   mp = 0;
--- a/main/queueing/inst/qnammm.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnammm.m	Fri Apr 13 12:20:21 2012 +0000
@@ -75,7 +75,7 @@
   endif
 
   ( isscalar(lambda) && isvector(mu) ) || \
-      usage( "the parameters must be vectors" );
+      error( "the parameters must be vectors" );
 
   m = length(mu); # number of servers
 
--- a/main/queueing/inst/qnclosedab.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnclosedab.m	Fri Apr 13 12:20:21 2012 +0000
@@ -69,14 +69,14 @@
     print_usage();
   endif
   ( isscalar(N) && N > 0 ) || \
-      usage( "N must be a positive integer" );
+      error( "N must be a positive integer" );
   ( isvector(D) && length(D)>0 && all( D >= 0 ) ) || \
-      usage( "D must be a vector of nonnegative floats" );
+      error( "D must be a vector of nonnegative floats" );
   if ( nargin < 3 )
     Z = 0;
   else
     ( isscalar(Z) && Z >= 0 ) || \
-        usage( "Z must be a nonnegative scalar" );
+        error( "Z must be a nonnegative scalar" );
   endif
   
   D_tot = sum(D);
--- a/main/queueing/inst/qnclosedbsb.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnclosedbsb.m	Fri Apr 13 12:20:21 2012 +0000
@@ -69,14 +69,14 @@
     print_usage();
   endif
   ( isscalar(N) && N>0 ) || \
-      usage( "N must be a positive scalar" );
+      error( "N must be a positive scalar" );
   ( isvector(D) && length(D)>0 && all(D>=0) ) || \
-      usage( "D must be a vector of nonnegative floats" );
+      error( "D must be a vector of nonnegative floats" );
   if ( nargin < 3 )
     Z = 0;
   else
     ( isscalar(Z) && Z>=0 ) || \
-        usage( "Z must be a nonnegative scalar" );
+        error( "Z must be a nonnegative scalar" );
   endif
 
   D_max = max(D);
--- a/main/queueing/inst/qnclosedgb.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnclosedgb.m	Fri Apr 13 12:20:21 2012 +0000
@@ -79,15 +79,15 @@
     print_usage();
   endif
   ( isscalar(N) && N > 0 ) || \
-      usage( "N must be >0" );
+      error( "N must be >0" );
   ( isvector(L) && length(L) > 0 && all( L >= 0 ) ) || \
-      usage( "D must be a vector >=0" );
+      error( "D must be a vector >=0" );
   L = L(:)'; # make L a row vector
   if ( nargin < 3 )
     Z = 0;
   else
     ( isscalar(Z) && (Z >= 0) ) || \
-        usage( "Z must be >=0" );
+        error( "Z must be >=0" );
   endif
   L_tot = sum(L);
   L_max = max(L);
@@ -122,9 +122,9 @@
 ## network with N customers, service demands D and think time Z. This
 ## function uses Eq. (8) and (13) from the reference paper.
 function [ Q_lower Q_upper ] = __compute_Q( N, L, Z, X_plus, X_minus )
-  isscalar(X_plus) || usage( "X_plus must be a scalar" );
-  isscalar(X_minus) || usage( "X_minus must be a scalar" );
-  ( isscalar(N) && (N>=0) ) || usage( "N is not valid" );
+  isscalar(X_plus) || error( "X_plus must be a scalar" );
+  isscalar(X_minus) || error( "X_minus must be a scalar" );
+  ( isscalar(N) && (N>=0) ) || error( "N is not valid" );
   L_tot = sum(L);
   L_max = max(L);
   M = length(L);
--- a/main/queueing/inst/qnclosedmultimva.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnclosedmultimva.m	Fri Apr 13 12:20:21 2012 +0000
@@ -27,9 +27,8 @@
 ## @cindex Mean Value Analysys (MVA)
 ## @cindex closed network, multiple classes
 ##
-## Analyze closed, multiclass queueing networks with @math{K} service
-## centers and @math{C} independent customer classes (chains) using the
-## Mean Value Analysys (MVA) algorithm. 
+## Compute steady-state performance measures for closed, multiclass
+## queueing networks using the Mean Value Analysys (MVA) algorithm.
 ##
 ## Queueing policies at service centers can be any of the following:
 ##
@@ -63,9 +62,10 @@
 ##
 ## If this function is called specifying the routing probability matrix
 ## @var{P}, then class switching @strong{is} allowed; however, in this
-## case all nodes are restricted to be fixed rate service centers or
-## delay centers: multiple-server and general load-dependent
-## centers are not supported. @end quotation
+## case all nodes are restricted to be fixed rate servers or delay
+## centers: multiple-server and general load-dependent centers are not
+## supported.
+## @end quotation
 ##
 ## @strong{INPUTS}
 ##
@@ -74,30 +74,31 @@
 ## @item N
 ## @code{@var{N}(c)} is the number of class @math{c} requests in the
 ## system; @code{@var{N}(c) @geq{} 0}. If class @math{c} has
-## no requests (@code{@var{N}(c) = 0}), then
+## no requests (@code{@var{N}(c) == 0}), then for all @var{k},
 ## @code{@var{U}(c,k) = @var{R}(c,k) = @var{Q}(c,k) = @var{X}(c,k) = 0}
-## for all @var{k}.
 ##
 ## @item S
 ## @code{@var{S}(c,k)} is the mean service time for class @math{c}
-## customers at center @math{k} (@code{@var{S}(c,k) @geq{} 0}).
-## If service time at center @math{k} is class-dependent,
-## then center #math{k} is assumed to be of type @math{-/G/1}--PS
-## (Processor Sharing).
+## customers at center @math{k} (@code{@var{S}(c,k) @geq{} 0}). If the
+## service time at center @math{k} is class-dependent, i.e., different
+## classes have different service times at center @math{k}, then center
+## @math{k} is assumed to be of type @math{-/G/1}--PS (Processor
+## Sharing).
 ## If center @math{k} is a FCFS node (@code{@var{m}(k)>1}), then the
-## service times @strong{must} be class-independent.
+## service times @strong{must} be class-independent, i.e., all classes
+## @strong{must} have the same service time.
 ##
 ## @item V
 ## @code{@var{V}(c,k)} is the average number of visits of class @math{c}
 ## customers to service center @math{k}; @code{@var{V}(c,k) @geq{} 0},
 ## default is 1.
-## @strong{If you pass this parameter, class switching is not
+## @strong{If you pass this argument, class switching is not
 ## allowed}
 ##
 ## @item P
 ## @code{@var{P}(r,i,s,j)} is the probability that a class @math{r}
 ## job completing service at center @math{i} is routed to center @math{j}
-## as a class @math{s} job. @strong{If you pass this parameter, 
+## as a class @math{s} job. @strong{If you pass this argument,
 ## class switching is allowed}.
 ##
 ## @item m
@@ -162,17 +163,17 @@
 
   ## basic sanity checks
   isvector(N) && all( N>=0 ) || \
-      usage( "N must be a vector >=0" );
+      error( "N must be a vector >=0" );
   C = length(N); ## Number of classes
   ( ndims(S) == 2 ) || \
-      usage( "S must be a matrix" );
+      error( "S must be a matrix" );
 
   if ( nargin == 2 )
     V = ones(size(S));
   endif
 
   ( ismatrix(V) && (ndims(V) == 2 || ndims(V) == 4) ) || \
-      usage("The third parametermust be a 2- or 4-dimensional matrix" );
+      error("The third argument must be a 2- or 4-dimensional matrix" );
 
   if ( ndims(V) == 2 )
     [U R Q X] = __qnclosedmultimva_nocs( N, S, V, varargin{:} );
@@ -191,34 +192,34 @@
   endif
 
   isvector(N) && all( N>=0 ) || \
-      usage( "N must be >=0" );
+      error( "N must be >=0" );
   N = N(:)'; # make N a row vector
   C = length(N); ## Number of classes
   ( ndims(S) == 2 ) || \
-      usage( "S must be a matrix" );
+      error( "S must be a matrix" );
   K = columns(S); ## Number of service centers
   size(S) == [C,K] || \
-      usage( "S size mismatch (is %dx%d, should be %dx%d)", rows(S), columns(S), C, K );
+      error( "S size mismatch (is %dx%d, should be %dx%d)", rows(S), columns(S), C, K );
   ndims(P) == 4 && size(P) == [C,K,C,K] || \
-      usage( "P size mismatch (should be %dx%dx%dx%d)",C,K,C,K );
+      error( "P size mismatch (should be %dx%dx%dx%d)",C,K,C,K );
 
   if ( nargin < 4 ) 
     m = ones(1,K);
   else
     isvector(m) || \
-        usage( "m must be a vector" );
+        error( "m must be a vector" );
     m = m(:)'; # make m a row vector
     length(m) == K || \
-        usage( "m size mismatch (should be %d, is %d)", K, length(m) );
+        error( "m size mismatch (should be %d, is %d)", K, length(m) );
   endif
 
   ## Check consistency of parameters
   all( all( S >= 0 ) ) || \
-      usage( "S must be >= 0" );
+      error( "S must be >= 0" );
   all( any(S>0,2) ) || \
-      usage( "S must contain at least a value >0 for each row" );
+      error( "S must contain at least a value >0 for each row" );
   all( all( P >= 0 ) ) || \
-      usage( "V must be >=0" );
+      error( "V must be >=0" );
 
   U = R = Q = X = zeros(C,K);
 
@@ -288,42 +289,42 @@
   endif
 
   isvector(N) && all( N>=0 ) || \
-      usage( "N must be >=0" );
+      error( "N must be >=0" );
   N = N(:)'; # make N a row vector
   C = length(N); ## Number of classes
   K = columns(S); ## Number of service centers
   size(S) == [C,K] || \
-      usage( "S size mismatch" );
+      error( "S size mismatch" );
   size(V) == [C,K] || \
-      usage( "V size mismatch" );
+      error( "V size mismatch" );
 
   if ( nargin < 4 ) 
     m = ones(1,K);
   else
     isvector(m) || \
-        usage( "m must be a vector" );
+        error( "m must be a vector" );
     m = m(:)'; # make m a row vector
     length(m) == K || \
-        usage( "m size mismatch (should be %d, is %d)", K, length(m) );
+        error( "m size mismatch (should be %d, is %d)", K, length(m) );
   endif
 
   if ( nargin < 5 )
     Z = zeros(1,C);
   else
     isvector(Z) || \
-        usage( "Z must be a vector" );
+        error( "Z must be a vector" );
     Z = Z(:)'; # make Z a row vector
     length(Z) == C || \
-	usage( "Z size mismatch (should be %d, is %d)", C, length(Z) );
+	error( "Z size mismatch (should be %d, is %d)", C, length(Z) );
   endif
 
   ## Check consistency of parameters
   all( all( S >= 0 ) ) || \
-      usage( "S must be >= 0" );
+      error( "S must be >= 0" );
   all( any(S>0,2) ) || \
-      usage( "S must contain at least a value >0 for each row" );
+      error( "S must contain at least a value >0 for each row" );
   all( all( V >= 0 ) ) || \
-      usage( "V must be >=0" );
+      error( "V must be >=0" );
 
   ## ensure that the service times for multiserver nodes
   ## are class-independent
@@ -476,7 +477,7 @@
 %! S = [1 2 3; 1 2 3];
 %! N = [1 1];
 %! V = zeros(3,2,3);
-%! fail( "qnclosedmultimva(N,S,V)", "third parameter" );
+%! fail( "qnclosedmultimva(N,S,V)", "third argument" );
 
 ## Check degenerate case (population is zero); LI servers
 %!test
--- a/main/queueing/inst/qnclosedmultimvaapprox.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnclosedmultimvaapprox.m	Fri Apr 13 12:20:21 2012 +0000
@@ -139,33 +139,33 @@
   endif
 
   isvector(N) && all( N>=0 ) || \
-      usage( "N must be a vector of positive integers" );
+      error( "N must be a vector of positive integers" );
   N = N(:)'; # make N a row vector
   C = length(N); ## Number of classes
   K = columns(S); ## Number of service centers
   size(S) == [C,K] || \
-      usage( "S size mismatch" );
+      error( "S size mismatch" );
   size(V) == [C,K] || \
-      usage( "V size mismatch" );
+      error( "V size mismatch" );
 
   if ( nargin < 4 )
     m = ones(1,K);
   else
     isvector(m) || \
-	usage( "m must be a vector");
+	error( "m must be a vector");
     m = m(:)'; # make m a row vector
     ( length(m) == K && all( m <= 1 ) ) || \
-        usage( "m must be <= 1 and have %d elements", K );
+        error( "m must be <= 1 and have %d elements", K );
   endif
 
   if ( nargin < 5 )
     Z = zeros(1,C);
   else
     isvector(Z) || \
-	usage( "Z must be a vector" );
+	error( "Z must be a vector" );
     Z = Z(:)'; # make Z a row vector
     ( length(Z) == C && all(Z >= 0 ) ) || \
-	usage( "Z must be >= 0 and have %d elements", C );
+	error( "Z must be >= 0 and have %d elements", C );
   endif
 
   if ( nargin < 6 )
@@ -178,9 +178,9 @@
 
   ## Check consistency of parameters
   all( all( S >= 0 ) ) || \
-      usage( "S contains negative values" );
+      error( "S contains negative values" );
   all( all( V >= 0 ) ) || \
-      usage( "V contains negative values" );
+      error( "V contains negative values" );
 
   ## Initialize results
   R = zeros( C, K );
--- a/main/queueing/inst/qnclosedpb.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnclosedpb.m	Fri Apr 13 12:20:21 2012 +0000
@@ -62,14 +62,14 @@
     print_usage();
   endif
   ( isscalar(N) && N > 0 ) || \
-      usage( "N must be a positive integer" );
+      error( "N must be a positive integer" );
   ( isvector(D) && length(D)>0 && all( D >= 0 ) ) || \
-      usage( "D must be a vector of nonnegative floats" );
+      error( "D must be a vector of nonnegative floats" );
   if ( nargin < 3 )
     Z = 0;
   else
     ( isscalar(Z) && Z >= 0 ) || \
-        usage( "Z must be a nonnegative scalar" );
+        error( "Z must be a nonnegative scalar" );
   endif
   D_tot = sum(D);
   X_max = 1/max(D);
--- a/main/queueing/inst/qnclosedsinglemva.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnclosedsinglemva.m	Fri Apr 13 12:20:21 2012 +0000
@@ -119,13 +119,13 @@
   endif
 
   isscalar(N) && N >= 0 || \
-      usage( "N must be >= 0" );
+      error( "N must be >= 0" );
   isvector(S) || \
-      usage( "S must be a vector" );
+      error( "S must be a vector" );
   S = S(:)'; # make S a row vector
 
   isvector(V) || \
-      usage( "V must be a vector" );
+      error( "V must be a vector" );
   V = V(:)'; # make V a row vector
 
   K = length(S); # Number of servers
@@ -134,23 +134,23 @@
     m = ones(1,K);
   else
     isvector(m) || \
-	usage( "m must be a vector" );
+	error( "m must be a vector" );
     m = m(:)'; # make m a row vector
   endif
 
   [err S V m] = common_size(S, V, m);
   (err == 0) || \
-      usage( "S, V and m are of incompatible size" );
+      error( "S, V and m are of incompatible size" );
   all(S>=0) || \
-      usage( "S must be a vector >= 0" );
+      error( "S must be a vector >= 0" );
   all(V>=0) || \
-      usage( "V must be a vector >= 0" );
+      error( "V must be a vector >= 0" );
 
   if ( nargin < 5 )
     Z = 0;
   else
     (isscalar(Z) && Z >= 0) || \
-        usage( "Z must be >= 0" );
+        error( "Z must be >= 0" );
   endif
 
   U = R = Q = X = zeros( 1, K );
--- a/main/queueing/inst/qnclosedsinglemvaapprox.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnclosedsinglemvaapprox.m	Fri Apr 13 12:20:21 2012 +0000
@@ -117,11 +117,11 @@
   endif
 
   isscalar(N) && N >= 0 || \
-      usage( "N must be >= 0" );
+      error( "N must be >= 0" );
   isvector(S) || \
-      usage( "S must be a vector" );
+      error( "S must be a vector" );
   isvector(V) || \
-      usage( "V must be a vector" );
+      error( "V must be a vector" );
   S = S(:)'; # make S a row vector
   V = V(:)'; # make V a row vector
 
@@ -131,39 +131,39 @@
     m = ones(1,K);
   else
     isvector(m) || \
-	usage( "m must be a vector" );
+	error( "m must be a vector" );
     m = m(:)'; # make m a row vector
   endif
 
   [err S V m] = common_size(S, V, m);
   (err == 0) || \
-      usage( "S, V and m are of incompatible size" );
+      error( "S, V and m are of incompatible size" );
   all(S>=0) || \
-      usage( "S must be a vector >= 0" );
+      error( "S must be a vector >= 0" );
   all(V>=0) || \
-      usage( "V must be a vector >= 0" );
+      error( "V must be a vector >= 0" );
   all(m<=1) || \
-      usage( "Vector m must be <= 1 (this function supports IS and single-server nodes only)" );
+      error( "Vector m must be <= 1 (this function supports IS and single-server nodes only)" );
 
   if ( nargin < 5 )
     Z = 0;
   else
     (isscalar(Z) && Z >= 0) || \
-        usage( "Z must be >= 0" );
+        error( "Z must be >= 0" );
   endif
 
   if ( nargin < 6 )
     tol = 1e-5;
   else
     ( isscalar(tol) && tol>0 ) || \
-	usage("tol must be a positive scalar");
+	error("tol must be a positive scalar");
   endif
 
   if ( nargin < 7 )
     iter_max = 100;
   else
     ( isscalar(iter_max) && iter_max > 0 ) || \
-	usage("iter_max must be a positive integer");
+	error("iter_max must be a positive integer");
   endif
 
   U = R = Q = X = zeros( 1, K );
--- a/main/queueing/inst/qnclosedsinglemvald.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnclosedsinglemvald.m	Fri Apr 13 12:20:21 2012 +0000
@@ -89,21 +89,21 @@
   endif
 
   isvector(V) && all(V>=0) || \
-      usage( "V must be a vector >= 0" );
+      error( "V must be a vector >= 0" );
   V = V(:)'; # make V a row vector
   K = length(V); # Number of servers
   isscalar(N) && N >= 0 || \
-      usage( "N must be >= 0" );
+      error( "N must be >= 0" );
   ( ismatrix(S) && rows(S) == K && columns(S) >= N ) || \
-      usage( "S size mismatch: is %dx%d, should be %dx%d", rows(S), columns(S), K, N );
+      error( "S size mismatch: is %dx%d, should be %dx%d", rows(S), columns(S), K, N );
   all(all(S>=0)) || \
-      usage( "S must be >= 0" );
+      error( "S must be >= 0" );
 
   if ( nargin < 4 ) 
     Z = 0;
   else
     isscalar(Z) && Z>=0 || \
-        usage( "Z must be >= 0" );
+        error( "Z must be >= 0" );
   endif
 
   ## Initialize results
--- a/main/queueing/inst/qncmva.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qncmva.m	Fri Apr 13 12:20:21 2012 +0000
@@ -91,24 +91,24 @@
   endif
 
   isscalar(N) && N >= 0 || \
-      usage("N must be a positive scalar");
+      error("N must be a positive scalar");
 
   isvector(S) || \
-      usage("S must be a vector");
+      error("S must be a vector");
   S = S(:)'; # make S a row vector
   M = length(S)+1; # number of service centers (escluding the delay center)
   
   isvector(Sld) && length(Sld) == N && all(Sld>=0) || \
-      usage("Sld must be a vector with %d elements >= 0", N);
+      error("Sld must be a vector with %d elements >= 0", N);
   Sld = Sld(:)'; # Make Sld a row vector
 
   isvector(V) && length(V) == M && all(V>=0) || \
-      usage("V must be a vector with %d elements", M);
+      error("V must be a vector with %d elements", M);
   V = V(:)'; # Make V a row vector
 
   if ( nargin == 5 )
     isscalar(Z) && Z>=0 || \
-	usage("Z must be nonnegative");
+	error("Z must be nonnegative");
   else
     Z = 0;
   endif
--- a/main/queueing/inst/qnconvolution.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnconvolution.m	Fri Apr 13 12:20:21 2012 +0000
@@ -94,25 +94,25 @@
   endif
 
   ( isscalar(N) && N>0 ) || \
-      usage( "K must be a positive scalar" );
+      error( "K must be a positive scalar" );
   K = N; # To be compliant with the reference, we use K to denote the population size
   ( isvector(S) && all(S >= 0) ) || \
-      usage( "S must be a vector of positive scalars" );
+      error( "S must be a vector of positive scalars" );
   S = S(:)'; # make S a row vector
   N = length(S); # Number of service centers
   ( isvector(V) && size_equal(V,S) ) || \
-      usage( "V must be a vector of the same length as S" );
+      error( "V must be a vector of the same length as S" );
   V = V(:)';
 
   if ( nargin < 4 )
     m = ones(1,N);
   else
     isvector(m) || \
-	usage( "m must be a vector" );
+	error( "m must be a vector" );
     m = m(:)';
     [err m S] = common_size(m, S);
     (err == 0) || \
-        usage( "m and S have incompatible size" );
+        error( "m and S have incompatible size" );
   endif
 
   ## First, we remember the indexes of IS nodes
@@ -208,7 +208,7 @@
 ## and accepts a vector as parameter j.
 function result = F(i,j,v,S,m)
   isscalar(i) || \
-      usage( "i must be a scalar" );
+      error( "i must be a scalar" );
   k_i = j;
   if ( m(i) == 1 )
     result = ( v(i)*S(i) ).^k_i;
--- a/main/queueing/inst/qnconvolutionld.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnconvolutionld.m	Fri Apr 13 12:20:21 2012 +0000
@@ -93,17 +93,17 @@
   endif
 
   ( isscalar(N) && N>0 ) || \
-      usage( "N must be a positive scalar" );
+      error( "N must be a positive scalar" );
   K = N; # To be compliant with the reference, we denote K as the population size
   ( isvector(V) ) || \
-      usage( "V must be a vector" );
+      error( "V must be a vector" );
   V = V(:)'; # Make V a row vector
   N = length(V); # Number of service centers
   if ( isnumeric(S) ) 
     ( rows(S) == N && columns(S) == K) || \
-        usage( sprintf("S size mismatch: is %dx%d, should be %dx%d", rows(S), columns(S),K,N ) );
+        error( sprintf("S size mismatch: is %dx%d, should be %dx%d", rows(S), columns(S),K,N ) );
     all( all(S>=0) ) || \
-        usage( "S must be >=0" );
+        error( "S must be >=0" );
   endif
 
   ## Initialization
--- a/main/queueing/inst/qnjackson.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnjackson.m	Fri Apr 13 12:20:21 2012 +0000
@@ -24,9 +24,9 @@
 ## @cindex open network, single class
 ## @cindex Jackson network
 ##
-## With three or four input parameters, this function computes the
-## steady-state occupancy probabilities for a Jackson network. With five
-## input parameters, this function computes the steady-state probability
+## With three or four arguments, this function computes the steady-state
+## occupancy probabilities for a Jackson network. With five arguments,
+## this function computes the steady-state probability
 ## @code{@var{pi}(j)} that there are @code{@var{k}(j)} requests at
 ## service center @math{j}.
 ##
@@ -66,8 +66,8 @@
 ## @code{@var{m}(i)} is the number of servers at service center
 ## @math{i}. If @code{@var{m}(i) < 1}, service center @math{i} is an
 ## infinite-server node. Otherwise, it is a regular FCFS queueing center with
-## @code{@var{m}(i)} servers. If this parameter is omitted, default is
-## @code{@var{m}(i) = 1} for all @math{i}. If this parameter is a scalar,
+## @code{@var{m}(i)} servers. If this argument is omitted, default is
+## @code{@var{m}(i) = 1} for all @math{i}. If this argument is a scalar,
 ## it will be promoted to a vector with the same size as @var{lambda}.
 ## Otherwise, @var{m} must be a vector of length @math{N}.
 ##
@@ -116,18 +116,18 @@
     print_usage();
   endif
   ( isvector(lambda) && all(lambda>=0) ) || \
-      usage( "lambda must be a vector >= 0" );
+      error( "lambda must be a vector >= 0" );
   lambda=lambda(:)'; # make lambda a row vector
   N = length(lambda);
   isvector(S) || \
-      usage( "S must be a vector" );
+      error( "S must be a vector" );
   S = S(:)'; # make S a row vector
   size_equal(lambda,S) || \
-      usage( "lambda and S must of be of the same length" );
+      error( "lambda and S must of be of the same length" );
   all(S>0) || \
-      usage( "S must be >0" );
+      error( "S must be >0" );
   [N,N] == size(P) || \
-      usage(" P must be a matrix of size length(lambda) x length(lambda)" );  
+      error(" P must be a matrix of size length(lambda) x length(lambda)" );  
   all(all(P>=0)) && all(sum(P,2)<=1) || \
       error( "P is not a transition probability matrix" );
 
@@ -136,7 +136,7 @@
   else
     [errorcode, lambda, m] = common_size(lambda, m);
     ( isvector(m) && (errorcode==0) ) || \
-        usage("m and lambda must have the same length" );
+        error("m and lambda must have the same length" );
   endif
 
   ## Compute the arrival rates using the traffic equation:
@@ -153,9 +153,9 @@
   if ( nargin == 5 )
 
     ( isvector(k) && size_equal(lambda,k) ) || \
-        usage( "k must be a vector of the same size as lambda" );
+        error( "k must be a vector of the same size as lambda" );
     all(k>=0) || \
-        usage( "k must be nonnegative" );
+        error( "k must be nonnegative" );
 
     ## compute occupancy probability
     rho = l .* S ./ m;      
--- a/main/queueing/inst/qnmarkov.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnmarkov.m	Fri Apr 13 12:20:21 2012 +0000
@@ -144,17 +144,17 @@
     print_usage();
   endif
 
-  isvector(S) || usage( "S must be a vector" );
+  isvector(S) || error( "S must be a vector" );
   K = length(S); # number of service centers
 
   if ( nargin < 5 )
     m = ones(1,K);
   else
-    size_equal(m,S) || usage( "m must have the same langth as S" );
+    size_equal(m,S) || error( "m must have the same langth as S" );
   endif
 
   ( [K,K] == size(P) && all( all(P>=0)) && all(sum(P,2) <= 1)) || \
-      usage( "P must be SxS and nonnegative" );
+      error( "P must be SxS and nonnegative" );
 
   if ( isscalar(x) )
     is_open = false;
@@ -167,7 +167,7 @@
     is_open = true;
     lambda = x; # open network
     size_equal(lambda, S ) || \
-        usage( "lambda must have the same langth as S" );
+        error( "lambda must have the same langth as S" );
   endif
 
   ( all(m > 0) && all(m <= C) ) || \
--- a/main/queueing/inst/qnmg1.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnmg1.m	Fri Apr 13 12:20:21 2012 +0000
@@ -79,7 +79,7 @@
    ## bring the parameters to a common size
    [ err lambda xavg x2nd ] = common_size( lambda, xavg, x2nd );
    if ( err ) 
-      usage( "parameters are of incompatible size" );
+      error( "parameters are of incompatible size" );
    endif
 
    mu = 1 ./ xavg;
--- a/main/queueing/inst/qnmh1.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnmh1.m	Fri Apr 13 12:20:21 2012 +0000
@@ -95,12 +95,12 @@
       print_usage();
    endif
    if ( size(mu) != size(alpha) )
-      usage( "parameters are of incompatible size" );
+      error( "parameters are of incompatible size" );
    endif
    [n c] = size(mu);
 
    if (!is_scalar(lambda) && (n != length(lambda)) ) 
-      usage( "parameters are of incompatible size" );
+      error( "parameters are of incompatible size" );
    endif
    for i=1:n
       avg  = sum( alpha(i,:) .* (1 ./ mu(i,:)) );
--- a/main/queueing/inst/qnmix.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnmix.m	Fri Apr 13 12:20:21 2012 +0000
@@ -121,34 +121,34 @@
     print_usage();
   endif
   isvector(lambda) || \
-      usage( "lambda must be a vector" );
+      error( "lambda must be a vector" );
   lambda = lambda(:)';
   isvector(N) || \
-      usage( "N must be a vector" );
+      error( "N must be a vector" );
   N = N(:)';
   size_equal(lambda,N) || \
-      usage( "lambda and N must be of equal length" );
+      error( "lambda and N must be of equal length" );
   ( !any( lambda>0 & N>0 ) ) || \
-      usage("A class cannot be open and closed at the same time. Check lambda and N" );
+      error("A class cannot be open and closed at the same time. Check lambda and N" );
   ( all( lambda>0 | N>0 ) ) || \
-      usage( "A class cannot be neither open nor closed. Check lambda and N" );
+      error( "A class cannot be neither open nor closed. Check lambda and N" );
   size_equal(S,V) || \
-      usage( "S and V must have the same size" );
+      error( "S and V must have the same size" );
   C = length(lambda); # number of classes
   K = columns(S); # number of service centers
   rows(S) == C || \
-      usage( "S must have %d rows", C );
+      error( "S must have %d rows", C );
   if ( nargin < 5 ) 
     m = ones(1,K);
   else
     isvector( m ) || \
-        usage( "m must be a vector" );
+        error( "m must be a vector" );
     m = m(:)';
     size_equal(lambda,m) || \
-        usage( "lambda and m must be of equal length" );
+        error( "lambda and m must be of equal length" );
   endif
   all( m<=1 ) || \
-      usage( "This function supports single-server and delay centers only. Check m" );
+      error( "This function supports single-server and delay centers only. Check m" );
   if ( !any(lambda>0) ) 
     warning( "qnmix(): There are no open classes. Using qnclosedmultimva()" );
     [U R Q X] = qnclosedmultimva( N, S, V, m );
--- a/main/queueing/inst/qnmknode.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnmknode.m	Fri Apr 13 12:20:21 2012 +0000
@@ -99,12 +99,12 @@
 function Q = qnmknode( node, S, varargin )
 
   ischar(node) || \
-      usage( "Parameter \"node\" must be a string" );
+      error( "Parameter \"node\" must be a string" );
 
   node = tolower(node);
 
   isvector(S) || ismatrix(S) || \
-      usage( "Parameter \"S\" must be a vector" );
+      error( "Parameter \"S\" must be a vector" );
   m = 1;
   s2 = ones( size(S) );
   if ( strcmp(node, "m/m/m-fcfs") )
@@ -115,7 +115,7 @@
     if ( 3 == nargin )
       m = varargin{1};
       m>=1 || \
-	  usage( "m must be >=1" );
+	  error( "m must be >=1" );
     endif
   elseif ( strcmp(node, "m/m/1/k-fcfs") )
     ## M/M/1/k finite capacity node
@@ -125,7 +125,7 @@
     if ( 3 == nargin )
       k = varargin{1};
       k>=1 || \
-	  usage( "k must be >=1" );
+	  error( "k must be >=1" );
     endif
   elseif ( strcmp(node, "-/g/1-lcfs-pr") )
     ## -/G/1-LCFS-PR node
@@ -149,7 +149,7 @@
       s2 = varargin{1};
     endif
   else
-    usage( "Unknown node type \"%s\". node type must be one of \"m/m/m-fcfs\", \"-/g/1-lcfs-pr\", \"-/g/1-ps\" and \"-/g/inf\"", node );
+    error( "Unknown node type \"%s\". node type must be one of \"m/m/m-fcfs\", \"-/g/1-lcfs-pr\", \"-/g/1-ps\" and \"-/g/inf\"", node );
   endif
   Q = struct( "node", node, "m", m, "S", S, "s2", s2, "c", rows(S), "comment", "" );
 endfunction
--- a/main/queueing/inst/qnmm1.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnmm1.m	Fri Apr 13 12:20:21 2012 +0000
@@ -89,14 +89,14 @@
   ## bring the parameters to a common size
   [ err lambda mu ] = common_size( lambda, mu );
   if ( err ) 
-    usage( "parameters are of incompatible size" );
+    error( "parameters are of incompatible size" );
   endif
   ( isvector(lambda) && isvector(mu) ) || \
-      usage( "lambda and mu must be vectors" );
+      error( "lambda and mu must be vectors" );
   all( lambda > 0 ) || \
-      usage( "lambda must be >0" );
+      error( "lambda must be >0" );
   all( mu > lambda ) || \
-      usage( "The system is not ergodic" );
+      error( "The system is not ergodic" );
   U = rho = lambda ./ mu; # utilization
   p0 = 1-rho;
   Q = rho ./ (1-rho);
--- a/main/queueing/inst/qnmm1k.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnmm1k.m	Fri Apr 13 12:20:21 2012 +0000
@@ -95,17 +95,17 @@
   endif
 
   ( isvector(lambda) && isvector(mu) && isvector(K) ) || \
-      usage( "lambda, mu, K must be vectors of the same size" );
+      error( "lambda, mu, K must be vectors of the same size" );
 
   [err lambda mu K] = common_size( lambda, mu, K );
   if ( err ) 
-    usage( "Parameters are not of common size" );
+    error( "Parameters are not of common size" );
   endif
 
   all( K>0 ) || \
-      usage( "K must be >0" );
+      error( "K must be >0" );
   ( all( lambda>0 ) && all( mu>0 ) ) || \
-      usage( "lambda and mu must be >0" );
+      error( "lambda and mu must be >0" );
 
   U = R = Q = X = p0 = pK = 0*lambda;
   a = lambda./mu;
--- a/main/queueing/inst/qnmminf.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnmminf.m	Fri Apr 13 12:20:21 2012 +0000
@@ -93,13 +93,13 @@
   [ err lambda mu ] = common_size( lambda, mu );
 
   if ( err ) 
-    usage( "Parameters are of incompatible size" );
+    error( "Parameters are of incompatible size" );
   endif
   
   ( isvector(lambda) && isvector(mu) ) || \
-      usage( "lambda and mu must be vectors" );
+      error( "lambda and mu must be vectors" );
   ( all( lambda>0 ) && all( mu>0 ) ) || \
-      usage( "lambda and mu must be >0" );
+      error( "lambda and mu must be >0" );
   U = Q = lambda ./ mu; # Traffic intensity.
   p0 = exp(-lambda./mu); # probability that there are 0 requests in the system
   R = 1 ./ mu;
--- a/main/queueing/inst/qnmmm.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnmmm.m	Fri Apr 13 12:20:21 2012 +0000
@@ -111,14 +111,14 @@
   endif
   [err lambda mu m] = common_size( lambda, mu, m );
   if ( err ) 
-    usage( "parameters are not of common size" );
+    error( "parameters are not of common size" );
   endif
 
   ( isvector(lambda) && isvector(mu) && isvector(m) ) || \
-      usage( "the parameters must be vectors" );
+      error( "the parameters must be vectors" );
   
   all( m>0 ) || \
-      usage( "m must be >0" );
+      error( "m must be >0" );
 
   all( lambda < m .* mu ) || \
       error( "Processing capacity exceeded" );
--- a/main/queueing/inst/qnmmmk.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnmmmk.m	Fri Apr 13 12:20:21 2012 +0000
@@ -115,7 +115,7 @@
   endif
 
   ( isvector(lambda) && isvector(mu) && isvector(m) && isvector(K) ) || ...
-      usage( "lambda, mu, m, K must be vectors of the same size" );
+      error( "lambda, mu, m, K must be vectors of the same size" );
   lambda = lambda(:)'; # make lambda a row vector
   mu = mu(:)'; # make mu a row vector
   m = m(:)'; # make m a row vector
@@ -123,15 +123,15 @@
 
   [err lambda mu m K] = common_size( lambda, mu, m, K );
   if ( err ) 
-    usage( "Parameters are not of common size" );
+    error( "Parameters are not of common size" );
   endif
 
   all( K>0 ) || \
-      usage( "k must be strictly positive" );
+      error( "k must be strictly positive" );
   all( m>0 ) && all( m <= K ) || \
-      usage( "m must be in the range 1:k" );
+      error( "m must be in the range 1:k" );
   all( lambda>0 ) && all( mu>0 ) || \
-      usage( "lambda and mu must be >0" );
+      error( "lambda and mu must be >0" );
   U = R = Q = X = p0 = pK = 0*lambda;
   for i=1:length(lambda)
     ## Build and solve the birth-death process describing the M/M/m/k system
--- a/main/queueing/inst/qnmvablo.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnmvablo.m	Fri Apr 13 12:20:21 2012 +0000
@@ -91,15 +91,15 @@
     print_usage();
   endif
   ( isscalar(K) && K > 0 ) || \
-      usage( "K must be a positive integer" );
+      error( "K must be a positive integer" );
   isvector(S) && all(S>0) || \
       error ("S must be a vector > 0");
   S = S(:)'; # make S a row vector
   N = length(S);
   ( isvector(M) && length(M) == N ) || \
-      usage( "M must be a vector with %d elements", N );
+      error( "M must be a vector with %d elements", N );
   all( M >= 1) || \
-      usage( "M must be >= 1");
+      error( "M must be >= 1");
   M = M(:)'; # make M a row vector
 
   (K < sum(M)) || \
--- a/main/queueing/inst/qnopenab.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnopenab.m	Fri Apr 13 12:20:21 2012 +0000
@@ -64,9 +64,9 @@
     print_usage();
   endif
   ( isscalar(lambda) && lambda > 0 ) || \
-      usage( "lambda must be a positive scalar" );
+      error( "lambda must be a positive scalar" );
   ( isvector(D) && length(D)>0 && all( D>=0 ) ) || \
-      usage( "D must be a vector of nonnegative scalars" );
+      error( "D must be a vector of nonnegative scalars" );
 
   X_upper = 1/max(D);
   R_lower = sum(D);
--- a/main/queueing/inst/qnopenbsb.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnopenbsb.m	Fri Apr 13 12:20:21 2012 +0000
@@ -65,9 +65,9 @@
     print_usage();
   endif
   ( isscalar(lambda) && lambda>0 ) || \
-      usage( "lambda must be a positive scalar" );
+      error( "lambda must be a positive scalar" );
   ( isvector(D) && length(D)>0 && all(D>=0) ) || \
-      usage( "D must be a vector of nonnegative floats" );
+      error( "D must be a vector of nonnegative floats" );
 
   D_max = max(D);
   D_tot = sum(D);
--- a/main/queueing/inst/qnopenmulti.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnopenmulti.m	Fri Apr 13 12:20:21 2012 +0000
@@ -92,24 +92,24 @@
     print_usage();
   endif
   isvector(lambda) && all(lambda > 0) || \
-      usage( "lambda must be a vector of positive floats" );
+      error( "lambda must be a vector of positive floats" );
   lambda = lambda(:)'; # make lambda a row vector
   C = length(lambda);
   K = columns(S);
   [C,K] == size(S) || \
-      usage( "rows(S) must be equal to length(lambda)" );
+      error( "rows(S) must be equal to length(lambda)" );
   all(all( S > 0 )) || \
-      usage( "S(c,k) must be > 0" );
+      error( "S(c,k) must be > 0" );
   [C,K] == size(V) || \
-      usage( "V must be a matrix of the same size as S" );
+      error( "V must be a matrix of the same size as S" );
   all( all(V>= 0) ) || \
-      usage( "V must be >= 0 " );
+      error( "V must be >= 0 " );
 
   if ( nargin < 4 )
     m = ones(1,K);
   else
     ( isvector( m ) && length(m) == K && all( m <= 1 ) ) || \
-        usage( "m must be less than or equal to ones(1,K)" );
+        error( "m must be less than or equal to ones(1,K)" );
     m = m(:)'; # make m a row vector
   endif
 
--- a/main/queueing/inst/qnopensingle.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnopensingle.m	Fri Apr 13 12:20:21 2012 +0000
@@ -101,25 +101,25 @@
     print_usage();
   endif
   ( isscalar(lambda) && lambda>0 ) || \
-      usage( "lambda must be a positive number" );
+      error( "lambda must be a positive number" );
   lambda = lambda(:)';
   ( isvector( S ) && all(S>0) ) || \
-      usage( "S must be a vector >0" );
+      error( "S must be a vector >0" );
   S = S(:)';
   K = length(S);
   ( isvector( V ) && length(V)==K && all(V>=0) ) || \
-      usage( "V must be a vector >=0 and of the same length as S" );
+      error( "V must be a vector >=0 and of the same length as S" );
   V = V(:)';
 
   if ( nargin < 4 )
     m = ones(1,K);
   else
     (isvector(m) && (length(m) == K)) || \
-	usage( "m must be a vector of %d elements", K);
+	error( "m must be a vector of %d elements", K);
     m = m(:)';
     [err m] = common_size(m,S);
     ( err == 0 ) || \
-        usage( "m and S are not of common size" );
+        error( "m and S are not of common size" );
   endif
 
   ## Compute maximum processing capacity
--- a/main/queueing/inst/qnsolve.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnsolve.m	Fri Apr 13 12:20:21 2012 +0000
@@ -106,7 +106,7 @@
   endif
 
   ischar(network_type) || \
-      usage("First parameter must be a string");
+      error("First parameter must be a string");
 
   network_type = tolower(network_type);
 
@@ -117,7 +117,7 @@
   elseif (strcmp(network_type, "mixed" ) )
     [U R Q X] = __qnsolve_mixed( varargin{:} );
   else
-    usage( "Invalid network type %s: must be one of \"open\", \"closed\" or \"mixed\"", network_type );
+    error( "Invalid network type %s: must be one of \"open\", \"closed\" or \"mixed\"", network_type );
   endif
 endfunction
 
@@ -140,26 +140,26 @@
   endif
 
   ( isscalar(lambda) && (lambda>0) ) || \
-      usage( "lambda must be a scalar > 0" );
+      error( "lambda must be a scalar > 0" );
   
   iscell(QQ) || \
-      usage( "QQ must be a cell array" );
+      error( "QQ must be a cell array" );
 
   N = length(QQ);
 
   ( isvector(V) && length(V) == N ) || \
-      usage( "V must be a vector of length %d", N );
+      error( "V must be a vector of length %d", N );
 
   V = V(:); # make V a row vector
   all(V>=0) || \
-      usage( "V must be >= 0" );
+      error( "V must be >= 0" );
 
   ## Initialize vectors
   S = zeros(size(V));
   m = ones(size(V));
   for i=1:N
     QQ{i}.c == 1 || \
-	usage( "Multiclass networks are not supported by this function" );
+	error( "Multiclass networks are not supported by this function" );
     S(i) = QQ{i}.S;
     if __is_li(QQ{i})
       ; # nothing to do
@@ -168,7 +168,7 @@
     elseif __is_is(QQ{i})
       m(i) = -1;
     else
-      usage( "Unsupported type \"%s\" for node %d", QQ{i}.node, i );
+      error( "Unsupported type \"%s\" for node %d", QQ{i}.node, i );
     endif
   endfor
 
@@ -184,29 +184,29 @@
     print_usage();
   endif
   isvector(lambda) && all(lambda > 0) || \
-      usage( "lambda must be a vector >0" );
+      error( "lambda must be a vector >0" );
   lambda = lambda(:)'; # make lambda a row vector
   iscell(QQ) || \
-      usage( "QQ must be a cell array" );
+      error( "QQ must be a cell array" );
   C = length(lambda);
   K = length(QQ);
   [C,K] == size(V) || \
-      usage( "V size mismatch" );
+      error( "V size mismatch" );
   all( all( V>= 0 ) ) || \
-      usage( "V must be >= 0 " );
+      error( "V must be >= 0 " );
 
   S = zeros(C,K);
   m = ones(1,K);
   for i=1:K
     QQ{i}.c == C || \
-	usage( "Wrong number of classes for center %d (is %d, should be %d)", i, QQ{i}.c, C );
+	error( "Wrong number of classes for center %d (is %d, should be %d)", i, QQ{i}.c, C );
     S(:,i) = QQ{i}.S(:);
     if __is_li(QQ{i})
       ; # nothing to do
     elseif __is_is(QQ{i})
       m(i) = -1;
     else
-      usage( "Unsupported type \"%s\" for node %d", QQ{i}.node, i );
+      error( "Unsupported type \"%s\" for node %d", QQ{i}.node, i );
     endif  
   endfor
 
@@ -231,32 +231,32 @@
 function [U R Q X] = __qnsolve_closed_single( N, QQ, V, Z )
 
   if ( nargin < 3 || nargin > 4 )
-    usage();
+    error();
   endif
 
   isscalar(N) || \
-      usage( "Multiclass networks are not supported by this function" );
+      error( "Multiclass networks are not supported by this function" );
 
   iscell(QQ) || \
-      usage( "QQ must be a cell array" );
+      error( "QQ must be a cell array" );
 
   if ( nargin < 4 ) 
     Z = 0;
   else
     isscalar(Z) && Z >= 0 || \
-        usage( "Z must be >= 0" );
+        error( "Z must be >= 0" );
   endif
 
   K = length(QQ);
   
   ( isvector(V) && length(V) == K ) || \
-      usage( "V must be a vector of length %d", K );
+      error( "V must be a vector of length %d", K );
 
   ## Initialize vectors
   i_single = i_multi = i_delay = i_ld = [];
   for i=1:K
     ( QQ{i}.c == 1 ) || \
-	usage( "Multiclass networks are not supported by this function" );
+	error( "Multiclass networks are not supported by this function" );
     if __is_li(QQ{i})
       i_single = [i_single i];
     elseif __is_multi(QQ{i})
@@ -266,7 +266,7 @@
     elseif __is_ld(QQ{i})
       i_ld = [i_ld i];
     else
-      usage( "Unsupported type \"%s\" for node %d", QQ{i}.node, i );
+      error( "Unsupported type \"%s\" for node %d", QQ{i}.node, i );
     endif
   endfor
   p = cell( 1, K );
@@ -365,48 +365,48 @@
   endif
 
   isvector(N) && all( N>0 ) || \
-      usage( "N must be >0" );
+      error( "N must be >0" );
 
   iscell(QQ) || \
-      usage( "QQ must be a cell array" );
+      error( "QQ must be a cell array" );
 
   C = length(N); ## Number of classes
   K = length(QQ); ## Number of service centers
   size(V) == [C,K] || \
-      usage( "V size mismatch" );
+      error( "V size mismatch" );
 
   if ( nargin < 4 )
     Z = zeros(1,C);
   else
     isvector(Z) && length(Z) == C || \
-	usage( "Z size mismatch" );
+	error( "Z size mismatch" );
   endif
 
   ## Check consistence of parameters
   all( all( V >= 0 ) ) || \
-      usage( "V must be >=0" );
+      error( "V must be >=0" );
 
   ## Initialize vectors
   i_single = i_multi = i_delay = i_ld = [];
   S = zeros(C,K);
   for i=1:K
     ( QQ{i}.c == C ) || \
-	usage( "Service center %d has wrong number of classes (is %d, should be %d)", i, QQ{i}.c, C );
+	error( "Service center %d has wrong number of classes (is %d, should be %d)", i, QQ{i}.c, C );
 
     if __is_li(QQ{i})
       i_single = [i_single i];
       ( !strcmpi( QQ{i}.node, "m/m/m-fcfs" ) || all( QQ{i}.S(1) == QQ{i}.S )) || \
-	  usage( "Service times at FIFO node %d are not class-independent", i );
+	  error( "Service times at FIFO node %d are not class-independent", i );
     elseif __is_multi(QQ{i})
       i_multi = [i_multi i];
     elseif __is_is(QQ{i})
       i_delay = [i_delay i];
     elseif __is_ld(QQ{i})
       columns( QQ{i}.S ) == sum(N) || \
-	  usage( "Load-dependent center %d has insufficient data (is %d, should be %d", i, columns(QQ{i}.S), sum(N) );
+	  error( "Load-dependent center %d has insufficient data (is %d, should be %d", i, columns(QQ{i}.S), sum(N) );
       i_ld = [i_ld i];
     else
-      usage( "Unknown or unsupported type \"%s\" for node %d", QQ{i}.node, i );
+      error( "Unknown or unsupported type \"%s\" for node %d", QQ{i}.node, i );
     endif
   endfor
 
@@ -544,9 +544,9 @@
     print_usage();
   endif
   ( isvector(lambda) && isvector(N) && size_equal(lambda,N) ) || \
-      usage( "lambda and N must be vectors of the same size" );
+      error( "lambda and N must be vectors of the same size" );
   ( iscell(QQ) && length(QQ) == length(lambda) ) || \
-      usage( "QQ size mismatch (is %d, should be %d)", length(QQ), length(lambda) );
+      error( "QQ size mismatch (is %d, should be %d)", length(QQ), length(lambda) );
 
   C = length(lambda); # number of classes
   K = length(QQ); # number of service centers
@@ -555,7 +555,7 @@
   ## fill S matrix
   for k=1:K
     if __is_ld(QQ{k})
-      usage( "General load-dependent service center %d is not supported", k );
+      error( "General load-dependent service center %d is not supported", k );
     elseif __is_is(QQ{k})
       m(k) = -1;
     else
@@ -601,23 +601,23 @@
   return; ## immediately return
   [errorcode, N, lambda] = common_size( N, lambda );
   if ( errorcode)
-    usage( "N and lambda are of incompatible size" );
+    error( "N and lambda are of incompatible size" );
   endif
   ( isvector(N) && isvector(lambda) && size_equal(lambda,N) ) || \
-      usage( "N and lambda must be vector of the same length" );
+      error( "N and lambda must be vector of the same length" );
   C = length(N);  
   K = length(QQ); # number of service centers
 
   [C,K] == size(V) || \
-      usage( "V size mismatch" );
+      error( "V size mismatch" );
   [C,K] == size(U) || \
-      usage( "U size mismatch" );
+      error( "U size mismatch" );
   [C,K] == size(R) || \
-      usage( "R size mismatch" );
+      error( "R size mismatch" );
   [C,K] == size(Q) || \
-      usage( "Q size mismatch" );
+      error( "Q size mismatch" );
   [C,K] == size(X) || \
-      usage( "X size mismatch" );
+      error( "X size mismatch" );
 
   for c=1:C     
     printf("\n");
--- a/main/queueing/inst/qnvisits.m	Fri Apr 13 12:11:56 2012 +0000
+++ b/main/queueing/inst/qnvisits.m	Fri Apr 13 12:20:21 2012 +0000
@@ -80,7 +80,7 @@
   endif
 
   ( ndims(P) == 2 || ndims(P) == 4 ) || \
-      usage("P must be a 2- or 4-dimensional matrix");
+      error("P must be a 2- or 4-dimensional matrix");
 
   if ( ndims(P) == 2 ) 
     V = __qnvisitssingle( P, varargin{:} );
@@ -327,7 +327,7 @@
 function [V chains] = __qnvisitsmulti( P, lambda )
   [C, K, C2, K2] = size( P );
   (K == K2 && C == C2) || \
-      usage( "P must be a [C,K,C,K] matrix");
+      error( "P must be a [C,K,C,K] matrix");
 
   chains = [];
 
@@ -409,7 +409,7 @@
     ## lambda is defined as sum_r sum_i lambda(r,i)
   
     [C,K] == size(lambda) || \
-        usage( "lambda size mismatch" );
+        error( "lambda size mismatch" );
     
     ## solve the traffic equation
     A = eye(K*C) - reshape(P,[K*C K*C]);
@@ -479,7 +479,7 @@
   persistent epsilon = 10*eps;
 
   issquare(P)  || \
-      usage( "P must be a square matrix" );
+      error( "P must be a square matrix" );
 
   N = size(P,1);
   V = zeros(N,N);
@@ -490,7 +490,7 @@
     ##
     [res err] = dtmc_check_P(P);
     (res>0) || \
-        usage( "P is not a transition probability matrix for closed networks" );
+        error( "P is not a transition probability matrix for closed networks" );
 
     A = P-eye(N);
     b = zeros(1,N);
@@ -503,12 +503,12 @@
     ## Open network
     ##
     all( all(P>=0) ) && all( sum(P,2)<=1+1e-5 ) || \
-	usage( "P is not a transition probability matrix for open networks" );
+	error( "P is not a transition probability matrix for open networks" );
 
     ( isvector(lambda) && length(lambda) == N ) || \
-        usage( "lambda size mismatch" );
+        error( "lambda size mismatch" );
     all( lambda>= 0 ) || \
-        usage( "lambda contains negative values" );
+        error( "lambda contains negative values" );
 
     A = eye(N)-P;
     b = lambda / sum(lambda);