X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/f29b38ef2a056daa14bbfda2fce78063faa773d4..d47d44b2ed067c834ef210ad544512e7581a1c8e:/process.cpp?ds=sidebyside diff --git a/process.cpp b/process.cpp index 8ceb469..7605818 100644 --- a/process.cpp +++ b/process.cpp @@ -5,6 +5,7 @@ #include #include #include "misc.h" +#include "options.h" #include "process.h" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simu); @@ -36,22 +37,6 @@ process::process(int argc, char *argv[]) print_loads(logp); } -void process::print_loads(e_xbt_log_priority_t logp) -{ - if (!LOG_ISENABLED(logp)) - return; - std::ostringstream oss; - if (neigh.empty()) { - oss << "no neighbor!"; - } else { - std::transform(neigh.begin(), neigh.end() - 1, - std::ostream_iterator(oss, ", "), - std::mem_fun_ref(&neighbor::getLoad)); - oss << neigh.back().getLoad(); - } - LOG1(logp, "Neighbor loads: %s", oss.str().c_str()); -} - int process::run() { INFO0("Coucou !"); @@ -76,6 +61,30 @@ int process::run() return 0; } +void process::compute() +{ + double duration = opt::comp_cost(load); + m_task_t task = MSG_task_create("computation", duration, 0.0, NULL); + MSG_task_execute(task); + MSG_task_destroy(task); +} + +void process::print_loads(e_xbt_log_priority_t logp) +{ + if (!LOG_ISENABLED(logp)) + return; + std::ostringstream oss; + if (neigh.empty()) { + oss << "no neighbor!"; + } else { + std::transform(neigh.begin(), neigh.end() - 1, + std::ostream_iterator(oss, ", "), + std::mem_fun_ref(&neighbor::getLoad)); + oss << neigh.back().getLoad(); + } + LOG1(logp, "Neighbor loads: %s", oss.str().c_str()); +} + // Local variables: // mode: c++ // End: