Está en la página 1de 5

PRACTICA DE AULA

MENDEZ SALCEDO JESSICA LILIANA

DISEÑO:

CODIFICACIÓN:

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

Dim i, tsll, till, tsa, tia, ns, n, k, pos As Integer

Dim tll(0 To 50), ta(0 To 50), pcs(0 To 50), fu(0 To 50) As Double

Dim tpcs(0 To 50), npuc(0 To 50), tpcc(0 To 50), cfs(0 To 50), mvy, pn,
po, pk As Double

Dim dif(0 To 100), scfs, pcfs As Double

Randomize()
tsll = Val(TextBox1.Text)

till = Val(TextBox2.Text)

tsa = Val(TextBox3.Text)

tia = Val(TextBox4.Text)

ns = Val(TextBox5.Text)

n = Val(TextBox11.Text)

k = Val(TextBox12.Text)

For i = 0 To ns - 1

tll(i) = Rnd() * (tsll - till) + till 'generacion aleatoria de lambda

ta(i) = Rnd() * (tsa - tia) + tia ' generacion aleatoria de mu

pcs(i) = tll(i) / (ta(i) - tll(i)) ' N° promedio clientes en el


sistema

fu(i) = tll(i) / ta(i) ' Factor de utilizacion del sistema

tpcs(i) = tll(i) / (ta(i) - tll(i)) 'Tiempo promedio de cliente en


sistema

npuc(i) = tll(i) ^ 2 / (ta(i) * (ta(i) - tll(i))) ' N° promedio


clientes en cola

tpcc(i) = tll(i) / (ta(i) * (ta(i) - tll(i))) ' Tiempo promedio


cliente esta en cola

dif(i) = ((ta(i) - tll(i)) / ta(i)) * 100

cfs(i) = pcs(i) * (1 - fu(i))

scfs = scfs + cfs(i)

Next i

For i = 0 To ns - 1

DGV.Rows.Add()

'COLOCA NUMERO A LAS FILA DE LA REJILLA

DGV.Rows(i).Cells(0).Value = i + 1

'COLOCA VALORES DE TIEMPO DE LLEGADA (LAMDA) EN REJILLA

DGV.Rows(i).Cells(1).Value = Format(tll(i), "###.00")

'COLOCA VALORES DE TIEMPO DE SERVICIO (MU) EN REJILLA

DGV.Rows(i).Cells(2).Value = Format(ta(i), "###.00")


'COLOCA VALORES DE N° PROMEDIO CLIENTES EN SISTEMA EN REJILLA

DGV.Rows(i).Cells(3).Value = Format(pcs(i), "###.00")

'COLOCA VALORES DE FACTOR DE UTILIZACION DEL SISTEMA EN REJILLA

DGV.Rows(i).Cells(4).Value = Format(fu(i), "###.00")

'COLOCA VALORES DE TIEMPO PROMEDIO CLIENTE EN SISTEMA REJILLA

DGV.Rows(i).Cells(5).Value = Format(tpcs(i), "###.0")

'COLOCA VALORES DE NUMERO PROMEDIO DE CLIENTES EN COLA

DGV.Rows(i).Cells(6).Value = Format(npuc(i), "###.0")

'COLOCA VALORES DE TIEMPO PROMEDIO CLIENTE EN COLA

DGV.Rows(i).Cells(7).Value = Format(tpcc(i), "###.0")

DGV.Rows(i).Cells(8).Value = Format(dif(i), "###.0")

DGV.Rows(i).Cells(9).Value = Format(cfs(i), "###.0")

Next i

'MEJORES VALORES EN COLA DE ESPERA

mvy = pcs(0) : pos = 0

For i = 0 To ns - 1

If mvy < pcs(i) Then

mvy = pcs(i)

pos = i

End If

Next i

TextBox6.Text = Format(mvy, "###.000")

TextBox7.Text = Format(fu(pos), "#.000")

TextBox8.Text = Format(npuc(pos), "###")

TextBox9.Text = Format(tpcs(pos), "###.00")

TextBox10.Text = Format(tpcc(pos), "###.00")

pcfs = scfs / ns

TextBox16.Text = Format(pcfs, "###.000")

If CheckBox1.Checked Then

pn = (1 - (tll(pos)) / ta(pos)) * (tll(pos) / ta(pos)) ^ n


TextBox13.Text = Format(pn, "#.000")

End If

If CheckBox2.Checked Then

po = 1 - tll(pos) / ta(pos)

TextBox14.Text = Format(po, "#.000")

End If

If CheckBox3.Checked Then

pk = (tll(pos) / ta(pos)) ^ (k + 1)

TextBox15.Text = Format(pk, "#.000")

End If

End Sub

También podría gustarte