#ifdef STATISTICS
#include "Behavioural/include/Stat.h"

namespace morpheo {
namespace behavioural {  
  void Stat::test_and_save (bool force_save)
  {
    if ((_save_periodic and ((*_cycle)==_period)) or force_save)
      {
	eval_exprs(false); // evalue les expression non periodique au cycle
	
	for (std::map<std::string, var_t>::iterator i=_list_operand->begin();
	     i!= _list_operand->end();
	     ++i)
	  {
	    // save and reset !
	    i->second.save_counter.push_back(*(i->second.counter));
	    *(i->second.counter) = 0;
	  }
      }
  }
};  
};
#endif
