# A New Dynamic Game-Based Pricing Model for Cloud Environment
## 4 The Proposed Game-Based Pricing Method
### The Game's Components  
The game consists of two players. The first player is the user, and the second is the cloud service provider. The possible actions (action set) for each player are defined as follows: The first player can select between different \(n\) virtual machines offered by the provider (\(\{VM_{1},VM_{2},\ldots,VM_{n}\}\)). The price of each virtual machine depicted will be provided, and the set of actions available to the second player is the range \([0,P_{0}]\), where \(P_{0}\) represents the highest price that the user is willing to pay for the service. The user decides so they can get the required quality of service at the lowest cost. However, the cloud provider chooses the proper price such that it can maximize its profit. Therefore, the utility (payoff) functions of the players can be defined as follows:  
**Definition 1**. : _The Cloud Provider's (CP) usefulness for action \(P_{i}\) of the cloud provider and action \(VM_{j}\) of the user is calculated using Equation (1)._  
\[\pi_{cp}\big{(}VM_{j},\ P_{i}\big{)}=P-(FP\times P) \tag{1}\]  
_where parameter \(FP\) indicates the probability that the user's task faces a failure during its execution and does not complete successfully; parameter \(P\) is calculated based on the following equations:_  
\[P=\bigg{(}rq+\frac{Q_{i}}{Q_{0}}\bigg{)}\times P_{i}TW \tag{2}\]  
\[Q_{i}=\alpha\ P_{i}+\beta \tag{3}\]  
\[W=w_{1}\frac{Requested\_Processing\_power}{Default\_Processing\_Power}+w_{2} \frac{Requested\_Memory\_size}{Default\_Memory\_size} \tag{4}\]  
In Equation (3), the parameter \(Q_{i}\) signifies the quantity of users who are requesting the service at the price \(P_{i}\) and \(Q_{0}\) represents the maximum market demand in terms of the number of customers for the cloud services when the price is set to zero. Figure 2 illustrates  
Figure 1: The architecture of cloud computing system. the relationship between demand and price. When the number of users applying for cloud resources is high, the provider can also raise the bid price. Conversely, when the number of applicants decreases, the price should also be lowered to attract more customers [17]. The \(Q_{i}\) parameter is considered for this purpose and is calculated using Equation (3). The value of the \(\alpha\), \(\beta\), and \(Q_{0}\) parameters can be determined by studying the demand-and-supply relationship for the cloud services in the market. It should be noted that the value of the \(\alpha\) parameter is less than zero (\(\alpha<0\)). The \(rq\) parameter is a coefficient to make a difference in the cost of using expensive hardware over the low-cost one. Parameter \(T\) indicates the duration of the resource usage. The cost of using the resource would be higher if the duration of resource usage is longer. The \(P_{i}\) parameter specifies the price for a virtual machine with the default processing power and memory amount. If the user requests a virtual machine with different processing power or memory amounts, the price of the virtual machine should be adjusted according to the amount of resources consumed. This adjustment is completed by the use of parameter \(W\). The value of the \(W\) parameter is calculated based on Equation (4). This parameter assists in determining the price by considering the quantity of resources used. The more requested resources will cost more. The \(w_{1}\) and \(w_{2}\) parameters represent the weight of two memory and processing element resources in the final price of the virtual machine and can be set by the cloud provider. **Definition 2**. : _The utility of the user (customer) corresponding to action \(P_{i}\) of the cloud provider and action \(VM_{j}\) of the user themself is computed based on Equation (5):_  
\[\pi_{u}\big{(}VM_{j},\ P_{i}\big{)}=Budget-C \tag{5}\]  
_where the Budget parameter indicates the money that is available to the user and parameter \(C\) represents all costs required to provide the service (the user's final payment amount).