MARCA_Models:
Modifying a Model

William J. Stewart

Billy's Home Page,   MARCA-Models Home Page


Modifying a Model

The models in the MARCA_Models collection may be modified in two distinct ways.

  1. The first involves ways in which the structure of the model is altered, leading to models with different numbers of states and transitions. Examples include the value assigned to the number of customers, N, that circulate in the NCD queueing network model; the number of resources, R, and the number of processes, P, in the MUTEX mutual exclusion model; and so on. Indeed, the purpose of the dataset input files, model_in, is to provide different instances of the model by varying just such parameter values. Since each model will have different characteristics, instructions on making modification of this type are given at the end of each model's individual input file. For example, the following information is provided at the end of the file ncd_in:
          4                                    **  Number of buckets 
        100 100 100 100                        **  Maximum values
          0   0   0 100                        **  Initial state
          4                                    **  Buckets generating trans.
          1           3           2   3   4    **  Transitions from bucket 1
          2           1           1            **                   bucket 2
          3           1           1            **                   bucket 3
          4           1           1            **                   bucket 4
       
       
       **********************************************************************
       ***        EXPLANATION OF INPUT DATA FOR NCD EXAMPLE               ***
       **********************************************************************
       
       This file contains ten data sets.  
       Observe the final data set immediately above,
       and use its structure as an example.  It is for N = 100
       
       For each data set:
       
           Only lines 2 and 3 vary.
           Line 2 must have the values:   N  N  N  N
           and line 3, the values         0  0  0  N
       
       Therefore to change the number of customers, N, in this queueing
       network, it is sufficient to change the values on lines 2 and 3.
       
       If you wish to run larger examples that these, you will need
       to increase the size of the work arrays in the main program.
       
       
       **********************************************************************
       
       Values of N, n and nz for the 10 datasets provided:
       
            N              n              nz
            
           10            286           1,606
           20          1,771          11,011
           30          5,456          35,216
           40         12,341          81,221
           50         23,426         156,026
           60         39,711         266,631
           70         62,196         420,036
           80         91,881         623,241
           90        129,766         883,246
          100        176,851       1,207,051
          
       **********************************************************************
    
    Observe that the file ends by giving the number of states in the model, n, and the number of nonzeros, nz, for each of the 10 different data sets (i.e., for each of the 10 different numbers of customers in the network).

  2. The second way in which a model may be modified is by altering the values of the rates at which the different transitions occur, the values of routing probabilities, and so on. This will not alter the structure of the transition matrix, but instead it will affect the numerical value of its entries. In particular, the size of the matrix will remain unaltered. These changes must be made to the source code that is in the model.f file. Usually it is the subroutines rate and instant that will be modified, but occasionally changes may need to be made to a common subroutine. Specific information on how this may be done is provided in comment statements in the appropriate subroutine. For example, instructions on how to alter the rates of transition in the MUTEX model is provided in comment statements in its rate subroutine, as is shown below.
       **********************************************************************
             subroutine rate(L1,L2,istate,into,L,r,icomm,rcomm)
             implicit double precision (a-h,o-z)
             dimension istate(L),into(L)
             dimension rcomm(*),icomm(*)
       
       c     ***   This subroutine is called for each process, L1 ***
       c     ***              Rates for process L1                ***
       c     ***   r = 1/L1 for accessing resource, if available.
       c     ***   r = 1*L1 for releasing resource.
       c     ***   These may be modified by altering 
       c     ***   lines *+10 and/or *+17 below .
       
             do 1 i=1,L
                into(i)=istate(i)
           1    continue
                r=0.0d0
       
             if (into(L1).eq.0 .and. into(1).gt.0) then
                into(L1) = 1
                into(1) = into(1)-1
                r = 1.0d0/L1
                return
             end if
       
             if (into(L1).eq.1) then
                into(L1) = 0
                into(1) = into(1)+1
                r = 1.0d0*L1
                return
             end if
     
             return
             end
       **********************************************************************
    
    In this case, process L1 requests a unit of resource at rate 1/L1. When in possession of a unit of resource, it releases it at rate L1. (For example, process 2 requests a unit of resource at rate 0.5 per time unit, and releases it at a rate of 2.0 per time unit.)

Billy's Home Page,   MARCA-Models Home Page