#ifdef STATISTICS

#ifndef morpheo_behavioural_Statistics_test_if_save_cpp
#define morpheo_behavioural_Statistics_test_if_save_cpp

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

#include "Behavioural/include/Statistics.h"

namespace morpheo              {
namespace behavioural          {

  template <class Counters, class Parameters_Counters>
  void Statistics::test_if_save(Counters ** & counters, Parameters_Counters parameters)
  {
    _period_current ++;

    // Test if allors a new counters ...
    if ( ((_nb_statistics == 0) && (_period_current >= _parameters_statistics._nb_cycle_before_begin)) ||
	 ((_nb_statistics >  0) && (_period_current >= _parameters_statistics._period_save          )) )
      {
	save<Counters,Parameters_Counters>(counters,parameters);
	_period_current = 0;
      }
  };
  
}; // end namespace behavioural          
}; // end namespace morpheo              

#endif
#endif
