## 4 Reputation Model
### The Reputation Model  
The basic information of the reputation model is represented by the feedback: once two SOs (SO\({}_{i}\) and SO\({}_{j}\)) have interacted for a resource **r**, then each SO releases feedback in the range of \([0,1]\subset\mathbb{R}\) to the edge agent **e**. Then, let **r** be a resource, let F\({}_{(i,j)}\) be the feedback computed by SO\({}_{i}\) about SO\({}_{j}\), and let F\({}_{(j,i)}\) be the feedback computed by SO\({}_{j}\) about SO\({}_{i}\). Then, the trust agents \(t_{i}\) and \(t_{j}\) will send the respective \(F_{(i,j)}\) and \(F_{(j,i)}\) to the edge agent e to update the reputation scores of the two agents. The feedback is combined in a parameter \(\delta\) called \"Interaction\", which also takes into account the economic relevance (\(\delta\)) of the resource **r**, the frequency (\(\phi\)) of the interactions that occurred between two SOs, and a parameter (\(\xi\)) related to the trustor's reputation. Therefore, the effect of an interaction that occurred between SO\({}_{i}\) and SO\({}_{j}\) for a given resource r is represented by the following formula (1):  
\[\phi_{i,j}=f\big{(}\delta_{i,j},\phi_{i,j}\big{)}\cdot\xi_{j}\cdot F_{j,i} \tag{1}\]  
where the economic relevance (\(\delta\)) is defined by  
\[\delta= \begin{cases}0,&\text{if}\quad p=0\\ \dfrac{p}{P_{\text{Max}}},&\text{if}\quad 0<p\leq P_{\text{max}}\\ 1,&\text{if}\quad p>P_{\text{max}}.\end{cases}  \tag{2}\]  
where \(p\) is the price of the resource and \(P_{max}\) is the price threshold. The frequency of interactions (\(\phi\)) was designed to limit collusive activities carried out by two or more SOs to increase their reputations by mutually providing positive feedback. \[\phi= \begin{cases}1,&F<0.5\\ \mu\ ^{-1},&F\geq 0.5\end{cases}  \tag{3}\]  
The value of \(\phi\) will be set to 1 in the presence of negative feedback (F < 0.5); conversely, it will be computed as the inverse of the parameter \(\mu\), which, in turn, is defined by the time interval with which the SOs mutually provide feedback about each other (preliminarily set to 1 and \(\mu\in[0,1]\subset\mathbb{R}\)). \[\mu= \begin{cases}\max\left(1,\mu^{\text{old}}\right),&\Delta t<T\\ \max\left(1,\mu^{\text{old}}-\dfrac{\Delta t}{T}\right),&\Delta t\geq T.\end{cases}  \tag{4}\]  
In the above equation, **T** is a time threshold defined at the application level. The function \(f(\delta,\phi)\) returns a value in the domain \([0,1]\subset\mathbb{R}\) and is designed to limit potential collusive and alternate activities between two SOs by penalising all iterationscharacterised by a low or null relevance of the resource and a high value of the frequency parameter. \[f(\delta,\phi)= \begin{cases}\sqrt{\delta^{z}+\phi^{z}},&\text{if}\quad f(\delta, \phi)\leq 1\\ 1,&\text{otherwise}\end{cases}  \tag{5}\]  
The parameter \(z\) defines the behaviour of \(f(\delta,\phi)\), and its value for best performance was obtained for \(z=1.35\). The value of the parameter \(\xi\), that is, the trustor's relevance, is computed based on the trustor's reputation using a step function ruled by the system threshold \(\sigma\in[0,1]\subset\mathbb{R}\) and is a parameter of the reputation model. \[\xi= \begin{cases}1,&\text{if}\quad R\geq\sigma\\ 0,&\text{otherwise}.\end{cases}  \tag{6}\]  
The feedback \(F\) is released by the trustor about the trustee in the domain \([0,1]\subset\mathbb{R}\) based on its satisfaction degree concerning both the SO's honesty and the quality of the interaction that occurred, which, in turn, also depends on the resource \(r\). Once that parameter \(\vartheta_{i,j}\) for the resource \(r\) has been computed, the reputation of SO\({}_{i}\) and SO\({}_{j}\) is updated, but only when the condition \(\vartheta>0\lor R^{new}\geq 0.5\) is satisfied. \[R_{i}^{\text{new}}= \begin{cases}\alpha\cdot R_{i}^{\text{new}}+(1-\alpha)\cdot \vartheta_{i,j},&\vartheta_{i,j}>0\lor R_{i}^{\text{new}}\geq 0.5\\ R_{i}^{\text{new}},&\text{otherwise}\end{cases}