In this project, we are going to create an ad-hoc communications network over a large rectangular region.
This class generates the overall desired coverage. We will build towers on top of each network.
To build a Network object, we can initialize by calling: n = Network(w, h) where w is the desired width and h is the desired height of the coverage.
This class stores each tower as an object. Objects can be generated by using t = Tower() or for a given network net, one can use net.buildTower() to build one tower, or net.buildNTower(n) to build n towers.
By default, the width, height and the position are randomly generated. If the user want to manually set the values(in order to test), one can call t.setInfo(x, y, w, h) to assign specified values. Or for net, use net.buildSpecialTower(x, y, h, w) to build a tower with specified values.
Given an overall desired coverage footprint and a sequence of n communications towers, what is the resulting resolved coverage?
generateNetwork(w, h, towers) will take in the desired network of width w and height h and a list of specified valued towers in the format of (x, y, w, h). Here x, y are the coordinates of bottom-left corner.
This function will visualize step-by-step of tower building process and will return the final resolved area, coverage fraction and the gap.
What is the total area of coverage relative to the desired total coverage area of the original footprint? That is, are there any gaps in coverage?
generateRandomNetwork(w, h, n) will take width w, height h and an integer n which represents the desired number of towers to build on the network. Same as the previous function, the function will visualize step-by-step of tower building process and will return the final resolved area, coverage fraction and the gap.
On average, how many communications towers are required before full coverage is obtained?
findAverageFull(W, H, N) will take in the upper bound of width W, upper bound of height H and number of iterations N for each pair of (w, h). The visualization of the results will be a heat map showing the average number of towers needed.