<commit_before>Introduction

For this assignment we introduced the fictional start-up CoolTech®, which provide wireless sensor networks for smart agriculture solutions. A client CSG Agriculture® want to reduce water usage of their irrigation system.

Methodology

In order to implement their system CoolTech® has devised a series of field test.
They will deploy a wireless sensor network (WSN) across a 100m^2 field. The WSN consist of a single base station node, and n sensor nodes( n>= 1). The sensor node will peridically sample the environment (for data such temperature, humidity etc), which it will attempt to transmit to the base station.

Using multiple base stations would probablity improve the performance of the  simulation and a real WSN however in reality we would probabily only deploy one due to environmental contraints(etc. wiring to a power source).


The WSN program

The nodes are networked together using the Collection Tree protocol(CTP). 
The main application logic is written inside CollectionTreeC.nc, the runtime behaviour of the application differs for sensor and base station nodes.

The base station node acts as the root of the collection tree, and accepts incoming packets from sensor node within the collection tree hierarchy, it would then attempt to read the packet and perform some analytics. For the simulation the analytics phase is ignored.

Sensor nodes periodically sample data from their sensors(for purpose of the simulation sensing values are spoofed) and transmit the data to the base station for "uint16_t SAMPLING_ROUND_LIMIT" iterations.
From this value we can estimate the theoretical maximum amount of packets that should be received per node.


The testing framework

The file test.py is the top level script used to run and analyse simulations. 

For usage instructions and installation  please refer to the README.md file.

Topology files

The LinkLayerModel program from the tinyos java support library is used to generate topology file which specifies which node connect to another node and the associated attenuation between the pairs. 


Analysis

valid for static and low-dynamic environments
http://www.tinyos.net/tinyos-2.x/doc/html/tutorial/usc-topologies.html


#Perform analytics

#Topologies
#MATPLOT LIB
#Star
#Grid
#Random<commit_msg>Updated report<commit_after>Introduction

For this assignment we introduced the fictional start-up CoolTech®, which provide wireless sensor networks for smart agriculture solutions. A client CSG Agriculture® want to reduce water usage of their irrigation system.

Methodology

In order to implement their system CoolTech® has devised a series of field test.
They will deploy a wireless sensor network (WSN) across a 100m^2 field. The WSN consist of a single base station node, and n sensor nodes( n>= 1). The sensor node will peridically sample the environment (for data such temperature, humidity etc), which it will attempt to transmit to the base station.

Using multiple base stations would probablity improve the performance of the  simulation and a real WSN however in reality we would probabily only deploy one due to environmental contraints(etc. wiring to a power source).


The WSN program

The nodes are networked together using the Collection Tree protocol(CTP). 
The main application logic is written inside CollectionTreeC.nc, the runtime behaviour of the application differs for sensor and base station nodes.

The base station node acts as the root of the collection tree, and accepts incoming packets from sensor node within the collection tree hierarchy, it would then attempt to read the packet and perform some analytics. For the simulation the analytics phase is ignored.

Sensor nodes periodically sample data from their sensors(for purpose of the simulation sensing values are spoofed) and transmit the data to the base station for "uint16_t SAMPLING_ROUND_LIMIT" iterations.
From this value we can estimate the theoretical maximum amount of packets that should be received per node.


The testing framework

The file test.py is the top level script used to run and analyse simulations. 

For usage instructions and installation  please refer to the README.md file.

Topology files

The LinkLayerModel program from the tinyos java support library is used to generate topology file which specifies which node connect to another node and the associated attenuation between the pairs. 

SQL

Analysis
Using the python script (test.py), we ran a number of simulation of our tinyos program. In each simulation we varied the topology of the network and the number of nodes.

We explore three different topological configuration; random, grid, uniform, this is because the LinkLayerModel program only provides these. While it is possible to run simulations for other topologies(i.e star, ring) the attenuation values would have to be provided manually, this is likely to cause errors.

To perform the analysis on the results of the simulation sql queries where ran on the dataset.
As mention beforehand the aim of the WSN program is to have each sensor mote peridically send data to the root mote in the collection tree a finite number of times. The sql query uses this fact to calculate the packet loss.

Using the formula

actual_no_packet_received_at_root/(number of nodes in experiment - 1) * expected no packets








valid for static and low-dynamic environments
http://www.tinyos.net/tinyos-2.x/doc/html/tutorial/usc-topologies.html


#Perform analytics

#Topologies
#MATPLOT LIB
#Star
#Grid
#Random
{'fraction_non_alphanumeric': 0.03059377262853005, 'fraction_numerical': 0.0030774800868935553, 'mean_word_length': 4.77324973876698, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1937517', 'n_tokens_mistral': 1308, 'n_tokens_neox': 1238, 'n_words': 811}