Commits

Joseph Bane committed d56c487 Merge

Merged.

Comments (0)

Files changed (1)

 void Process::pushMessage(Message m)
 {
   messages.insert(m);
-  m.display();
+  // m.display();
 }
 
 
 
   if (timeSince > delta) {
     // This represents rejection of the original request.
-    //cout << "REJECT: Request " << r.getID() << " (" << timeSince << ", " << delta << ")\n";
   }
   else {
     // Create new message objects to ask for votes
   // automatically accept on a vote request
   if (m.getVote() == Message::vote::null) {
     // Create a new message object to accept
-    //cout << "91\n";
     simulation->sendMessage( Message(m.getTo(), m.getFrom(), m.getRequestTime(), m.getRequestID(), Message::vote::accept) );
   }
 
   // read vote received from other Process
   else {
-    cout << "This line never executes\n";
     const int timeSince = simulation->getTime() - m.getRequestTime();
     
-    //if ( (int(m.getVote()) == int(Message::vote::accept))
-    // && (timeSince < delta*2) ) {
-    if (true) {
+    if ( (int(m.getVote()) == int(Message::vote::accept))
+	 && (timeSince < delta*2) ) {
       
       // Accept Request
       cout << "PID: " << id << "  ACCEPT: Request " << m.getRequestID() << " (" << timeSince << ", " << delta*2 << ")\n";