Algorithm 2 Prioritized warning message dissemination. |
Input:S, D, R, , and W Output: selection and time slot reservation for warning message dissemination Begin: Repeat If D∈R Then SD Else For i = 1 To sizeof(R) ⟵ + ⟵ If = 1 Then If S = Rear & D = Front node Then ⟵ Else ⟵ End If Else If S, D move towards each other Then ⟵ Else ⟵ End If End If End For ⟵ Min() If = Then If W[SN_bit] = 1 ℓ⟵W[severity_bits] Switch(ℓ) Case: 00 S waits for a free Case: 01 S requests to release a Case: 10 S releases already reserved by a non-warning or a lower priority warning message. End Switch Else S waits for a free End If Else S reserves a from End If S S⟵ End If Until = D End |