# An Actor-Based Formal Model and Runtime Environment for Resource-Bounded IoT Services +
## 5 The Proximity Model
### Properties and Propositions
There are two types of delay set by the client in this request, which tell the directory service about the following requirements: (i) the freshness of the sensed data; and (ii) the time ranges of receiving service updates from the server. The following definition describes the compatible delay tolerance of the sensing requests served by a single contributor service. Definition 5 (Compatible delay tolerance): The delay tolerances of multiple sensing requests, which are parts of contributor tuples, are compatible if the hosting contributor can opportunistically merge these requests to form one sensing group so that one optimal sampling instance would satisfy them all. **Axiom 6: Tolerant sensor sampling. ** If multiple sensing requests have compatible delay tolerances at a contributor \(c\), then \(c\) can opportunistically merge these requests to form one sensing group so that one optimal sampling instance would satisfy all of them. _Axiom 6_ serves as the foundation for our ShareSens approach [20]. It is used when the optimized sensing option has been selected. ShareSens assumes that requests pick from a limited number of sampling rates available, selected both to increase opportunity for sharing sampled data as well as to enhance the performance of the scheduling mechanism, which implicitly encourages selecting a delay tolerance when submitting a sensing request. The quality of service determines the cost/price of the service in our pricing model. ShareSens provides two options of quality of service for serving a sensing request when dealing with tolerant sensor sampling: (i) the same time lag delays all samples; or (ii) samples are provided within a range, but there is no promise to have an equal time distance between them. **Definition 6** (Contributor service ability). : _A contributor \(c\) indicates its ability to serve its part in \(\rho_{i}\), \(Z^{c}_{\rho_{i}}\), if \(c\) has the sensing capabilities to serve the requirements of \(Z^{c}_{\rho_{i}}\), and the sensing requests in \(Z^{c}_{\rho_{i}}\) can be served using a mix of the following options:_  
1. _Some sensing requests in_ \(Z^{c}_{\rho_{i}}\) _can join some of the sensing groups already being served at_ \(c\) _if the sensing schedule of those groups is not altered after the arrival of the incoming requests;_
2. _Some sensing requests in_ \(Z^{c}_{\rho_{i}}\) _can be merged with some of the sensing groups already being served at_ \(c\) _if they have compatible delay tolerances with those groups so that the existing sensing schedule at_ \(c\) _is altered in order to accommodate the incoming requests;_
3. _Some sensing requests in_ \(Z^{c}_{\rho_{i}}\) _are separately scheduled in a new sensing group._  
Choosing between the above options depends on the complexity of the reasoning process for accommodating the incoming requests. If the reasoning cost of option 2 is high, then it may be more efficient to use option number 3 directly. In other words, there should be a balance between cost effectiveness and the expected benefits. Therefore, optimizing the schedule has to be weighed against the benefits of the optimal schedule, which may depend on the duration of the sensing request. **Axiom 7: Opportunistic merging of sampling requests**. An incoming sensing request can partially or completely share the same sampling stream with a sensing group already being served at a contributor \(c\) if and only if it has a delay tolerance which is compatible with that group. **Definition 7** (Client tuple). : _A client tuple \(\zeta\) represents a single timed service feed, which is formally represented as:_  
\[\zeta=\langle Y,s,td,d_{\zeta}\rangle \tag{13}\]  
_where \(Y\) denotes an expression that is evaluated by the server to obtain the sensing task (i.e., the sensing parameters) which is carried out by the contributors. \(s\) represents the client service, \(td\) is the delivery time, and \(d_{\zeta}\) is the maximum time delay between the sensing time and the delivery time.