Class LeastUsedChannelOptimizer

    • Field Detail

      • OVERLAP_WINDOW

        protected static final int OVERLAP_WINDOW
        The window size for overlapping channels.
        See Also:
        Constant Field Values
      • rng

        protected final Random rng
        The PRNG instance.
    • Method Detail

      • getSortedAPs

        protected static List<String> getSortedAPs​(Map<String,​List<WifiScanEntry>> deviceToWifiScans)
        Get the sorted APs list to determine the visit ordering.
        Parameters:
        deviceToWifiScans - the filtered and reorganized wifiscan results
        Returns:
        list of the name of the sorted APs
      • getOccupiedOverlapChannels

        protected static Map<Integer,​Integer> getOccupiedOverlapChannels​(Map<Integer,​Integer> occupiedChannels)
        Update the occupied channel info to include the overlapping channels (for 2.4G).
        Parameters:
        occupiedChannels - the current occupied channels info of the device
        Returns:
        map of channel to score/weight
      • getScanRespsByBandwidth

        protected List<WifiScanEntry> getScanRespsByBandwidth​(String band,
                                                              String serialNumber,
                                                              int channelWidth,
                                                              Map<String,​List<WifiScanEntry>> deviceToWifiScans)
        Get the wifiscan results based on the bandwidth info
        Parameters:
        band - the operational band
        serialNumber - the device
        channelWidth - the channel bandwidth (MHz)
        deviceToWifiScans - the filtered and reorganized wifiscan results
        Returns:
        the wifiscan results on the bandwidth-specific primary channels
      • getOccupiedChannels

        protected Map<Integer,​Integer> getOccupiedChannels​(String band,
                                                                 String serialNumber,
                                                                 int channelWidth,
                                                                 List<Integer> availableChannelsList,
                                                                 Map<String,​List<WifiScanEntry>> deviceToWifiScans,
                                                                 Map<String,​Map<String,​Integer>> channelMap,
                                                                 Map<String,​String> bssidsMap)
        Get the current occupied channel info of the device.
        Parameters:
        band - the operational band
        serialNumber - the device
        channelWidth - the channel bandwidth (MHz)
        availableChannelsList - the available channels of the device
        deviceToWifiScans - the filtered and reorganized wifiscan results
        Returns:
        map of channel to score/weight/# APs
      • getNewChannel

        protected int getNewChannel​(String band,
                                    String serialNumber,
                                    List<Integer> availableChannelsList,
                                    int currentChannel,
                                    Map<Integer,​Integer> occupiedChannels)
        Get a new/current channel for the device.
        Parameters:
        band - the operational band
        serialNumber - the device
        availableChannelsList - the available channels of the device
        currentChannel - the current channel of the device (for comparison)
        occupiedChannels - the occupied channels info of the device
        Returns:
        the new/current channel of the device