#include "../include/Environment.h"

namespace environment {

  void Environment::stop(uint32_t num_context)
  {

    cout("<stop> : num_context     : %d\n",num_context);
    cout("<stop> : context_stop    : %d\n",context_stop [num_context]);
    cout("<stop> : nb_context_stop : %d\n",nb_context_stop);


    if (context_stop [num_context] == false)
      {
        context_stop [num_context] = true;
        nb_context_stop ++;
	
        if (nb_context_stop >= param->nb_thread)
          {
            cout("<stop> : end simulation\n");
            sc_stop();
          }
      }
  }

};
