## 4 Proposed Work
### Cluster-Based Vehicle Motion Detection
Further, the algorithm is used to detect the optimal fog node closer to the location that is in need of this information to alert the region. The jellyfish search works similar to the nature of jellyfish, which select a location for hunting food on the basis of quantity. Alert messages are disseminated on the basis of the direction of the corresponding risky vehicle, which is found as follows. \[md=\frac{1}{n_{\varphi}}\sum md_{i}=\frac{1}{n_{\varphi}}\sum(l^{*}-a_{t}l_{i} )=l^{*}-a_{t}\sigma \tag{20}\]

Here, \(n_{\varphi}\) is the total population around the vehicle; \(l^{*}\) is the current best location, \(a_{t}\) denotes the attraction factor, and \(\sigma\) denotes the mean location of all vehicles. The difference between \(l^{*}\) and \(\sigma\) is \(dl\), which can be formulated as follows. \[dl=\delta\times\alpha\times r^{f}(0,1) \tag{21}\]

Here, the distance of \(\pm\alpha\)\(\delta\) is formed as the region of likelihood that messages will be disseminated, in which \(\alpha\) refers to the standard deviation and can be expressed as follows. \[\alpha=rand^{\lambda}(0,1)\times\sigma \tag{22}\]

Therefore,

\[dl=\delta\times r^{f}(0,1)\times r^{\lambda}(0,1)\times\sigma \tag{23}\]

Figure 3: Driver Behavior Analysis Using A3C Algorithm. This can be modified as follows. \[dl=\delta\times r(0,1)\times\sigma \tag{24}\]

where

\[a_{t}=\delta\times r(0,1) \tag{25}\]

Hence,

\[md=l^{*}-\delta\times r(0,1)\times\sigma \tag{26}\]

The new position of each jellyfish is computed as follows. \[l_{i}(t+1)=l_{i}(t)+r(0,1)\times md \tag{27}\]

Equation (30) can be modified as follows. \[md=\frac{1}{n_{\varphi}}\sum md_{i}=\frac{1}{n_{\varphi}}\sum(l^{*}-a_{t}l_{i} )=l^{*}-a_{t}\sigma \tag{20}\]0

Here, the distributive coefficient \(\delta>0\) is related to \(md\). The JSO performs two types of dissemination; one is passive, and the other is active. In passive dissemination, a message is disseminated only to vehicles in that particular cluster. In active dissemination, the message is disseminated to other vehicles on the basis of objective functions. The update location function of passive dissemination can be formulated as follows. \[md=\frac{1}{n_{\varphi}}\sum md_{i}=\frac{1}{n_{\varphi}}\sum(l^{*}-a_{t}l_{i} )=l^{*}-a_{t}\sigma \tag{20}\]1

Here, \(L_{u}\) refers to the upper limit, and \(L_{l}\) refers to the lower limit. The motion coefficient \(\rho>0\) is linked to the motion of vehicles. In active dissemination, a fog node selects another relay fog node to disseminate messages to the vehicles in order to alert the vehicles about a risk. A fog node q is selected as the relay node only if the risky vehicle moves closer to its region. The exploitation of the search space can be represented as,

\[md=\frac{1}{n_{\varphi}}\sum md_{i}=\frac{1}{n_{\varphi}}\sum(l^{*}-a_{t}l_{i} )=l^{*}-a_{t}\sigma \tag{20}\]2

where,

\[md=\frac{1}{n_{\varphi}}\sum md_{i}=\frac{1}{n_{\varphi}}\sum(l^{*}-a_{t}l_{i} )=l^{*}-a_{t}\sigma \tag{20}\]3

\[dir=\left\{ \begin{array}{l}l_{q}(t)-l_{i}(t)\text{ {if }}f(l_{i})\geq f(l_{q})\\ l_{i}(t)-l_{q}(t)\text{ {if }}f(l_{i})<f(l_{q})\end{array} \right. \tag{32}\]

Therefore,

\[l_{i}(t+1)=l_{i}(t)+s \tag{33}\]

Here, the objective function of \(l\) is indicated as \(f\). The switch between passive and active dissemination is controlled by a control mechanism. Initially, passive dissemination is carried out, and after a threshold time, active dissemination is started. The control mechanism comprises two values, i.e., constant C\({}_{o}\) and control function C\({}_{t}\), which takes a value between 0 and 1. Control function C\({}_{t}\) can be formulated as follows. \[C_{t}=\left|\left(1-\frac{t}{max_{times}}\right)\times(2\times r(0,1)-1)\right| \tag{34}\]

Vehicles are initialized by using a logistic map and can be represented as follows. \[l_{i+1}=\vartheta l_{i}(1-l_{i}) \tag{35}\]

The boundary constraint for the selection of relay nodes can be formulated as follows. \[\left\{