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

Private GIT Repository
Partially revert "Reverted extract-all and extract-all-inv to use original log files...
[loba.git] / neighbor.cpp
1 #include <limits>
2 #include <msg/msg.h>
3
4 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(proc); // needed to compile neighbor.h
5
6 #include "misc.h"
7
8 #include "neighbor.h"
9
10 neighbor::neighbor(const char* hostname)
11     : host(static_cast<hostdata*>
12            (MSG_host_get_data(MSG_get_host_by_name(hostname))))
13     , load(std::numeric_limits<double>::infinity())
14     , debt(0.0)
15     , to_send(0.0)
16 {
17 }
18
19 neighbor::~neighbor()
20 {
21 }
22
23 void neighbor::print(bool verbose,
24                      e_xbt_log_priority_t logp, xbt_log_category_t cat) const
25 {
26     if (verbose)
27         XBT_XCLOG(cat, logp, "%s: load = %g ; debt = %g ; to_send = %g",
28                   get_name(), get_load(), get_debt(), get_to_send());
29     else
30         XBT_XCLOG(cat, logp, "%s: load = %g", get_name(), get_load());
31 }