|
|
Algorithm 1: The Cluster-head (CH) and Vice-CH election. |
|
|
for
s ← 1
to
#nodes
do
|
| τs ← τs
+ Δτκ; |
|
|
| Determine the value of the linguistic variable,
etas; |
| ηs ← defuzzification of
etas; |
|
; |
|
; |
| Advertise the value of
chances; |
| Receive the other advertisements and compare them; |
| if
the value of
chances is greater than of the others
then
|
| Advertise a
CH message; |
| else
|
| if
the value of
chances is the next higher value
then
|
| Advertise a
vice CH message; |
| else
|
| Select the closest CH as its coordinator; |
| Join the cluster. |
| end
|
| end
|
| end |
|