]> AND Private Git Repository - loba.git/blobdiff - messages.cpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Added Least Load Neighbors and another bulk algorithm
[loba.git] / messages.cpp
index 0abf913987782ce2399d3f9285c20235c45135d6..f5df3969b38db3d09707f097e93370aaa19dbcb3 100644 (file)
@@ -4,6 +4,7 @@
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(comm);
 
 #include "misc.h"
+#include "options.h"
 
 #include "messages.h"
 
@@ -16,6 +17,15 @@ std::string message::to_string()
     return oss.str();
 }
 
+double message::get_size() const
+{
+    // arbitrary: 8 for type, and 8 for amount
+    double size = 16;
+    if (type == LOAD)
+        size += opt::comm_cost(amount);
+    return size;
+}
+
 void message_queue::push(m_task_t task)
 {
     mutex.acquire();