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

Private GIT Repository
Add option -X <double>, for testing and/or debugging purpose.
[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     , credit(0.0)
16     , to_send(0.0)
17 {
18 }
19
20 neighbor::~neighbor()
21 {
22 }
23
24 void neighbor::print(bool verbose,
25                      e_xbt_log_priority_t logp, xbt_log_category_t cat) const
26 {
27     if (verbose)
28         XBT_XCLOG(cat, logp,
29                   "%s: load = %g ; debt = %g ; credit = %g ; to_send = %g",
30                   get_name(), get_load(), get_debt(), get_credit(),
31                   get_to_send());
32     else
33         XBT_XCLOG(cat, logp, "%s: load = %g", get_name(), get_load());
34 }