**3. Proposed model**

This Section discusses the proposed model addressing all proposed model components. First will address basic concepts of the model. Section 3.1 addresses the QoC metric and Section 4 addresses the QoE metric used in this work. In our work, it is proposed that the QoE is considered a utility function determined from QoC correctness parameter.

The model proposed in this work approaches QoE based on the concepts of resource utility when an application is submitted to a distributed system. The concepts of QoE applied, and the relationship between QoE and utility, are explained in Section 4. Is important to mention that application classes have a strong relationship with the concept of utility since each class has different needs regarding which resources they use on a larger scale. In this sense, the main information that a user describes refers to the application class. The classes referring to the application features are presented as follows: serial applications; parallel applications; network-oriented applications; CPUoriented applications; I/O and storage-oriented applications.

### **3.1 QoC parameters**

### *3.1.1 Correctness*

In our work, the QoC is used to verify how much a given context is in accordance with what is being demanded by the application. As mentioned earlier in the introductory section of this chapter, the model proposed in this thesis meets different classes (or categories) of applications, each class is characterized by a different need for resources. Therefore, the parameter *correctness*, or correctness, provides a quantitative reference to determine if the current context of a particular resource is suitable to serve an application taking into account its category.

To obtain the value of QoC, an approach based on Bayesian probability theory is proposed. This approach is inspired and adapted from the solution proposed by [10]. The Bayesian probability combines information in a way that relates observed events to hypotheses. In other words, Bayes' theorem is used to calculate the probability conditional that a given event occurs given an observation. For example, calculation of the probability of overhead in allocating an amount *cpi* of processes in a given node of a computational grid, in which an amount *cpj* of processes available in that node was observed.

Proposed approach, aims to calculate the QoC using conditional probability from the contextual information specified in each submission of *job*, and from the status system update. A *job* is understood as a set of specifications for the execution of a certain task, these specifications being conditional on each other. For example, if context information reveals that the system has processes available in order to provide a processing rate *x* to execute a *job1*, it is also necessary to know the exact number of processes available to meet the application's execution flow. In other words, if the context manager determines the availability of a certain CPU rate for processing, it is also necessary to know if there are processes available to fulfill the request of *job1*.

In addition to the application demand, the approach proposed in this work aims to manage the workload exerted on the system. Therefore, one of the main functions delegated to the context manager is to collaborate for context-driven load balancing. Eq. (1) determines the probability that a given demand for a resource will be met without generating overload. Eq. (1) expresses the probability that a given demand *cpi* for a resource *i* will overload a capacity node *cpj* . Thus, the probability of the resource executing properly is determined by the completeness of Eq. (1). Therefore, the QoC for the resource *i* considering the available capacity *cpj* is given by Eq. (2). The QoC defined in Eq. (2) is actually the partial correctness, considering only an amount of resource of type *i* on a single node *j*, named as *QoCi*∣*<sup>j</sup>* just to facilitate understanding. For partial correctness, calculation *QoCi*∣*<sup>j</sup>* is not considered the application class; therefore, the context for all resources described in *job* are calculated in the same way.

$$P\left(cp\_i|cp\_j\right) = \frac{P\left(cp\_j|cp\_i\right) \* P(cp\_i)}{P\left(cp\_j\right)}\tag{1}$$

$$QoE\_{(i|j)} = 1 - P\left(cp\_i|cp\_j\right) \tag{2}$$

#### *3.1.2 Probability for each required resource*

The probability for each required resource *CPi* is given in Eq. (3), where *ENVresource* is the total capacity of the environment to provide the required resource. The *ENVresource* is given by Eq. (4), where *n* is the number of provider nodes in distributed resource facilities.

$$P(cp\_i) = \frac{cp\_i}{ENV\_{response}}\tag{3}$$

$$ENV\_{reoun\epsilon} = \sum\_{j=0}^{n} CP\_j \tag{4}$$

*A Resource Allocation Model Driven through QoC for Distributed Systems DOI: http://dx.doi.org/10.5772/intechopen.106458*

The probability for each resource *CPj* is given in Eq. (5), where *AVRresource* is the average of total capacity of the environment to provides the required resource. The *AVRresource* is given by Eq. (6), where *n* is the number of provider nodes in distributed resource facilities.

$$P\left(cp\_j\right) = \frac{cp\_j}{\text{AVR}\_{\text{resources}}}\tag{5}$$

$$\text{AVR}\_{\text{resource}} = \frac{\sum\_{j=0}^{n} \text{CP}\_{j}}{n} \tag{6}$$

#### *3.1.3 Conditional probability*

The conditional probability that associates the required and the available amount of resource is defined in Eq. (7). The probability of a required resource *cpi* given an amount *cpj* is defined by the magnitude correlation between what was requested and what is available.

$$P\left(cp\_j|cp\_i\right) = \frac{cp\_i}{cp\_j} \tag{7}$$

#### *3.1.4 Conditional context parameter*

Eq. (1) determines context evaluation from Dependent Context Parameters (DCP) set. Thus, is possible to achieve Eq. (8), where *n* is the applications context parameters (*cpi* ). The set *CCP* Conditional Context Parameters resulting from the Eq. (8).

$$\text{CCP}(cp\_i) = \left\{ P\{cp\_i|cp\_j\}; j = \mathbf{1}..n \cap cp\_j \varepsilon \text{PDC}\_i \right\} \tag{8}$$

The correctness is calculated correlating *CPj*, *CPi*, and *n* for all context parameters that characterize *cpi* . The *QoC cpi* � � *<sup>k</sup>* is context association that characterizes *cpi* for kth CP. The Eq. (1) relates the application requirements with resources available resulting in Eq. (9) resulting in Eq. (15).

$$\text{QoE}\_{(ij)} = \mathbf{1} - \frac{P\left(cp\_j|cp\_i\right) \* P(cp\_i)}{P\left(cp\_j\right)}\tag{9}$$

The resulting correctines, Eq. (10), is obtained from resulting QoC.

$$\text{Correctimes} = \text{QoC}\_{(X|Y)} \tag{10}$$

$$\mathcal{Q}\rho \mathcal{C}\_{(X|Y)} = \mathbf{1} - \frac{P(X|Y) \* P(X)}{P(Y)} \tag{11}$$

$$\text{QoC}\_{(X|Y)} = \mathbf{1} - \frac{\frac{X^\*}{Y}\frac{X}{Z}}{P(Y)}\tag{12}$$

$$Q\mathcal{C}\_{(X|Y)} = \mathbf{1} - \frac{\frac{X^2}{Y^\*Z}}{\frac{Y}{\tilde{\pi}}} \tag{13}$$

*Ubiquitous and Pervasive Computing - New Trends and Opportunities*

$$Q\rho C\_{(X|Y)} = 1 - \frac{X^{2^\*}}{Y^2} \left. \frac{1}{N} \right. \tag{14}$$

Thus, the correctiness parameter for X amount of computation requested is defined by Eq. (15).

$$Correctness = 1 - \left(\frac{1}{N}\right) \* \left(\frac{X}{Y}\right)^2\tag{15}$$

The resulting QoC is given by Eq. (16), for all *CPj* potential associated with *CPi*, and from the number of all *n* possible CPs, where *m* is the number of parameters considered QoC resource *CPi*. The expression *QoC cpi* � � *<sup>k</sup>* is the k-th conditional element that characterizes the *job Ji*.

$$QoE(I\_i) = \frac{1}{m} \left(\sum\_{k=1}^{m} QoE(I\_i)\_k\right) \tag{16}$$

From the QoC, obtained in our model, it is possible to quantitatively predict the user's experience. The relationship between QoE and QoC proposed in our work is presented in the following section.
