From: jbrv Date: Fri, 8 Jun 2012 13:42:15 +0000 (+0200) Subject: Add new functions to support different sources of avaibility trace X-Git-Tag: v3_8~644^2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/ccca584250e6b07d6364482c27ac0a5c2c8c425f Add new functions to support different sources of avaibility trace These functions are still nearly empty, however. --- diff --git a/include/simgrid/platf.h b/include/simgrid/platf.h index ecbef2de03..53dfb19e2d 100644 --- a/include/simgrid/platf.h +++ b/include/simgrid/platf.h @@ -23,6 +23,9 @@ XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_from_file(const char *filename); XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_from_string(const char *id, const char *input, double periodicity); +XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_uniform(double alpha, double beta); +XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_exponential(double lambda); +XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_weibull(double lambda, double k); /** Defines whether a given resource is working or not */ typedef enum { diff --git a/src/surf/trace_mgr.c b/src/surf/trace_mgr.c index c42d11decf..2947389d06 100644 --- a/src/surf/trace_mgr.c +++ b/src/surf/trace_mgr.c @@ -32,6 +32,48 @@ XBT_INLINE void tmgr_history_free(tmgr_history_t h) free(h); } +tmgr_trace_t tmgr_trace_new_uniform(double alpha, double beta) +{ + tmgr_trace_t trace = NULL; + + trace = xbt_new0(s_tmgr_trace_t, 1); + trace->type = e_trace_uniform; + trace->s_uniform.alpha = alpha; + trace->s_uniform.beta = beta; + + //FIXME Generate a new event date + + return trace; +} + + +tmgr_trace_t tmgr_trace_new_exponential(double lambda) +{ + tmgr_trace_t trace = NULL; + + trace = xbt_new0(s_tmgr_trace_t, 1); + trace->type = e_trace_exponential; + trace->s_exponential.lambda = lambda; + + // FIXME Generate a new event date + + return trace; +} + +tmgr_trace_t tmgr_trace_new_weibull(double lambda, double k) +{ + tmgr_trace_t trace = NULL; + + trace = xbt_new0(s_tmgr_trace_t, 1); + trace->type = e_trace_weibull; + trace->s_weibull.lambda = lambda; + trace->s_weibull.k = k; + + // FIXME Generate a new event date + + return trace; +} + tmgr_trace_t tmgr_trace_new_from_string(const char *id, const char *input, double periodicity) {