Skip to main content
. 2019 Dec 19;20(1):45. doi: 10.3390/s20010045
Algorithm 2 Prioritized warning message dissemination.
Input:S, D, R, αf, and W
Output:Bf selection and time slot reservation for warning message dissemination

Begin:
Repeat
  If DR Then
     S>>D
  Else
     For i = 1 To sizeof(R)
        μi|Dx-Rix| + |Dy-Riy|
        κiH(Ri,D)
            If H(S,D) = 1 Then
               If S = Rear & D = Front node Then
                   δiμiκi
               Else
                   δiμiκi
               End If
            Else
               If S, D move towards each other Then
                   δiμiκi
               Else
                   δiμiκi
               End If
            End If
     End For

     Bf⟵ Min(δ)

     If αf = ϕ Then
        If W[SN_bit] = 1
            W[severity_bits]
            Switch()
               Case: 00
                   S waits for a free s
               Case: 01
                   S requests to release a s
               Case: 10
                   S releases s already reserved by
                   a non-warning or a lower priority warning
                   message.
            End Switch
        Else
            S waits for a free s
        End If
     Else
        S reserves a s from αf
     End If
        S>>Bf
        SBf
  End If
UntilBf = D
End