Research Article

A Transient Queuing Model for Analyzing and Optimizing Gate Congestion of Railway Container Terminals

Algorithm 1

The state transition probabilities transient calculation procedure.
Procedure: the state to state transition probabilities transient calculation
Initialization:
Input the initial value of ,   ,   _max, , . Set , , ,   , isend = 0
Initialize the and
while  isend = 0 do
for    :    do
   if   <   then
   calculate by (8) and by (7)
     for    :    do
       calculate by (9) and by (7)
       for    :    do
            calculate by (10) and by (7)
       end for
     end for
   else if ≥     then
         calculate and
     for  :    do // calculate the part of probabilities that < //
       calculate , and ,
     end for
     for    :    do // calculate the part of probabilities that //
       calculate by (11) and by (7)
       for  : ( )( ) do
           calculate by (12) and by (7)
       end for
       for  :     do
           calculate by (13) and by (7)
       end for
     end for
   end if
end for
,
calculate the probabilities when a new container truck arrives by (14)
, ,
if   _max then
isend = 1
end if
end while