Skip to content

Commit ef01f02

Browse files
Update misAlgorithm.cpp
1 parent 626d7b2 commit ef01f02

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

misAlgorithm.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ void MisAlgorithm::Round3(int id, vector<int>* vecNeiId, double& randNum, double
156156
Log(id, "...Round 3 Finish...");
157157
}
158158

159+
//In this method, each node receives the sent messages that containes the status of its neighbors.
160+
//If there is at least one neighbor with status Mis, then the status of the node will be ComMis.
159161
void MisAlgorithm::Round4(int id, vector<int>* vecNeiId)
160162
{
161163
Log(id, "...Round 4 Start...");
@@ -181,6 +183,8 @@ void MisAlgorithm::Round4(int id, vector<int>* vecNeiId)
181183
Log(id, "...Round 4 Finish...");
182184
}
183185

186+
/*In this method, if the status of a node is ComMis, then it sends its Id to its neighbors. The resean of this task is explained
187+
in the explanation of the next method.*/
184188
void MisAlgorithm::Round5(int id, vector<int>* vecNeiId)
185189
{
186190
Log(id, "...Round 5 Start...");
@@ -198,6 +202,10 @@ void MisAlgorithm::Round5(int id, vector<int>* vecNeiId)
198202
Log(id, "...Round 5 Finish...");
199203
}
200204

205+
/*In this method, if the status of the node is Unknown, it updates the list (vecNeiId) that contains the neighbors Ids.
206+
In the update task, the node deletes the Ids of all ComMis neighbors from vecNeiId.
207+
It should be noted that the nodes with status Mis or ComMis are deactive at the end of each iteration.
208+
The update task is necessary because if it is not done, in the next iteration, the node waits for reveiveing messages from the deactive neighbors.*/
201209
void MisAlgorithm::Round6(int id, vector<int>* vecNeiId)
202210
{
203211
Log(id, "...Round 6 Start...");

0 commit comments

Comments
 (0)