X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/5f9d773575a07c0dd024cfc323d034d6181da9b6..b7d00583f1757799be4a70b8ead9a37736d18ac6:/messages.cpp 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();