## 5 Experimental Results
### Scenario  
The following is a scenario of a use case in which score/distance are calculated using the Haversine formula to form a recommendation.  
* The user, a client, lives in Tunisia City (latitude: 40.7128, longitude: \(-\)74.0560).
* The user needs a store recommendation; three stores have the following ratings and locations:
* Store Shop AA: intermediate rating by similar customers (4.5), located in Ariana (latitude: 40.6782, longitude: \(-\)73.9442);
* Store Shop BB: intermediate rating by similar customers (4.0), located in Ben Arous (latitude: 40.7831, longitude: \(-\)73.9712);
* Store Shop CC: intermediate rating by similar customers (3.5), located in Manouba (latitude: 40.7282, longitude: \(-\)73.7949).  
Suppose a user x is in location (\(\phi\)x/x), and we want to recommend a product y located at (\(\phi\)y,\(\lambda\)y) in Equation (1):  
Calculate the prediction of customer ratings:  
\[\bar{r}_{x,y}=\overline{r}_{x}+\frac{\sum v\in N(x)sim(x,v).(r_{v,y}-\overline {r_{v}})}{\sum_{v\in N(x)}sim(x,v)} \tag{1}\]Using Equation (2), the Haversine theorem may be applied to calculate the distance:  
\[d_{x,y}=2r\arcsin\left(\sqrt{\sin^{2}\left(\frac{\beta_{y}-\beta_{x}}{2}\right)} +\cos(\beta_{x})\cos\left(\beta_{y}\right)sin^{2}\left(\frac{\alpha_{y}-\alpha_ {x}}{2}\right)\right) \tag{2}\]  
Considering the two places' longitude and latitude, the Haversine formula can be used for determining the distance between them (d), where r = 6371 km.  
In Equation (2), \(\beta,\alpha\) are latitude and longitude.  
The distance from Tunisia to Shop AA (Ariana) is as follows:  
\[\beta_{x}=40.7128,\ \alpha_{x}=-70.0060\]  
\[\beta_{\rho}=40.6782,\ \alpha_{\rho}=-73.9442\]  
\[\Delta\beta=\frac{\pi}{180}*(40.6782-40.7128)=-0.0006010\ \mathrm{radians}\]  
\[\Delta\alpha=\frac{\pi}{180}*(-70.0060+73.9442)=0.001078\ \mathrm{radians}\]  
\[\rho=\sin^{2}\left(\frac{\Delta\beta}{2}\right)+\cos\left(40.7128*\frac{\pi}{ 180}\right)*\cos\left(40.6782*\frac{\pi}{180}\right)*\sin^{2}\left(\frac{ \Delta\beta}{2}\right)\]  
\[\rho=0.00000009+0.7544\times 0.7543\times 0.00000029=0.00000009+0.000165=0.00016509\]  
\[c=\arcsin\left(\sqrt{0.00016509}\right)=0.0008126\]  
\[d_{x,\rho}=6371\times 0.0008126=5.17\ \mathrm{km}\]  
The distance from Tunisia to Shop BB (Ben Arous): 3.92 km.  
The distance from Tunisia to Shop CC (Manouba): 7.88 km.  
To calculate the score for recommendations, we can use Equation (3).  
\[score(x,y)=\delta\bar{r}_{x,y}+\sigma\left(\frac{1}{1+d_{x,y}}\right) \tag{3}\]  
In Equation (3), \(\delta\) and \(\sigma\) are height balancing, the score prediction, and the distance item.  
According to the equation, \(\delta\) = 0.7 and \(\sigma\) = 0.3.  
Shop AA:  
\[score(x,y)=0.7*4.5+0.3\left(\frac{1}{1+5.17}\right)=\approx 3.20\]  
Shop BB:  
\[score(x,y)=0.7*4.0+0.3\left(\frac{1}{1+2.92}\right)=\approx 3.90\]  
Shop CC:  
\[score(x,y)=0.7*3.5+0.3\left(\frac{1}{1+7.88}\right)=\approx 2.50\]  
From the results we obtained the best recommendations, which are shown below:  
Store AA: Score = 3.20.  
Store BB: Score = 2.90.  
Store CC: Score = 2.50.  
So, Shop AA in Ben Arous is the recommended decision for the customer. Combining mobile agents with Geographic Information Systems, these equations can provide individualized, location-aware suggestions for online purchases, as shown in Figure 7.