#3GSIM R10D
#The formulas below are taken from the CPI DOCUMENT: RADIO NETWORK KPI  120/1553-HSD 101 02/6
#0) More information on formula syntax: http://doc.itk.ericsson.se/binder/current/html/ItkViewGuide/07_FormulaFiles.html
#1) Any text starting with a '#' is treated as a comment and discarded
#2) Each formula is split into the formula result variable name (part before the '=' sign) and the formula expression (the part after the '=' sign).
#3) Any reference in the formula expression to a counter name of other formula name is replaced by a perl variable reference
#4) The special names sum_<countername>, sum_time_<countername> and sum_mo_<countername> are replaced by a perl reference to variable containing counter aggregates:
#      - sum_<countername>: Returns the sum of counter 'name' across the time and object domains. 
#      - sum_time_<countername>: Returns the sum of counter 'name' across the object domain for the current time. 
#      - sum_mo_<countername>:   Returns the sum of counter or field 'name' across the time domain for the current MO. 
#5) Each formula expression is then evaluated using perl 'eval'. This means that the syntax of the expressions is the same as that of perl - you can use any perl operators & functions.
#6) If a formula is referenced within another formula, it has to be defined higher up in the file.
#7) The formula names should not start with "pm"

# Activity cycles and call calculations #

ActivityCyclesSuccessRatio = pmUeActivityCyclesSuccess / pmUeActivityCycles

FailedActivityCycles = pmUeActivityCycles - pmUeActivityCyclesSuccess

TotalPsCalls = pmUepsPDP1SuccessfulDeactivation + pmUepsPDP2SuccessfulDeactivation + pmUepsPDP3SuccessfulDeactivation + pmUepsSecondaryPDPSuccessfulDeactivation

SuccessfulPsCallsRatio = pmUepsSuccessfulPSCalls / TotalPsCalls 

FailedPsCalls = TotalPsCalls - pmUepsSuccessfulPSCalls

TotalCsCalls = pmUeEmergencyDisconnect + pmUeEmergencyRelease + pmUeDisconnect + pmUeRelease

SuccessfulCsCallsRatio = pmUecsSuccessfulCSCalls / TotalCsCalls

FailedCsCalls = TotalCsCalls - pmUecsSuccessfulCSCalls


# RRC calculations #

RrcSignConnRelIndsActivityCyclesRatio = pmUeRrcSignallingConnectionReleaseIndications / pmUeActivityCycles

RrcConnSetupCompletesConnRequestsRatio = pmUeRrcConnectionSetupCompletes / pmUeRrcConnectionRequests

RrcConnSetupCompletesConnSetupsRatio = pmUeRrcConnectionSetupCompletes / pmUeRrcConnectionSetups

RrcConnRequestsConnSetupCompletesRatio = pmUeRrcConnectionRequests / pmUeRrcConnectionSetupCompletes
 
RrcPagingSuccessRatio  = pmUeRrcPagingType2 / TotalCsCalls

RrcCellUpdateConfirmsCellUpdatesRatio = pmUeRrcCellUpdateConfirms / pmUeRrcCellUpdates

RrcActSetUpdateCompletesActSetUpdatesRatio = pmUeRrcActiveSetUpdateCompletes / pmUeRrcActiveSetUpdates

RrcUraUpdateConfirmsUraUpdatesRatio = pmUeRrcUraUpdateConfirms / pmUeRrcUraUpdates

RrcAddedRlsInSoftHOAddedRlsInSofterSoftHORatio = pmUeRrcAddedRlsInSoftHandover / ( pmUeRrcAddedRlsInSofterHandover + pmUeRrcAddedRlsInSoftHandover )

RrcIfhosOnCchSuccessIfhosOnCchAttemptsRatio = pmUeRrcIfhosOnCchSuccess / pmUeRrcIfhosOnCchAttempts

RrcIfhosOnDchSuccessIfhosOnDchAttemptsRatio = pmUeRrcIfhosOnDchSuccess / pmUeRrcIfhosOnDchAttempts

RrcIfhosOnEulHsSuccessIfhosOnEulHsAttemptsRatio = pmUeRrcIfhosOnEulHsSuccess / pmUeRrcIfhosOnEulHsAttempts

RrcConnSetupsOnNewFreqConnRejWithFreqInfoRatio = pmUeRrcConnectionSetupsOnNewFrequency / pmUeRrcConnectionRejectsWithFrequencyInfo

# RLC calculations #

RlcPSSentRetransmissionsSentBytesRatio = 42 * pmUepsRlcSentRetransmissions / pmUepsRlcSentBytes

RlcPSReceivedBytesExpectedReceivedBytesRatio = pmUepsRlcReceivedBytes / pmUepsRlcReceivedBytesExpected

RlcPSSentBytesExpectedSentBytesRatio = pmUepsRlcSentBytes / pmUepsRlcSentBytesExpected

RlcCSReceivedCorruptPacketsReceivedPacketsRatio = pmUecsRlcReceivedCorruptPackets / pmUecsRlcReceivedPackets

RlcCSLostPacketsReceivedPacketsRatio = pmUecsRlcLostPackets / pmUecsRlcReceivedPackets


# TCP calculations #

TcpClientSentBytesServerReceivedBytesRatio = pmPdgTcpClientSentBytes / pmPdgTcpServerReceivedBytes

TcpServerSentBytesClientReceivedBytesRatio = pmPdgTcpServerSentBytes / pmPdgTcpClientReceivedBytes

TcpClientSentBytesClientSentBytesExpectedRatio = pmPdgTcpClientSentBytes / pmPdgTcpClientSentBytesExpected
 
TcpServerSentBytesServerSentBytesExpectedRatio = pmPdgTcpServerSentBytes / pmPdgTcpServerSentBytesExpected  

########################
#CPP FORMULAS
########################
include $moshelldir/commonjars/pm/FORMULA_CPP_0.txt
