viernes, 10 de agosto de 2007

Calculate Traffic Channels (2)

Product : Size of traffic channels needed into company.
Part involved : Implementation of practical use to calculate the quantity of traffic channels needed.
Summary : How much need to grow our infrastructure in land lines, mobile phone calls and another types of callings ?
Scenario : Developing IT plans will be based on the growth of the future company needs and that includes how to calculate the quantity of traffic channels .
Company : Minister of Health of Peru (MINSA).
Reference date : October 2006.

This stage is focused to discuss what action should be take after our detailed record call party information has been storage, remember that the call party log belongs to the input data -with the fields: Date, Time, from Extension, Number called, Call party time (secs) - of our "magic box" and after finished the append process the size of the log can be grow up to decide to save that log information into some Access table following the same order and priority of the fields described.

According to the filter -what type of calling wants to study, selecting the capacity of traffic or planning to implement some type of service call can be grouped by the series number of the number called, ensure one type of service call as input- activated is possible to reduced the response of time.

Next script (VBA Access) (1) opens one counter for every second into a entire month, (2) takes a record information and extracts the time of the begin of the calling party and the length of the calling party, after that creates a list of seconds to fill in (1), (3) repeats step 2 until reach EOF in table, (4) write into rs2 table all the counters >0 with the next format : Day (date), Hour (time), Minute (time), Second (time), TCH (quantity of traffic channels busy at that time). The different levels of code nesting are colored.

Dim rs As DAO.Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset("2006_Dic_Fijo") : Set rs2 = db.OpenRecordset("2006_Dic_Fijo_Tch")
Dim Tabla1(31, 24, 60, 60) As Integer
Dim ss As Integer: Dim mm As Integer: Dim hh As Integer: Dim dia As Integer
rs.MoveFirst

While Not rs.EOF
With rs
ss = Second(.Fields!Hora)
mm = Minute(.Fields!Hora)
hh = Hour(.Fields!Hora)
dia = Day(.Fields!Fecha)
Party = .Fields!Segundos

End With

For a = 1 To Party
Tabla1(dia, hh, mm, ss) = Tabla1(dia, hh, mm, ss) + 1

ss = ss + 1
If ss = 60 Then
ss = 0: mm = mm + 1
End If
If mm = 60 Then
mm = 0: hh = hh + 1
End If
If hh = 24 Then
hh = 0: dia = dia + 1
End If
If dia = 32 Then
dia = 1:
End If

Next a

rs.MoveNext
Wend

For Zap = 1 To 31
For Zep = 0 To 24
For Zip = 0 To 60
For Zop = 0 To 60
If Tabla1(Zap, Zep, Zip, Zop) > 0 Then
rs2.AddNew
With rs2
.Fields!dia = Zap
.Fields!Hora = Zep
.Fields!Minutos = Zip
.Fields!Segundos = Zop
.Fields!Canales = Tabla1(Zap, Zep, Zip, Zop)
End With
rs2.Update
End If
Next Zop
Next Zip
Next Zep
Next Zap

rs.Close: rs2.Close
MsgBox ("Fin de Ejecucion de Script")

No hay comentarios: