Skip to main content
. 2017 Aug 11;17(8):1858. doi: 10.3390/s17081858
Algorithm 1 Circular Motion of MSs with Varied Velocity Algorithm
  1. Initialize all the parameters;

  2. Round = 0;

  3. Static sinks computes the velocities of MSs based on Equation (30);

  4. MSi Starts to move in predetermined circular path from position (((2j-1)(d/2)), 0)

  5. Turn Round = Turn Round +1;

  6. J = 1;// sector number

  7. Stops at (((2j-1)(d/2).cos(ϴ/2) + Xcenter), ((2j-1)(d/2).Sin(ϴ/2) + Xcenter)); //MS stops at the bisector of sectors

  8. MS sends a Hello packet to the nearest CH;

  9. CH sends a data packet to the MS //data packet contains corona number, sector number and waiting time parameter;

  10. MSi Computes the sojourn time in Cluster(i, j) based on Equation (30);

  11. MS propagates Hello packets; // Hello packet contains of position of MS and cluster id

  12. the MNs which are located in the cluster which is mentioned in received packet will connect to MS;

  13. Set timer = ST(i,j,Round);

  14. While timer > 0 do
    1. CH Temporarily stops its operations;
    2. MSi aggregates the data packets of nodes belonging Cluster (i, j);
    3. MSi receives the data packets from CH (i-1, j) and nodes belonging Cluster (i, j);
    4. Check timer;
  15. End while

  16. J = j + 1;

  17. MSi Computes its velocity {MSi | 1 < I ≤ k} based on Equation (30);

  18. MSi Starts to move;

  19. Check the current position;

  20. If current position = (((2j-1) (d/2)), 0); // when the angle of position of MSs is 0.
    1. Go to 5;
  21. End If

  22. Go