Info

This question is closed. Reopen it to edit or answer.

Can you help me please convert this pseudo code of beacon-less broadcasting algorithm into MATLAB?

1 view (last 30 days)
1: A source node S ∈ H0 send a data packet P. 2: Initialization: ID(vp) = ID(S), location(vp) = location(S), colour(Hp) = colour(H0), k = 0. {Case 1: Node v ∈ Hv has received the data packet P from node u ∈ Hv to cover level k.} 3: if v has a contention timer running for P then 4: v cancels its timer and ignores P. 5: end if {Case 2: Node v ∈ Hv has received the data packet P from node u ∈ Hu to cover level k.} 6: if Hv ⊂ C(Hu) then 7: Node v ignores the data packet P. 8: else if v or any v ∈ Hv has already forwarded P then 9: v ignores the data packet P. 10: else 11: Node v starts a contention timer th + tc. {Upon the expiration of th + tc} 12: if Hv is blue then 13: if v has not heard P from any other w ∈ Hv then 14: update(v, P) 15: v forwards the data packet P 16: end if 17: end if 18: if Hv is yellow or pink hexagon then 19: if v covers any additional hexagons on level k that are not yet covered then 20: update(v, P) 21: v forwards the data packet P 22: else if v covers additional hexagons in C(Hv) then 23: v starts a contention timer th + tc. 24: if upon the expiration of th + tc v covers any additional hexagons in C(Hv) then 25: update(v, P) 26: v forwards the data packet P 27: end if 28: end if 29: end if 30: end if

Answers (0)

Tags

No tags entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!