## 3 A Generalized Approach for Multiple Event Types
### Simulations  
In this section, we compare the performance of our _Pricing System_ with FIFO. Note that the results shown here also apply to other tail dropping active queue management algorithm such as RED. We consider total throughput, throughput per class, fairness and \"value\" as the performance metrics for the performance comparison. In a multihop wireless network, \(\sum_{i=1}^{N}h_{i}\) indicates the capacity of network, where \(N\) is the number of packets successfully received at the destination node, and \(h_{i}\) is the number of hops traversed by packet \(i\) from source to destination. The implicit assumption is that all packets are equally important. In this study, we consider a WSN with several classes of packets with different priorities. We use price \(R_{i}\) in our _Pricing System_ to indicate the relative priority of packet \(i\). Based on this, we define the new metric \"value\" as \(\sum_{i=1}^{N}R_{i}*h_{i}\), where \(R_{i}\) is the price of packet \(i\) and \(h_{i}\) is the number of hops traversed by packet \(i\) from source to destination. The higher the \"value\", the more information is collected from the WSN. We evaluate the correctness and performance of our algorithm using a chain topology and a random topology. The chain topology is used as a base case to analyze and validate the results. In the simulations, IEEE 802.11 is used at the MAC/PHY layer, AODV is used as the routing protocol in the network layer, UDP is set as the transport layer protocol and CBR traffic source is used in the application layer. The chain scenario consists of five nodes in a linear topology with equal distance between nodes. Node 1 is the sink and all packets generated by node 5 pass through nodes 4, 3, 2 to reach node 1. Node 5 generate _Non-Event_ packets and three types of _Event_ packets with price 2, 4, and 8 units, respectively. In order to explicitly evaluate the performance of our algorithm, we set \(Q_{min}\) and \(Q_{max}\) to \(0\) so that our optimization algorithm is always active during the simulation. Results are shown in Figure 12 to Figure 15. The x-axis in all the figures is packet generation rate which is set to be the same for all the four (_Non-Event_ and three _Event_) types of packets. From Figure 12 we can see that for FIFO which does not differentiate the packets, the throughput of different _Event_ packets and _Non-Event_ packets are almost the same. For our _Pricing System_, type 3 _Event_ packets have the highest throughput since they have the highest price; type 1 _Event_ packets have the lowest throughput since they have one fourth of type 1 price and one half of type 2 price. No  
Figure 12: Throughput of multiple types of packets for chain topology. _Non-Event_ packets are received by the sink since they are all dropped. We set \(Q_{max}\) equal to \(0\) as to explicitly test our optimization algorithm, therefore, all _Non-Event_ packets are dropped. We also find that the throughput of the type 1 _Event_ in the Pricing System is less than that of FIFO. Since the total throughput of the network is fixed, the increased throughput of type 3 decrease the throughput of type 1. The total throughput is shown in Figure 13.  
From Figure 13, we can see that the throughput increases with packet generation rate until the network capacity is reached at which point it saturates. We can also see that the total throughput of FIFO and our _Pricing System_ has the same trend. However, the total throughput of our Pricing System is lower than that of FIFO because both \(Q_{min}\) and \(Q_{max}\) are \(0\). Consequently, the queue utilization is lower. But the total throughput should be almost the same for FIFO and Pricing System, which can be seen from our random topology simulation where \(Q_{min}=1/3*QueueSize\) and \(Q_{max}=2/3*QueueSize\). To validate the design of our Pricing System, Figure 14 shows the the average \(P_{i}\) values of the received packets at the sink. Note that the \(P_{i}\) value in the sink means the successful transmission probability of packet to the sink.