projectus.freehost7.com:UG and PG level projects,mini projects and many more here ...



Implementation of ACE:Clustering Algorithm (ACE)

if myTime > 3 x EXPECTED ITERATION LENGTH then

if myState = CLUSTER-HEAD then return DONE

else if myState = CLUSTERED then

wait for my cluster-heads to terminate, then pick one as my cluster- head return DONE

else if myState = UNCLUSTERED then

pick a random clustered node to act as my proxy after it terminates wait for it to terminate, then

return DONE

end if

else if myState = UNCLUSTERED

and numLoyalFollowers() ≥ fmin(myTime) then myClusterID←generate New_Random_ID() locally_broadcast(RECRUIT, myID, myClusterID)

else if myState = CLUSTER-HEAD then bestLeader←myID bestFollowerCount←numLoyalFollowers

for all n where n is a potential new cluster-head do

followerCount = Poll_For_Num _Loyal_Followers(n, myClusterID)

if followerCount > bestFollowerCount then bestLeader←n bestFollowerCount←followerCount

end if end for

if bestLeader is not myID then

send(bestLeader, PROMOTE, myClusterID)

wait for bestLeader to broadcast it's RECRUIT message locally_broadcast(ABDICATE, myID, myClusterID)

end if end if