elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Trabajando con las ramas de git (tercera parte)


  Mostrar Mensajes
Páginas: [1]
1  Programación / Programación General / ayuda en Programacion de colas en netbeans 6.7 en: 8 Octubre 2010, 22:17 pm
hola amigos del foro hacker, necesito su ayuda para poder realizar una cola que simule los siguiente:

Especificación del modelo

Las siguientes variables, que se ilustra en la Figura 1.2.2, proporcionan la base para pasar de un modelo conceptual a un modelo de pliego de condiciones. A su llegada al nodo de servicio, puestos de trabajo son indexados por i = 1, 2, 3,. . . Para cada trabajo hay seis variables de tiempo asociado.
• La hora de llegada del trabajo que es interino.
• El plazo de trabajo que en la cola es di  ≥ 0.
• El tiempo que trabajo que comienza el servicio es bi = ai + di.
• El tiempo de servicio de trabajo i es si> 0.
• La espera del trabajo que en el nodo de servicio (cola y el servicio) es wi di = + SI.
• El tiempo que trabajo que completa el servicio (la hora de salida) es ci = ai + wi.

Algoritmo 1.2.1   Si los tiempos de llegada a1, a2,. . . y los tiempos de servicio s1, s2,. . . son conocidos y si el servidor está inicialmente en reposo y luego este algoritmo calcula el retraso d1, d2,. . . en un nodo FIFO servicio de un solo servidor con una capacidad infinita.

c0 = 0,0;   / * se supone que a0 * = 0,0 /
i = 0;
while ( más puestos de trabajo para procesar) (
i + +;
ai  = GetArrival ();
if (interino  <Ci-1)
di   = Ci-1 - interino;   / * Calcula retardo para Trabajo i * /
más
di   = 0,0;   / * trabajo que no tiene retardo * /
si  = GetService ();
ci   = Ai + di + SI;   / * Calcula la hora de salida de Trabajo i * /
)
n = i;
volver d1 , d2,. . ., Dn;

El GetArrival y procedimientos GetService lea la siguiente llegada y tiempo de servicio desde un fichero. (Un algoritmo que no se basa en el supuesto de FIFO se presenta en el capítulo 5.)

Ejemplo 1.2.2   Si Algoritmo 1.2.1 se utiliza para procesar n = 10 puestos de trabajo de acuerdo a la entrada se indica a continuación (para simplificar el interino s 'y si' s son enteros unidades de tiempo, por ejemplo, segundos, minutos, etc) entonces la salida es la secuencia de retrasos se calculan como:

   yo    :   1   2   3   4   5   6   7   8   9   10
leer el archivo   unayo    :   15   47   71   111   123   152   166   226   310   320
del algoritmo   dyo   :   0   11   23   17   35   44   70   41   0   26
leer el archivo   syo    :   43   36   34   30   38   40   31   29   36   30
Fo consultarlo en el futuro, tenga en cuenta que el último trabajo llegó en el tiempo una = 320 y se fue a la hora de
cn    = Un dn + + sn = 320 + 26 + 30 = 376.

OUTPUT STATISTICS
One basic issue that must be resolved when constructing a discrete-event simulation
model is the question of what statistics should be generated. The purpose of simulation is
insight and we gain insight about the performance of a system by looking at meaningful
statistics. Of course, a decision about what statistics are most meaningful is dependent
upon your perspective. For example, from a job's (customer's) perspective the most im-
portant statistic might be the average delay or the 95th percentile of the delay | in either
case, the smaller the better. On the other hand, particularly if the server is an expensive
resource whose justi¯cation is based on an anticipated heavy workload, from management's
perspective the server's utilization (the proportion of busy time, see De¯nition 1.2.7) is
most important | the larger the better.
Job-Averaged Statistics
De¯nition 1.2.4 For the ¯rst n jobs, the average interarrival time and the average
service time are, respectively*
¹r =
1
n
n
Xi=1
ri =
an
n
and ¹s =
1
n
n
Xi=1
si:
The reciprocal of the average interarrival time, 1=¹r, is the arrival rate; the reciprocal of
the average service time, 1=¹s, is the service rate.
Example 1.2.3 For the n = 10 jobs in Example 1.2.2, ¹r = an=n = 320=10 = 32:0 and
¹s = 34:7. If time in this example is measured in seconds, then the average interarrival
time is 32:0 seconds per job and the average service time is 34:7 seconds per job. The
corresponding arrival rate is 1=¹r = 1=32:0 »= 0:031 jobs per second; the service rate is
1=¹s = 1=34:7 »= 0:029 jobs per second. In this particular example, the server is not quite
able to process jobs at the rate they arrive on average.
De¯nition 1.2.5 For the ¯rst n jobs, the average delay in the queue and the average
wait in the service node are, respectively
¹ d =
1
n
n
Xi=1
di and ¹ w =
1
n
n
Xi=1
wi:
Recall that wi = di + si for all i. Therefore, the average time spent in the service
node will be the sum of the average times spent in the queue and in service. That is
¹ w =
1
n
n
Xi=1
wi =
1
n
n
Xi=1
(di + si) =
1
n
n
Xi=1
di +
1
n
n
Xi=1
si = ¹ d + ¹s:
The point here is that it is su±cient to compute any two of the statistics ¹ w, ¹ d, ¹s. The
third statistic can then be computed from the other two, if appropriate.


les agradzco
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines