X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/5f9d773575a07c0dd024cfc323d034d6181da9b6..1f1654801b021f79ab05c5a9d0dddc766c423d17:/messages.cpp?ds=sidebyside diff --git a/messages.cpp b/messages.cpp index 0abf913..f5df396 100644 --- a/messages.cpp +++ b/messages.cpp @@ -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();