## 5 Experimental Results
### Part I--Results of Weighted Sum Optimization  
In this part, the search efficiency and reliability of this GA-based framework is tested. The performance metrics in terms of energy consumption, packet loss and packet delay are from our SystemC-based simulation which has 30 Telos nodes, 10 Hz sampling rate, 32 bytes payload in each data packet, and 4 s of simulation time and each sensor node transmits the data to the common sink node. The three performance metrics are modeled into a linear weighted sum cost function as the trade-off optimization method, to find the best optimal performance weighted sum value via the tuning of unslotted algorithm's parameter configuration. Finally, the GA-based optimizations are compared with the time-consuming full/exhaustive simulations (simulations on all possible solutions) in terms of efficiency and results. The weighted sum cost function is derived from (Equation (4)) and given as follows:  
\[ \begin{split} CostFcn_{(_{Performance})}=& 1\cdot(nodeConsumedEnergy/TotalEnergy)+...\\ & 1\cdot(PktLoss/TotalSensedPkt)+...\\ & 1\cdot(SucPktLatency/(2*SampleInterval))\end{split}  \tag{7}\]  
In this test, the same importance is given to the three metrics with each weight vector as 1. Percentage numbers are used for the performance metrics to reduce the impact of the metrics' contribution in the weighted sum. Here, _TotalEnergy_ is given as 250 _mJ_ (in the experiment, the maximum energy will not exceed 250 _mJ_). The use of twice the sample interval is because latency  
Figure 6: Unslotted CSMA/CA algorithm model. could sometimes exceed 100 _ms_ (1*Sample Interval) when longer backoff wait time happens, which can be caused by the use of larger _BE_ value. The GA implemented in MATLAB R2012a has been integrated in the iMASK framework and used for the parameter tuning in the experiment. The parameters of the unslotted algorithm are all integers rather than real numbers. Although MATLAB R2012a has a built-in integer number based optimization support, it provides limited configuration options. Namely, if integer optimization is applied, many commonly used options cannot be configured, such as the settings of _CreationFcn_, _SelectionFcn_, _CrossoverFcn_, _MutationFcn_, _EliteCount_, and _CrossoverFraction_ are all unavailable in integer problems according to the user guide. Therefore, the default real number optimization is used in our experiments but with custom functions like _CreationFcn_ and _MutationFcn_ to produce integer individual parents and integer mutation children, in which the evaluation can proceed totally based on integer optimization while at the same time all the options in GA can be configured according to the problems at designers' hands. In addition, the typical data sensing start point of each node is randomly generated by feeding with different seed values, but it could also be fixed with the same sensing start time. Since the different random sensing start time of the data can affect the network condition (even with the same combination of protocol parameters), the final performance results could be different. Hence, fixing the same data starting time can avoid such unpredictable elements and helps GA to effectively search the parameter space for the best performance exploration. The fixed starting point can be controlled by employing a set of fixed seeds (four different seeds are used for four parallel simulations, four runs for the average simulation result), which ensures that under each parameter combination case every node starts to generate the data at the same instant. This approach is typically used to reproduce the given result, and here enables the comparison between optimization results and exhaustive/full simulation results to validate the efficiency of GA's searching ability under the proposed iMASK framework. The comparison results are shown in the following part.