## 3 Design and Methodology
### On/Off Attack
\[\left\{\begin{array}{l}\textbf{if }\Pi\geq\mathrm{PC}^{\mathrm{O}^{2}} \textbf{and }\beta_{\mathrm{n}}^{\mathrm{t}}<\Pi\textbf{then }\mathrm{PO}^{2}=\Pi\times\mathrm{DR}\\ \textbf{else }\mathrm{PO}^{2}=1\\ \mathrm{IT}(\mathrm{CR})=\sum\limits_{\mathrm{i=1}}^{n-1}\frac{\alpha_{ \mathrm{i}}^{\mathrm{t}}(\mathrm{CR})+\mathrm{P}_{\mathrm{CR}}}{\left(\alpha_{ \mathrm{i}}^{\mathrm{t}}(\mathrm{CR})+\mathrm{P}_{\mathrm{CR}}\right)+\left( \beta_{\mathrm{i}}^{\mathrm{t}}(\mathrm{CR})+\mathrm{N}_{\mathrm{CR}}\times \mathrm{PO}^{2  
A novel solution is presented in this study to avoid collusion attacks; it involves computing three criteria that indicate distinct factors. Malicious recommendation detection (\(MRD\)) is the foremost criterion that identifies suspicious recommenders' groups by determining the probability that a group will be the collusion recommender's group. In this criterion, the time range of the collusion attack is calculated using the trust model to identify the time range of all attacks that have been carried out within a short period of time. If malicious recommenders have made any attacks on a particular user, there will be a very small time range of these attacks. The second criterion is then computed by the trust model: malicious recommenders' behavior (\(MRB\)). This indicates the similarity of malicious recommenders' behaviors, which are more similar when a particular user is attacked. The following Equation (4) is used to determine malicious recommendation detection (\(MRD\)) and malicious recommenders' behavior (\(MRB\)).  
\[\left\{\begin{array}{l}\textbf{for i = 1 to n}-1\\ \left\{\begin{array}{l}\textbf{if T(F_{n},CR)}^{FS}-T(F_{i},CR)^{FS}\leq TR\\ \textbf{and V(F_{n},CR)}^{FS}\geq V(F_{i},CR)^{FS}\textbf{and V(F_{n},CR)}^{FS}-V(F_{i},CR)^{FS} \leq\max VR\\ \textbf{then move}\left(F_{i},CR\right)^{FS}\textbf{form FS to SS}\\ \textbf{elseif T(F_{n},CR)}^{FS}-T(F_{i},CR)^{FS}\leq TR\\ \textbf{and V(F_{n},CR)}^{FS}<V(F_{i},CR)^{FS}\textbf{and V(F_{n},CR)}^{FS}-V(F_{i},CR)^{FS} \geq\ \min VR\\ \textbf{then move}\left(F_{i},CR\right)^{FS}\textbf{form FS to SS}\\ \textbf{endfile}\\ \textbf{endfor}\right.\]  
\[\left\{\begin{array}{l}\textbf{for i = 1 to n}\\ \left\{\begin{array}{l}\textbf{if T(F_{n},CR)}^{FS}-T(F_{i},CR)^{SS}\leq TR \\ \textbf{and V(F_{n},CR)}^{FS}\geq V(F_{i},CR)^{SS}\textbf{and V(F_{n},CR)}^{FS}-V(F_{i},CR)^{SS} \leq\ \max VR\\ \textbf{then move}(F_{n},CR)^{FS}\textbf{form FS to SS}\\ \textbf{elseif T(F_{n},CR)}^{FS}-T(F_{i},CR)^{SS}\leq TR\\ \textbf{and V(F_{n},CR)}^{FS}<V(F_{i},CR)^{SS}\textbf{and V(F_{n},CR)}^{FS}-V(F_{i},CR)^{SS} \geq\ \min VR\\ \textbf{then move}(F_{n},CR)^{FS}\textbf{form FS to SS}\\ \textbf{endfile}\\ \textbf{endfor}\right.\]  
\[\textbf{where}\left\{ \begin{array}{l}\mathrm{TR}=T(F_{n},CR)^{FS}\times \mathrm{TC}\\ \max VR=V(F_{n},CR)^{FS}\times\mathrm{VC}\\ \min VR=-V(F_{n},CR)^{FS}\times\mathrm{VC}\\ \end{array} \right. \tag{4}\]  
The time and value of all feedback in the feedback set (FS) provided to a particular user are compared in the TMS. In the first comparison, the time of the last feedback \(T(F_{n},CR)^{FS}\) and the time of all \(T(F_{i},CR)^{FS}\) feedback apart from the last is compared by the TMS. Following that, the value of the last feedback is compared in the TMS with the value of all \(V(F_{i},CR)^{FS}\) feedback apart from the last. The trust model performs a comparison between the time \(T(F_{n},CR)^{FS}\) and the value \(V(F_{n},CR)^{FS}\) of the last feedback in the feedback set (FS) and the time \(T(F_{i},CR)^{SS}\) and value \(V(F_{i},CR)^{SS}\) of all feedback in the suspected set (SS). This is how the TMS keeps all suspected feedback in the suspected set (SS). The two parameters to identify the range of feedback time and feedback value can be determined through the two parameters TC and VC.