run_n_iterations_end_event.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /******************************************************************************
  2. *
  3. * Copyright (C) 2020 by
  4. * The Salk Institute for Biological Studies
  5. *
  6. * Use of this source code is governed by an MIT-style
  7. * license that can be found in the LICENSE file or at
  8. * https://opensource.org/licenses/MIT.
  9. *
  10. ******************************************************************************/
  11. #ifndef SRC4_RUN_N_ITERATIONS_END_EVENT_H_
  12. #define SRC4_RUN_N_ITERATIONS_END_EVENT_H_
  13. #include <iostream>
  14. #include <string>
  15. #include "base_event.h"
  16. namespace MCell {
  17. /**
  18. * This is a dummy event that only serves as a marker
  19. * of time where we must check whether we already reached target number
  20. * of iterations.
  21. */
  22. class RunNIterationsEndEvent: public BaseEvent {
  23. public:
  24. RunNIterationsEndEvent()
  25. : BaseEvent(EVENT_TYPE_INDEX_SIMULATION_END_CHECK) {
  26. }
  27. void step() override {
  28. // empty
  29. }
  30. bool is_barrier() const override {
  31. return true;
  32. }
  33. void dump(const std::string ind) const override {
  34. std::cout << ind << "Simulation end check event\n";
  35. std::string ind2 = ind + " ";
  36. BaseEvent::dump(ind2);
  37. }
  38. };
  39. } /* namespace MCell */
  40. #endif /* SRC4_RUN_N_ITERATIONS_END_EVENT_H_ */