#ifdef STATISTICS

/*
 * $Id$
 *
 * [ Description ]
 * 
 */

#include "Behavioural/include/Statistics.h"

namespace morpheo              {
namespace behavioural          {

#undef  FUNCTION
#define FUNCTION "Statistics::compute_cycle_begin"
  uint32_t Statistics::compute_cycle_begin (uint32_t num_statistics)
  {
    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    uint32_t _return = _parameters_statistics._nb_cycle_before_begin + num_statistics*_parameters_statistics._period_save;
    log_printf(FUNC,Behavioural,FUNCTION,"End");
    
    return _return;
  };

#undef  FUNCTION
#define FUNCTION "Statistics::compute_cycle_end"
  uint32_t Statistics::compute_cycle_end   (uint32_t num_statistics, uint32_t nb_cycle)
  {
    log_printf(FUNC,Behavioural,FUNCTION,"Begin");

    uint32_t _return;
    if (num_statistics == (_nb_statistics-1)) // Last ?
      _return = compute_cycle_begin(num_statistics  ) + nb_cycle;
    else
      _return = compute_cycle_begin(num_statistics+1) - 1;

    log_printf(FUNC,Behavioural,FUNCTION,"End");

    return _return;
  };

}; // end namespace behavioural          
}; // end namespace morpheo              

#endif
