Commit faa10180 authored by hammad zafar's avatar hammad zafar
Browse files

enhance algorithm for finding reduced signal strength according to user...

enhance algorithm for finding reduced signal strength according to user traffic in meep-vis-traffic-mgr
parent 3bc9a8b8
Loading
Loading
Loading
Loading
+7 −13
Original line number Diff line number Diff line
@@ -841,8 +841,7 @@ func (tm *TrafficMgr) PredictQosPerTrafficLoad(hour int32, inRsrp int32, inRsrq
	if err == sql.ErrNoRows {
		log.Error(err)
		log.Error("Could not find estimated user load in the " + TrafficTable + " table")
		// returning the same values for Rsrp and Rsrq received in request
		return inRsrp, inRsrq, err
		return 0, 0, err
	}

	// Get average PoA load throughout the day
@@ -888,21 +887,16 @@ func inTimeRange(hour int32) (key string) {
}

// Returns reduced signal strength based on the deviation in predicted user traffic from average user load in that area
// This is a simplistic version, considering only the user load in one particular area
// It will be extended to contain average user load for all active cells and those calculations will be used in further refining the algorithm
// The RSRP/RSRP values are reduced proportional to the difference between estimated users and average user traffic in a given POA
// Assumption: the RSRP/RSRP values remain unchanged for average POA traffic
func findReducedSignalStrength(inRsrp int32, inRsrq int32, users int32, averageLoad int32) (redRsrp int32, redRsrq int32, err error) {

	var propConstant float32

	// case: crowded area
	// Case: crowded area
	if users > averageLoad {
		log.Debug("The number of users: " + string(users) + "exceeds the overall average " + string(averageLoad) + "for this POA")
		diff := users - averageLoad
		propConstant = 1 / float32(diff)
		log.Debug("The original values of RSRP and RSRQ are %v and %v respectively", inRsrp, inRsrq)
		log.Debug("Reducing the values of RSRP and RSRQ with a factor of %v", propConstant)
		redRsrp = int32(propConstant * float32(inRsrp))
		redRsrq = int32(propConstant * float32(inRsrq))
		log.Debug("The original values of RSRP and RSRQ were " + string(inRsrp) + " and " + string(inRsrq))
		redRsrp = int32(float32(inRsrp) * (float32(averageLoad) / float32(users)))
		redRsrq = int32(float32(inRsrq) * (float32(averageLoad) / float32(users)))

		return redRsrp, redRsrq, nil