Class LocationBasedOptimalTPC


  • public class LocationBasedOptimalTPC
    extends TPC
    Location-based optimal TPC algorithm.

    Assign tx power based on an exhaustive search algorithm given the AP location.

    • Method Detail

      • getPermutationsWithRepetitions

        protected static List<List<Integer>> getPermutationsWithRepetitions​(List<Integer> choices,
                                                                            int n)
        Iterative way to generate permutations with repetitions.
        Parameters:
        choices - all the choices to be considered
        n - the number of items in a permutation
        Returns:
        the list of all the combinations
      • runLocationBasedOptimalTPC

        public static List<Integer> runLocationBasedOptimalTPC​(int sampleSpace,
                                                               int numOfAPs,
                                                               List<Double> apLocX,
                                                               List<Double> apLocY,
                                                               List<Integer> txPowerChoices)
        Get the optimal tx power for all the participant APs.
        Parameters:
        sampleSpace - the boundary of the space
        numOfAPs - the number of APs
        apLocX - the location x of the APs
        apLocY - the location y of the APs
        txPowerChoices - the tx power options in consideration
        Returns:
        the tx power of each device
      • computeTxPowerMap

        public Map<String,​Map<String,​Integer>> computeTxPowerMap()
        Description copied from class: TPC
        Compute tx power assignments. This is the core method of this class.
        Specified by:
        computeTxPowerMap in class TPC
        Returns:
        the map of devices (by serial number) to radio to tx power