# Build-Launch-Consolidate Framework and Toolkit for Impact Analysis on Wireless Sensor Networks
## 3 Framework Overview
### Builder  
The builder facilitates the experiment setup by allowing the definition of different node/mote types and their position for the simulation to ensure the provision of customized and replicable experiments. To achieve this, the builder utilizes CSC files saved by Cooja simulation (which includes XML descriptors of the simulation environment). Each simulation file contains full configuration data, such as required Cooja extensions, simulation parameters, and information about each mode, such as type and position, as illustrated in Figure 3. In addition, the simulation file includes pointers to Contiki process source files that run for each mode type, allowing the builder to build the simulation with the correct source files for each type of node. The CSC file also includes exact coordinates for each mode as it is placed in the simulation hyperplane. The builder tool can be used either to position each node programmatically or to use prebuilt methods to build two classes of layouts, which are (1) a binary layout, where each node extends the network's coverage to a maximum of two additional nodes, and (2) a grid layout, where nodes are structured such that they are arranged in columns and rows. Both layouts are implemented by default, but the builder can still be scaled to accommodate different layouts and topologies. Both layouts offer contradicting trade-offs as the binary layouts favor covering a larger area with a finite set of devices, whereas the grid maximizes redundancy because it avails more paths to the sink for each node at the cost of the area covered. The aim is to obtain more comprehensive insights of our experiment by expanding its scope to cover two contrasting layouts that may exhibit contrasting behavior and produce different results. Figure 4 shows how our builder determines the coordinates of each node recursively, based on a previously generated one through the illustrative arrows. In our implementation, nodes in the binary layout are characterized by having a maximum of one potential parent. The distance between the nodes \((d)\) is fixed as the maximum distance for transmission range, and the angle where nodes branch is a constant 90\({}^{\circ}\). The builder tool is capable of generating such networks recursively. Each node branches with two new child nodes, noting the angle of the branch vector. The coordinates for the child nodes created at each branch are calculated algebraically based on their parent's coordinates and the angle of the parents' branch vector. Before introducing a new node to the network, the prebuilt graph is traversed to ensure that the node to be added is not close to any other node (besides  
Figure 3: CSC XML structure highlighting fragments generated by our builder. its parent) to avoid cycles and enforce the binary layout rule. If another node is found in proximity, the new node is not added, leaving its parent with only one child. However, the grid layout is characterized by its grid-like distribution. In our approach, central nodes will have up to eight neighbors and potential parents. Our builder can have the node at the edge of the layout or position it toward the center. Provided with the number of rows and columns, the builder will build the network by generating coordinates for each node until the network is fully built. It is worth noting that the distance is shorter among vertically and horizontally adjacent nodes compared to diagonally adjacent nodes. Because the distance between a node and its diagonal neighbors is equal to \(d\) (the maximum distance), the builder uses basic trigonometry to calculate the distance between a node to its other neighbors, which is \(d/\sqrt{2}\). Both layouts can be adjusted programmatically with manually specified coordinates. Further, the user may use direct access to functions for branching at specific points, allowing for more hybrid topologies to be created and merged. Further, the user can specify which nodes run which source file.