Class MeasurementBasedApApTPC
- java.lang.Object
-
- com.facebook.openwifi.rrm.optimizers.tpc.TPC
-
- com.facebook.openwifi.rrm.optimizers.tpc.MeasurementBasedApApTPC
-
public class MeasurementBasedApApTPC extends TPC
Measurement-based AP-AP TPC algorithm. TODO: implement the channel-specific TPC operation
-
-
Field Summary
Fields Modifier and Type Field Description static String
ALGORITHM_ID
The RRM algorithm ID.static int
DEFAULT_COVERAGE_THRESHOLD
Default coverage threshold between APs, in dBm.static int
DEFAULT_NTH_SMALLEST_RSSI
Default Nth smallest RSSI is used for Tx power calculation.-
Fields inherited from class com.facebook.openwifi.rrm.optimizers.tpc.TPC
DEFAULT_TX_POWER_CHOICES, deviceConfigs, MAX_TX_POWER, MIN_TX_POWER, model, zone
-
-
Constructor Summary
Constructors Constructor Description MeasurementBasedApApTPC(Modeler.DataModel model, String zone, DeviceDataManager deviceDataManager)
Constructor.MeasurementBasedApApTPC(Modeler.DataModel model, String zone, DeviceDataManager deviceDataManager, int coverageThreshold, int nthSmallestRssi)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static Map<String,List<Integer>>
buildRssiMap(Set<String> managedBSSIDs, Map<String,List<List<WifiScanEntry>>> latestWifiScans, String band)
Build a map from BSSID to a sorted (ascending) list of RSSIs from neighboring APs.protected void
buildTxPowerMapForChannel(String band, int channel, List<String> serialNumbers, Map<String,Map<String,Integer>> txPowerMap)
Calculate new tx powers for the given channel on the given APs .protected static int
computeTxPower(String serialNumber, int currentTxPower, List<Integer> rssiValues, int coverageThreshold, int nthSmallestRssi, List<Integer> txPowerChoices)
Compute adjusted tx power (dBm) based on inputs.Map<String,Map<String,Integer>>
computeTxPowerMap()
Compute tx power assignments.protected static Set<String>
getManagedBSSIDs(Modeler.DataModel model)
Retrieve BSSIDs of APs we are managing.static MeasurementBasedApApTPC
makeWithArgs(Modeler.DataModel model, String zone, DeviceDataManager deviceDataManager, Map<String,String> args)
Factory method to parse generic args map into the proper constructor-
Methods inherited from class com.facebook.openwifi.rrm.optimizers.tpc.TPC
getApsPerChannel, updateDeviceApConfig, updateTxPowerChoices
-
-
-
-
Field Detail
-
ALGORITHM_ID
public static final String ALGORITHM_ID
The RRM algorithm ID.- See Also:
- Constant Field Values
-
DEFAULT_COVERAGE_THRESHOLD
public static final int DEFAULT_COVERAGE_THRESHOLD
Default coverage threshold between APs, in dBm. This has been picked because various devices try to roam below this threshold. iOS devices try to roam to another device below -70dBm. Other devices roam below -75dBm or -80dBm, so a conservative threshold of -70dBm has been selected.- See Also:
- Constant Field Values
-
DEFAULT_NTH_SMALLEST_RSSI
public static final int DEFAULT_NTH_SMALLEST_RSSI
Default Nth smallest RSSI is used for Tx power calculation.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MeasurementBasedApApTPC
public MeasurementBasedApApTPC(Modeler.DataModel model, String zone, DeviceDataManager deviceDataManager)
Constructor.
-
MeasurementBasedApApTPC
public MeasurementBasedApApTPC(Modeler.DataModel model, String zone, DeviceDataManager deviceDataManager, int coverageThreshold, int nthSmallestRssi)
Constructor.
-
-
Method Detail
-
makeWithArgs
public static MeasurementBasedApApTPC makeWithArgs(Modeler.DataModel model, String zone, DeviceDataManager deviceDataManager, Map<String,String> args)
Factory method to parse generic args map into the proper constructor
-
getManagedBSSIDs
protected static Set<String> getManagedBSSIDs(Modeler.DataModel model)
Retrieve BSSIDs of APs we are managing.
-
buildRssiMap
protected static Map<String,List<Integer>> buildRssiMap(Set<String> managedBSSIDs, Map<String,List<List<WifiScanEntry>>> latestWifiScans, String band)
Build a map from BSSID to a sorted (ascending) list of RSSIs from neighboring APs. Every managed BSSID is a key in the returned map; if that BSSID does not have an RSSI for that AP, the BSSID is mapped to an empty list.- Parameters:
managedBSSIDs
- set of all BSSIDs of APs we are managinglatestWifiScans
-Modeler.DataModel.latestWifiScans
for data structureband
- "2G" or "5G"- Returns:
- a map from BSSID to a sorted (ascending) list of RSSIs from neighboring APs.
-
computeTxPower
protected static int computeTxPower(String serialNumber, int currentTxPower, List<Integer> rssiValues, int coverageThreshold, int nthSmallestRssi, List<Integer> txPowerChoices)
Compute adjusted tx power (dBm) based on inputs.- Parameters:
serialNumber
- serial number of the APcurrentTxPower
- the current tx power (dBm)rssiValues
- sorted (ascending) list of RSSIs from neighboring APscoverageThreshold
- desired value for thenthSmallestRssi
nthSmallestRssi
- which RSSI to use to "calibrate" to determine the new tx power- Returns:
- new tx power (dBm)
-
buildTxPowerMapForChannel
protected void buildTxPowerMapForChannel(String band, int channel, List<String> serialNumbers, Map<String,Map<String,Integer>> txPowerMap)
Calculate new tx powers for the given channel on the given APs .- Parameters:
band
- band (e.g., "2G")channel
- channelserialNumbers
- the serial numbers of the APs with the channeltxPowerMap
- this maps from serial number to band to new tx power (dBm) and is updated by this method with the new tx powers.
-
-