Pierwsza strona Wstecz Kontynuuj Ostatnia strona Przegląd Grafika
The Algorithm
BGP(M, p, c, ltnts, val) # M ≥ 0; c ∉ ltnts; val ∈ {ATTACK, RETREAT}
- Commander c sends his value val to each lieutenant i ∈ lnts.
- If M = 0:
- Each lieutenant i ∈ ltnts accepts the received value as val(i,p∙c) or val(i,p∙c) = RETREAT if he received no value.
- If M > 0:
- For each lieutenant i ∈ ltnts, let val ip∙c be the value i receives from commander c (or RETREAT as above). Lieutenant i acts as the commander in BGP(M – 1, p ∙c, i, lnts \ { i }, val ip∙c).
- For each i, j ∈ ltnts and i ≠ j, let val(i,p ∙c ∙j) be the value lieutenant i accepted from lieutenant j in the previous step (or RETREAT as above) and val(i,p ∙c ∙i) = val ip ∙c. Lieutenant i accepts the value val(i,p∙c) = majorityk ∈ ltnts(val(i,p ∙c ∙k)).