Преглед на файлове

adapt to new namespace and change year of copyright

Eric Ramat преди 2 години
родител
ревизия
33f1ece26b
променени са 34 файла, в които са добавени 624 реда и са изтрити 707 реда
  1. 3 1
      .gitignore
  2. 7 21
      CMakeLists.txt
  3. 1 1
      src/tests/common/multithreading-tests.cpp
  4. 1 1
      src/tests/common/time-tests.cpp
  5. 1 1
      src/tests/devs/graph_manager.hpp
  6. 9 9
      src/tests/devs/models.hpp
  7. 1 1
      src/tests/devs/tests.cpp
  8. 1 1
      src/tests/dsde/graph_manager.hpp
  9. 6 6
      src/tests/dsde/models.hpp
  10. 1 1
      src/tests/dsde/tests.cpp
  11. 1 1
      src/tests/dtss/graph_manager.hpp
  12. 9 9
      src/tests/dtss/models.hpp
  13. 1 1
      src/tests/dtss/tests.cpp
  14. 1 1
      src/tests/fddevs/graph_manager.hpp
  15. 20 20
      src/tests/fddevs/models.hpp
  16. 1 1
      src/tests/fddevs/tests.cpp
  17. 1 1
      src/tests/mixed/graph_manager.hpp
  18. 25 25
      src/tests/mixed/models.hpp
  19. 1 1
      src/tests/mixed/tests.cpp
  20. 1 1
      src/tests/mpi/graph_manager.hpp
  21. 1 1
      src/tests/mpi/main.cpp
  22. 64 103
      src/tests/multithreading/lifegame/graph_manager.hpp
  23. 222 228
      src/tests/multithreading/lifegame/main.cpp
  24. 27 41
      src/tests/multithreading/lifegame/models.hpp
  25. 49 49
      src/tests/multithreading/simple/graph_manager.hpp
  26. 29 29
      src/tests/multithreading/simple/main.cpp
  27. 12 12
      src/tests/multithreading/simple/models.hpp
  28. 1 1
      src/tests/pdevs/graph_manager.hpp
  29. 1 1
      src/tests/pdevs/main.cpp
  30. 19 19
      src/tests/pdevs/models.hpp
  31. 1 1
      src/tests/pdevs/tests.cpp
  32. 1 1
      src/tests/qss/graph_manager.hpp
  33. 91 103
      src/tests/qss/main.cpp
  34. 14 14
      src/tests/qss/models.hpp

+ 3 - 1
.gitignore

@@ -1,4 +1,6 @@
 *~
 build/
 cmake-build-debug/
-.idea/
+cmake-build-release/
+.idea/
+output/

+ 7 - 21
CMakeLists.txt

@@ -1,4 +1,4 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+CMAKE_MINIMUM_REQUIRED(VERSION 3.18)
 PROJECT(ARTIS_TEST CXX)
 ENABLE_TESTING()
 
@@ -31,7 +31,7 @@ INCLUDE(CMakeCPack.cmake)
 IF (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR
         ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra")
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-as-needed -Wall -Wextra -std=c++11")
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-as-needed -Wall -Wextra -std=c++17")
     IF (UNIX)
         SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic")
         SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
@@ -84,17 +84,12 @@ PKG_CHECK_MODULES(ARTIS REQUIRED artis-star-1.0)
 PKG_CHECK_MODULES(ARTIS_ADDONS REQUIRED artis-addons-1.0)
 
 #
-# Test the libboost header and libboost-text library.
+# Boost libraries.
 #
 
-OPTION(WITH_TEST "use the libboost test unit library [default: on]" ON)
-SET(Boost_USE_MULTITHREADED ON)
-SET(Boost_USE_STATIC_LIBS OFF)
-SET(Boost_NO_SYSTEM_PATHS OFF)
-SET(Boost_USE_STATIC_RUNTIME ON)
-IF (WIN32)
-    SET(Boost_THREADAPI "win32")
-ENDIF (WIN32)
+set( Boost_USE_STATIC_LIBS OFF )
+set( Boost_USE_MULTITHREADED ON )
+set( Boost_USE_STATIC_RUNTIME OFF )
 
 include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR})
 
@@ -106,16 +101,7 @@ else ()
     include_directories(${MPI_CXX_INCLUDE_PATH})
 endif ()
 
-message(STATUS "checking for Boost headers and libraries")
-find_package(Boost 1.55 REQUIRED COMPONENTS graph mpi timer serialization
-        system)
-if (NOT Boost_FOUND)
-    MESSAGE(FATAL_ERROR "The boost graph library is required")
-else ()
-    message(STATUS " Boost found")
-    include_directories(${Boost_INCLUDE_DIRS})
-    link_directories(${Boost_LIBRARY_DIRS})
-endif ()
+find_package( Boost 1.72.0 COMPONENTS mpi serialization system thread timer )
 
 #
 # Generate the config.h

+ 1 - 1
src/tests/common/multithreading-tests.cpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by

+ 1 - 1
src/tests/common/time-tests.cpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by

+ 1 - 1
src/tests/devs/graph_manager.hpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by

+ 9 - 9
src/tests/devs/models.hpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -90,7 +90,7 @@ public:
 
   void
   dext(typename common::DoubleTime::type t, typename common::DoubleTime::type /* e */,
-       const common::ExternalEvent<common::DoubleTime> &msg) override
+       const common::event::ExternalEvent<common::DoubleTime> &msg) override
   {
 
 #ifndef WITH_TRACE
@@ -148,7 +148,7 @@ public:
     }
   }
 
-  common::ExternalEvent<common::DoubleTime>
+  common::event::ExternalEvent<common::DoubleTime>
   lambda(typename common::DoubleTime::type t) const override
   {
 #ifndef WITH_TRACE
@@ -156,7 +156,7 @@ public:
 #endif
 
     if (_phase == SEND) {
-      artis::common::ExternalEvent<common::DoubleTime> msg(_value);
+      artis::common::event::ExternalEvent<common::DoubleTime> msg(_value);
 
 #ifdef WITH_TRACE
       common::Trace<common::DoubleTime>::trace()
@@ -181,7 +181,7 @@ public:
       common::Trace<common::DoubleTime>::trace().flush();
 #endif
 
-      return artis::common::ExternalEvent<common::DoubleTime>::Void;
+      return artis::common::event::ExternalEvent<common::DoubleTime>::Void;
     }
   }
 
@@ -229,7 +229,7 @@ public:
 
   void
   dext(typename common::DoubleTime::type t, typename common::DoubleTime::type /* e */,
-       const common::ExternalEvent<common::DoubleTime> &msg) override
+       const common::event::ExternalEvent<common::DoubleTime> &msg) override
   {
 
 #ifndef WITH_TRACE
@@ -287,14 +287,14 @@ public:
     }
   }
 
-  common::ExternalEvent<common::DoubleTime> lambda(
+  common::event::ExternalEvent<common::DoubleTime> lambda(
       typename common::DoubleTime::type t) const override
   {
 #ifndef WITH_TRACE
     (void)t;
 #endif
     if (_phase == SEND) {
-      artis::common::ExternalEvent<common::DoubleTime> msg(_value);
+      artis::common::event::ExternalEvent<common::DoubleTime> msg(_value);
 
 #ifdef WITH_TRACE
       common::Trace<common::DoubleTime>::trace()
@@ -319,7 +319,7 @@ public:
       common::Trace<common::DoubleTime>::trace().flush();
 #endif
 
-      return artis::common::ExternalEvent<common::DoubleTime>::Void;
+      return artis::common::event::ExternalEvent<common::DoubleTime>::Void;
     }
   }
 

+ 1 - 1
src/tests/devs/tests.cpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by

+ 1 - 1
src/tests/dsde/graph_manager.hpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by

+ 6 - 6
src/tests/dsde/models.hpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -88,7 +88,7 @@ public:
   void
   dext(const typename common::DoubleTime::type &t,
        const typename common::DoubleTime::type & /* e */,
-       const common::Bag <common::DoubleTime> &bag) override
+       const common::event::Bag <common::DoubleTime> &bag) override
   {
 
 #ifndef WITH_TRACE
@@ -111,7 +111,7 @@ public:
 
   void dconf(const typename common::DoubleTime::type &t,
              const typename common::DoubleTime::type & /* e */,
-             const common::Bag <common::DoubleTime> &bag) override
+             const common::event::Bag <common::DoubleTime> &bag) override
   {
 
 #ifndef WITH_TRACE
@@ -175,16 +175,16 @@ public:
     }
   }
 
-  common::Bag <common::DoubleTime>
+  common::event::Bag <common::DoubleTime>
   lambda(const typename common::DoubleTime::type &t) const override
   {
 
 #ifndef WITH_TRACE
     (void)t;
 #endif
-    common::Bag<common::DoubleTime> bag;
+    common::event::Bag<common::DoubleTime> bag;
 
-    bag.push_back(artis::common::ExternalEvent<common::DoubleTime>(OUT, _value));
+    bag.push_back(artis::common::event::ExternalEvent<common::DoubleTime>(OUT, _value));
 
 #ifdef WITH_TRACE
     common::Trace<common::DoubleTime>::trace()

+ 1 - 1
src/tests/dsde/tests.cpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by

+ 1 - 1
src/tests/dtss/graph_manager.hpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by

+ 9 - 9
src/tests/dtss/models.hpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -64,7 +64,7 @@ public:
 
   ~A() override = default;
 
-  void transition(const artis::common::Bag<artis::common::DoubleTime> & /* x */,
+  void transition(const artis::common::event::Bag<artis::common::DoubleTime> & /* x */,
                   const artis::common::DoubleTime::type &t) override
   {
 
@@ -103,16 +103,16 @@ public:
 
   }
 
-  artis::common::Bag<artis::common::DoubleTime> lambda(const artis::common::DoubleTime::type &t) const override
+  artis::common::event::Bag<artis::common::DoubleTime> lambda(const artis::common::DoubleTime::type &t) const override
   {
 
 #ifndef WITH_TRACE
     (void)t;
 #endif
 
-    artis::common::Bag<artis::common::DoubleTime> msgs;
+    artis::common::event::Bag<artis::common::DoubleTime> msgs;
 
-    msgs.push_back(artis::common::ExternalEvent<artis::common::DoubleTime>(OUT, _value));
+    msgs.push_back(artis::common::event::ExternalEvent<artis::common::DoubleTime>(OUT, _value));
 
 #ifdef WITH_TRACE
     artis::common::Trace<artis::common::DoubleTime>::trace()
@@ -164,7 +164,7 @@ public:
 
   ~B() override = default;
 
-  void transition(const artis::common::Bag<artis::common::DoubleTime> &x,
+  void transition(const artis::common::event::Bag<artis::common::DoubleTime> &x,
                   const artis::common::DoubleTime::type &t) override
   {
 
@@ -204,7 +204,7 @@ public:
 
   }
 
-  artis::common::Bag<artis::common::DoubleTime> lambda(
+  artis::common::event::Bag<artis::common::DoubleTime> lambda(
       const artis::common::DoubleTime::type &t) const override
   {
 
@@ -212,9 +212,9 @@ public:
     (void)t;
 #endif
 
-    artis::common::Bag<artis::common::DoubleTime> msgs;
+    artis::common::event::Bag<artis::common::DoubleTime> msgs;
 
-    msgs.push_back(artis::common::ExternalEvent<artis::common::DoubleTime>(OUT, _value));
+    msgs.push_back(artis::common::event::ExternalEvent<artis::common::DoubleTime>(OUT, _value));
 
 #ifdef WITH_TRACE
     artis::common::Trace<artis::common::DoubleTime>::trace()

+ 1 - 1
src/tests/dtss/tests.cpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by

+ 1 - 1
src/tests/fddevs/graph_manager.hpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by

+ 20 - 20
src/tests/fddevs/models.hpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -105,7 +105,7 @@ public:
   void
   delta_x(typename common::DoubleTime::type /* t */,
           typename common::DoubleTime::type /* e */,
-          const common::Bag<common::DoubleTime> &bag) override
+          const common::event::Bag<common::DoubleTime> &bag) override
   {
     assert(bag.size() == 1);
 
@@ -114,43 +114,43 @@ public:
     }
   }
 
-  common::Bag<common::DoubleTime>
+  common::event::Bag<common::DoubleTime>
   lambda(typename common::DoubleTime::type /* t */) const override
   {
-    common::Bag<common::DoubleTime> msgs;
+    common::event::Bag<common::DoubleTime> msgs;
 
     switch (state()) {
     case I0:
       msgs.push_back(
-          artis::common::ExternalEvent<common::DoubleTime>(OUT_W, 0));
+          artis::common::event::ExternalEvent<common::DoubleTime>(OUT_W, 0));
       break;
     case I1:
       msgs.push_back(
-          artis::common::ExternalEvent<common::DoubleTime>(OUT_G, 1));
+          artis::common::event::ExternalEvent<common::DoubleTime>(OUT_G, 1));
       break;
     case G:break;
     case GR:
       msgs.push_back(
-          artis::common::ExternalEvent<common::DoubleTime>(OUT_G, 0));
+          artis::common::event::ExternalEvent<common::DoubleTime>(OUT_G, 0));
       break;
     case WW:
       msgs.push_back(
-          artis::common::ExternalEvent<common::DoubleTime>(OUT_W, 1));
+          artis::common::event::ExternalEvent<common::DoubleTime>(OUT_W, 1));
       break;
     case W:
       msgs.push_back(
-          artis::common::ExternalEvent<common::DoubleTime>(OUT_W, 0));
+          artis::common::event::ExternalEvent<common::DoubleTime>(OUT_W, 0));
       break;
     case DW:
       msgs.push_back(
-          artis::common::ExternalEvent<common::DoubleTime>(OUT_G, 1));
+          artis::common::event::ExternalEvent<common::DoubleTime>(OUT_G, 1));
       break;
     }
     return msgs;
   }
 
   bool rho(typename common::DoubleTime::type /* time */,
-           const common::Bag<common::DoubleTime> &bag) const override
+           const common::event::Bag<common::DoubleTime> &bag) const override
   {
     return state() == G and bag.at(0).on_port(IN_P);
   }
@@ -207,10 +207,10 @@ public:
   void
   delta_x(typename common::DoubleTime::type /* t */,
           typename common::DoubleTime::type /* e */,
-          const common::Bag<common::DoubleTime> &bag) override
+          const common::event::Bag<common::DoubleTime> &bag) override
   {
     std::for_each(bag.begin(), bag.end(),
-                  [this](const artis::common::ExternalEvent<common::DoubleTime> &e) {
+                  [this](const artis::common::event::ExternalEvent<common::DoubleTime> &e) {
                     int data;
 
                     e.data()(data);
@@ -274,16 +274,16 @@ public:
                   });
   }
 
-  common::Bag<common::DoubleTime>
+  common::event::Bag<common::DoubleTime>
   lambda(typename common::DoubleTime::type /* t */) const override
   {
-    common::Bag<common::DoubleTime> msgs;
+    common::event::Bag<common::DoubleTime> msgs;
 
     return msgs;
   }
 
   bool rho(typename common::DoubleTime::type /* time */,
-           const common::Bag<common::DoubleTime> & /* bag */) const override
+           const common::event::Bag<common::DoubleTime> & /* bag */) const override
   {
     return false;
   }
@@ -333,15 +333,15 @@ public:
     }
   }
 
-  common::Bag<common::DoubleTime>
+  common::event::Bag<common::DoubleTime>
   lambda(typename common::DoubleTime::type /* t */) const override
   {
-    common::Bag<common::DoubleTime> msgs;
+    common::event::Bag<common::DoubleTime> msgs;
 
     switch (state()) {
     case INIT:
       msgs.push_back(
-          artis::common::ExternalEvent<common::DoubleTime>(OUT_P, 1));
+          artis::common::event::ExternalEvent<common::DoubleTime>(OUT_P, 1));
       break;
     case SEND:break;
     }
@@ -349,7 +349,7 @@ public:
   }
 
   bool rho(typename common::DoubleTime::type /* time */,
-           const common::Bag<common::DoubleTime> & /* bag */) const override
+           const common::event::Bag<common::DoubleTime> & /* bag */) const override
   {
     return false;
   }

+ 1 - 1
src/tests/fddevs/tests.cpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by

+ 1 - 1
src/tests/mixed/graph_manager.hpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by

+ 25 - 25
src/tests/mixed/models.hpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -87,7 +87,7 @@ public:
   void
   dext(const typename common::DoubleTime::type &t,
        const typename common::DoubleTime::type & /* e */,
-       const common::Bag<common::DoubleTime> &bag) override
+       const common::event::Bag<common::DoubleTime> &bag) override
   {
 
 #ifndef WITH_TRACE
@@ -110,7 +110,7 @@ public:
 
   void dconf(const typename common::DoubleTime::type &t,
              const typename common::DoubleTime::type & /* e */,
-             const common::Bag<common::DoubleTime> &bag) override
+             const common::event::Bag<common::DoubleTime> &bag) override
   {
 
 #ifndef WITH_TRACE
@@ -169,7 +169,7 @@ public:
     }
   }
 
-  common::Bag<common::DoubleTime>
+  common::event::Bag<common::DoubleTime>
   lambda(const typename common::DoubleTime::type &t) const override
   {
 
@@ -177,9 +177,9 @@ public:
     (void)t;
 #endif
 
-    common::Bag<common::DoubleTime> bag;
+    common::event::Bag<common::DoubleTime> bag;
 
-    bag.push_back(artis::common::ExternalEvent<common::DoubleTime>(OUT, _value));
+    bag.push_back(artis::common::event::ExternalEvent<common::DoubleTime>(OUT, _value));
 
 #ifdef WITH_TRACE
     common::Trace<common::DoubleTime>::trace()
@@ -252,7 +252,7 @@ public:
   void
   dext(const typename common::DoubleTime::type &t,
        const typename common::DoubleTime::type &e,
-       const common::Bag<common::DoubleTime> &bag) override
+       const common::event::Bag<common::DoubleTime> &bag) override
   {
 
 #ifdef WITH_TRACE
@@ -267,7 +267,7 @@ public:
 
     std::for_each(bag.begin(), bag.end(),
                   [this, t, e](
-                      const common::ExternalEvent<common::DoubleTime> & /* event */) {
+                      const common::event::ExternalEvent<common::DoubleTime> & /* event */) {
                     ++_count;
                   });
     _phase = SEND;
@@ -275,7 +275,7 @@ public:
 
   void dconf(const typename common::DoubleTime::type &t,
              const typename common::DoubleTime::type &e,
-             const common::Bag<common::DoubleTime> &bag) override
+             const common::event::Bag<common::DoubleTime> &bag) override
   {
 
 #ifndef WITH_TRACE
@@ -342,16 +342,16 @@ public:
     }
   }
 
-  common::Bag<common::DoubleTime>
+  common::event::Bag<common::DoubleTime>
   lambda(const typename common::DoubleTime::type &t) const override
   {
 
 #ifndef WITH_TRACE
     (void)t;
 #endif
-    common::Bag<common::DoubleTime> bag;
+    common::event::Bag<common::DoubleTime> bag;
 
-    bag.push_back(artis::common::ExternalEvent<common::DoubleTime>(OUT, _count));
+    bag.push_back(artis::common::event::ExternalEvent<common::DoubleTime>(OUT, _count));
 
 #ifdef WITH_TRACE
     common::Trace<common::DoubleTime>::trace()
@@ -408,7 +408,7 @@ public:
 
   ~A2() override = default;
 
-  void transition(const common::Bag<common::DoubleTime> &x,
+  void transition(const common::event::Bag<common::DoubleTime> &x,
                   const typename common::DoubleTime::type &t) override
   {
 
@@ -446,16 +446,16 @@ public:
 #endif
   }
 
-  common::Bag<common::DoubleTime>
+  common::event::Bag<common::DoubleTime>
   lambda(const typename common::DoubleTime::type &t) const override
   {
 
 #ifndef WITH_TRACE
     (void)t;
 #endif
-    common::Bag<common::DoubleTime> bag;
+    common::event::Bag<common::DoubleTime> bag;
 
-    bag.push_back(artis::common::ExternalEvent<common::DoubleTime>(OUT, _value));
+    bag.push_back(artis::common::event::ExternalEvent<common::DoubleTime>(OUT, _value));
 
 #ifdef WITH_TRACE
     common::Trace<common::DoubleTime>::trace()
@@ -506,7 +506,7 @@ public:
 
   ~B2() override = default;
 
-  void transition(const common::Bag<common::DoubleTime> &x,
+  void transition(const common::event::Bag<common::DoubleTime> &x,
                   const typename common::DoubleTime::type &t) override
   {
 
@@ -546,16 +546,16 @@ public:
 
   }
 
-  common::Bag<common::DoubleTime>
+  common::event::Bag<common::DoubleTime>
   lambda(const typename common::DoubleTime::type &t) const override
   {
 
 #ifndef WITH_TRACE
     (void)t;
 #endif
-    common::Bag<common::DoubleTime> bag;
+    common::event::Bag<common::DoubleTime> bag;
 
-    bag.push_back(artis::common::ExternalEvent<common::DoubleTime>(OUT, _value));
+    bag.push_back(artis::common::event::ExternalEvent<common::DoubleTime>(OUT, _value));
 
 #ifdef WITH_TRACE
     common::Trace<common::DoubleTime>::trace()
@@ -622,7 +622,7 @@ public:
   void
   dext(const typename common::DoubleTime::type &t,
        const typename common::DoubleTime::type & /* e */,
-       const common::Bag<common::DoubleTime> &bag) override
+       const common::event::Bag<common::DoubleTime> &bag) override
   {
 
 #ifndef WITH_TRACE
@@ -645,7 +645,7 @@ public:
 
   void dconf(const typename common::DoubleTime::type &t,
              const typename common::DoubleTime::type & /* e */,
-             const common::Bag<common::DoubleTime> &bag) override
+             const common::event::Bag<common::DoubleTime> &bag) override
   {
 
 #ifndef WITH_TRACE
@@ -708,16 +708,16 @@ public:
     }
   }
 
-  common::Bag<common::DoubleTime>
+  common::event::Bag<common::DoubleTime>
   lambda(const typename common::DoubleTime::type &t) const override
   {
 
 #ifndef WITH_TRACE
     (void)t;
 #endif
-    common::Bag<common::DoubleTime> bag;
+    common::event::Bag<common::DoubleTime> bag;
 
-    bag.push_back(artis::common::ExternalEvent<common::DoubleTime>(OUT, _value));
+    bag.push_back(artis::common::event::ExternalEvent<common::DoubleTime>(OUT, _value));
 
 #ifdef WITH_TRACE
     common::Trace<common::DoubleTime>::trace()

+ 1 - 1
src/tests/mixed/tests.cpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by

+ 1 - 1
src/tests/mpi/graph_manager.hpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by

+ 1 - 1
src/tests/mpi/main.cpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by

+ 64 - 103
src/tests/multithreading/lifegame/graph_manager.hpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -38,8 +38,7 @@ namespace tests {
 namespace multithreading {
 namespace lifegame {
 
-struct GridGraphManagerParameters
-{
+struct GridGraphManagerParameters {
   unsigned int begin_column;
   unsigned int end_column;
   unsigned int begin_line;
@@ -51,27 +50,24 @@ struct GridGraphManagerParameters
 };
 
 class FlatGraphManager
-    : public artis::pdevs::GraphManager<common::DoubleTime,
-                                        CellParameters,
-                                        GridGraphManagerParameters>
-{
+  : public artis::pdevs::GraphManager<common::DoubleTime,
+    CellParameters,
+    GridGraphManagerParameters> {
 public:
-  enum submodels
-  {
+  enum submodels {
     CELL
   };
 
   FlatGraphManager(common::Coordinator<common::DoubleTime> *coordinator,
                    const CellParameters &parameters,
                    const GridGraphManagerParameters &graph_parameters)
-      :
-      artis::pdevs::GraphManager<common::DoubleTime, CellParameters, GridGraphManagerParameters>(
-          coordinator, parameters, graph_parameters)
-  {
+    :
+    artis::pdevs::GraphManager<common::DoubleTime, CellParameters, GridGraphManagerParameters>(
+      coordinator, parameters, graph_parameters) {
     unsigned int column_number =
-        graph_parameters.end_column - graph_parameters.begin_column + 1;
+      graph_parameters.end_column - graph_parameters.begin_column + 1;
     unsigned int line_number =
-        graph_parameters.end_line - graph_parameters.begin_line + 1;
+      graph_parameters.end_line - graph_parameters.begin_line + 1;
 
     for (unsigned int i = graph_parameters.begin_column;
          i <= graph_parameters.end_column; ++i) {
@@ -94,57 +90,56 @@ public:
         // north
         if (j - 1 >= 0) {
           out({_cells[index], Cell::OUT})
-              >> in({_cells[i * line_number + j - 1],
-                     Cell::IN});
+            >> in({_cells[i * line_number + j - 1],
+                   Cell::IN});
         }
         // south
         if (j + 1 < (int) line_number) {
           out({_cells[index], Cell::OUT})
-              >> in({_cells[i * line_number + j + 1],
-                     Cell::IN});
+            >> in({_cells[i * line_number + j + 1],
+                   Cell::IN});
         }
         // west
         if (i - 1 >= 0) {
           out({_cells[index], Cell::OUT})
-              >> in({_cells[(i - 1) * line_number
-                  + j], Cell::IN});
+            >> in({_cells[(i - 1) * line_number
+                          + j], Cell::IN});
         }
         // east
         if (i + 1 < (int) column_number) {
           out({_cells[index], Cell::OUT})
-              >> in({_cells[(i + 1) * line_number
-                  + j], Cell::IN});
+            >> in({_cells[(i + 1) * line_number
+                          + j], Cell::IN});
         }
         // north west
         if (j - 1 >= 0 and i - 1 >= 0) {
           out({_cells[index], Cell::OUT})
-              >> in({_cells[(i - 1) * line_number + j
-                  - 1], Cell::IN});
+            >> in({_cells[(i - 1) * line_number + j
+                          - 1], Cell::IN});
         }
         // south west
         if (j + 1 < (int) line_number and i - 1 >= 0) {
           out({_cells[index], Cell::OUT})
-              >> in({_cells[(i - 1) * line_number + j
-                  + 1], Cell::IN});
+            >> in({_cells[(i - 1) * line_number + j
+                          + 1], Cell::IN});
         }
         // north east
         if (j - 1 >= 0 and i + 1 < (int) column_number) {
           out({_cells[index], Cell::OUT})
-              >> in({_cells[(i + 1) * line_number + j
-                  - 1], Cell::IN});
+            >> in({_cells[(i + 1) * line_number + j
+                          - 1], Cell::IN});
         }
         // south east
         if (j + 1 < (int) line_number and i + 1 < (int) column_number) {
           out({_cells[index], Cell::OUT})
-              >> in({_cells[(i + 1) * line_number + j
-                  + 1], Cell::IN});
+            >> in({_cells[(i + 1) * line_number + j
+                          + 1], Cell::IN});
         }
       }
     }
   }
 
-  ~FlatGraphManager() override
-  {
+  ~FlatGraphManager() override {
     std::for_each(_cells.begin(), _cells.end(),
                   std::default_delete<Simulator>());
   }
@@ -156,16 +151,14 @@ private:
   Simulators _cells;
 };
 
-class ParallelBuiltFlatGraphManager : public FlatGraphManager
-{
+class ParallelBuiltFlatGraphManager : public FlatGraphManager {
 public:
   ParallelBuiltFlatGraphManager(
-      common::Coordinator<common::DoubleTime> *coordinator,
-      const CellParameters &parameters,
-      const GridGraphManagerParameters &graph_parameters)
-      :
-      FlatGraphManager(coordinator, parameters, graph_parameters)
-  {
+    common::Coordinator<common::DoubleTime> *coordinator,
+    const CellParameters &parameters,
+    const GridGraphManagerParameters &graph_parameters)
+    :
+    FlatGraphManager(coordinator, parameters, graph_parameters) {
     // inputs
     unsigned int k = 0;
 
@@ -277,40 +270,40 @@ public:
 //                        }
   }
 
-  void init()
-  {}
+  void init() {}
 
-  void start(common::DoubleTime::type /* t */)
-  {}
+  void start(common::DoubleTime::type /* t */) {}
 
   void transition(
-      const common::Models<common::DoubleTime> & /* receivers */,
-      common::DoubleTime::type /* t */)
-  {}
+    const common::Models<common::DoubleTime> & /* receivers */,
+    common::DoubleTime::type /* t */) {}
 
   ~ParallelBuiltFlatGraphManager() override = default;
 };
 
 class ParallelHierarchicalGraphManager :
-    public artis::pdevs::GraphManager<common::DoubleTime,
-                                      CellParameters,
-                                      GridGraphManagerParameters>
-{
+  public artis::pdevs::GraphManager<common::DoubleTime,
+    CellParameters, GridGraphManagerParameters> {
+
+  typedef artis::pdevs::multithreading::Coordinator<
+    common::DoubleTime,
+    ParallelHierarchicalGraphManager,
+    CellParameters,
+    GridGraphManagerParameters> parent_coordinator_type;
+
 public:
-  enum submodels
-  {
+  enum submodels {
     S1_1 = 0, S1_2, S2_1, S2_2
   };
 
   ParallelHierarchicalGraphManager(
-      common::Coordinator<common::DoubleTime> *coordinator,
-      const CellParameters &parameters,
-      const GridGraphManagerParameters &graph_parameters)
-      :
-      artis::pdevs::GraphManager<common::DoubleTime, CellParameters,
-                                 GridGraphManagerParameters>(
-          coordinator, parameters, graph_parameters)
-  {
+    common::Coordinator<common::DoubleTime> *coordinator,
+    const CellParameters &parameters,
+    const GridGraphManagerParameters &graph_parameters)
+    :
+    artis::pdevs::GraphManager<common::DoubleTime, CellParameters,
+      GridGraphManagerParameters>(
+      coordinator, parameters, graph_parameters) {
     // build coordinators (graphs)
     for (unsigned int i = 0; i < 2; ++i) {
       for (unsigned int j = 0; j < 2; ++j) {
@@ -352,60 +345,28 @@ public:
 
   }
 
-  ~ParallelHierarchicalGraphManager() override
-  {
+  ~ParallelHierarchicalGraphManager() override {
     for (typename Coordinators::const_iterator it = _coordinators.begin();
          it != _coordinators.end(); ++it) {
       delete *it;
     }
   }
 
-  void init()
-  {
+  void init() {
     std::for_each(_coordinators.begin(), _coordinators.end(),
                   [this](ParallelCoordinator *coordinator) {
-                    coordinator->set_sender(
-                        (dynamic_cast< artis::pdevs::multithreading::Coordinator<
-                            artis::common::DoubleTime,
-                            ParallelHierarchicalGraphManager,
-                            CellParameters,
-                            GridGraphManagerParameters> *>(this->coordinator()))->get_sender());
-                  });
-  }
-
-  void start(common::DoubleTime::type t)
-  {
-    std::for_each(_coordinators.begin(), _coordinators.end(),
-                  [t](ParallelCoordinator *coordinator) {
-                    coordinator->get_sender().send(
-                        artis::pdevs::multithreading::start_message<
-                            artis::common::DoubleTime>(t));
-                  });
-  }
-
-  void transition(const common::Models<common::DoubleTime> &receivers,
-                  artis::common::DoubleTime::type t)
-  {
-    std::for_each(receivers.begin(), receivers.end(),
-                  [this, t](const common::Model<common::DoubleTime> *model) {
-                    if (not model->is_atomic()) {
-                      typename Coordinators::const_iterator itc =
-                          std::find(_coordinators.begin(),
-                                    _coordinators.end(), model);
-
-                      (*itc)->get_sender().send(
-                          artis::pdevs::multithreading::transition_message<
-                              artis::common::DoubleTime>(t));
-                    }
+                    dynamic_cast< parent_coordinator_type *>(this->coordinator())
+                      ->attach_child(coordinator, coordinator->get_queue());
+                    coordinator->attach_parent(dynamic_cast< parent_coordinator_type *>(this->coordinator())->get_queue());
                   });
   }
 
 private:
   typedef artis::pdevs::multithreading::Coordinator<
-      common::DoubleTime,
-      ParallelBuiltFlatGraphManager,
-      CellParameters,
-      GridGraphManagerParameters
+    common::DoubleTime,
+    ParallelBuiltFlatGraphManager,
+    CellParameters,
+    GridGraphManagerParameters
   > ParallelCoordinator;
   typedef std::vector<ParallelCoordinator *> Coordinators;
 

+ 222 - 228
src/tests/multithreading/lifegame/main.cpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -37,224 +37,221 @@ using namespace std::chrono;
 using namespace artis::tests::multithreading::lifegame;
 
 CellParameters parameters({
-                              {
-                                  {"C_1_1", 3},
-                                  {"C_1_2", 5},
-                                  {"C_1_3", 5},
-                                  {"C_1_4", 5},
-                                  {"C_1_5", 5},
-                                  {"C_1_6", 5},
-                                  {"C_1_7", 5},
-                                  {"C_1_8", 5},
-                                  {"C_1_9", 5},
-                                  {"C_1_10", 3},
-                                  {"C_2_1", 5},
-                                  {"C_2_2", 8},
-                                  {"C_2_3", 8},
-                                  {"C_2_4", 8},
-                                  {"C_2_5", 8},
-                                  {"C_2_6", 8},
-                                  {"C_2_7", 8},
-                                  {"C_2_8", 8},
-                                  {"C_2_9", 8},
-                                  {"C_2_10", 5},
-                                  {"C_3_1", 5},
-                                  {"C_3_2", 8},
-                                  {"C_3_3", 8},
-                                  {"C_3_4", 8},
-                                  {"C_3_5", 8},
-                                  {"C_3_6", 8},
-                                  {"C_3_7", 8},
-                                  {"C_3_8", 8},
-                                  {"C_3_9", 8},
-                                  {"C_3_10", 5},
-                                  {"C_4_1", 5},
-                                  {"C_4_2", 8},
-                                  {"C_4_3", 8},
-                                  {"C_4_4", 8},
-                                  {"C_4_5", 8},
-                                  {"C_4_6", 8},
-                                  {"C_4_7", 8},
-                                  {"C_4_8", 8},
-                                  {"C_4_9", 8},
-                                  {"C_4_10", 5},
-                                  {"C_5_1", 5},
-                                  {"C_5_2", 8},
-                                  {"C_5_3", 8},
-                                  {"C_5_4", 8},
-                                  {"C_5_5", 8},
-                                  {"C_5_6", 8},
-                                  {"C_5_7", 8},
-                                  {"C_5_8", 8},
-                                  {"C_5_9", 8},
-                                  {"C_5_10", 5},
-                                  {"C_6_1", 5},
-                                  {"C_6_2", 8},
-                                  {"C_6_3", 8},
-                                  {"C_6_4", 8},
-                                  {"C_6_5", 8},
-                                  {"C_6_6", 8},
-                                  {"C_6_7", 8},
-                                  {"C_6_8", 8},
-                                  {"C_6_9", 8},
-                                  {"C_6_10", 5},
-                                  {"C_7_1", 5},
-                                  {"C_7_2", 8},
-                                  {"C_7_3", 8},
-                                  {"C_7_4", 8},
-                                  {"C_7_5", 8},
-                                  {"C_7_6", 8},
-                                  {"C_7_7", 8},
-                                  {"C_7_8", 8},
-                                  {"C_7_9", 8},
-                                  {"C_7_10", 5},
-                                  {"C_8_1", 5},
-                                  {"C_8_2", 8},
-                                  {"C_8_3", 8},
-                                  {"C_8_4", 8},
-                                  {"C_8_5", 8},
-                                  {"C_8_6", 8},
-                                  {"C_8_7", 8},
-                                  {"C_8_8", 8},
-                                  {"C_8_9", 8},
-                                  {"C_8_10", 5},
-                                  {"C_9_1", 5},
-                                  {"C_9_2", 8},
-                                  {"C_9_3", 8},
-                                  {"C_9_4", 8},
-                                  {"C_9_5", 8},
-                                  {"C_9_6", 8},
-                                  {"C_9_7", 8},
-                                  {"C_9_8", 8},
-                                  {"C_9_9", 8},
-                                  {"C_9_10", 5},
-                                  {"C_10_1", 3},
-                                  {"C_10_2", 5},
-                                  {"C_10_3", 5},
-                                  {"C_10_4", 5},
-                                  {"C_10_5", 5},
-                                  {"C_10_6", 5},
-                                  {"C_10_7", 5},
-                                  {"C_10_8", 5},
-                                  {"C_10_9", 5},
-                                  {"C_10_10", 3}
-                              },
-                              {
-                                  {"C_1_1", false},
-                                  {"C_1_2", false},
-                                  {"C_1_3", false},
-                                  {"C_1_4", false},
-                                  {"C_1_5", false},
-                                  {"C_1_6", false},
-                                  {"C_1_7", false},
-                                  {"C_1_8", false},
-                                  {"C_1_9", false},
-                                  {"C_1_10", false},
-                                  {"C_2_1", false},
-                                  {"C_2_2", false},
-                                  {"C_2_3", false},
-                                  {"C_2_4", false},
-                                  {"C_2_5", true},
-                                  {"C_2_6", true},
-                                  {"C_2_7", false},
-                                  {"C_2_8", false},
-                                  {"C_2_9", false},
-                                  {"C_2_10", false},
-                                  {"C_3_1", false},
-                                  {"C_3_2", false},
-                                  {"C_3_3", false},
-                                  {"C_3_4", true},
-                                  {"C_3_5", false},
-                                  {"C_3_6", false},
-                                  {"C_3_7", true},
-                                  {"C_3_8", false},
-                                  {"C_3_9", false},
-                                  {"C_3_10", false},
-                                  {"C_4_1", false},
-                                  {"C_4_2", false},
-                                  {"C_4_3", true},
-                                  {"C_4_4", false},
-                                  {"C_4_5", false},
-                                  {"C_4_6", false},
-                                  {"C_4_7", false},
-                                  {"C_4_8", true},
-                                  {"C_4_9", false},
-                                  {"C_4_10", false},
-                                  {"C_5_1", false},
-                                  {"C_5_2", true},
-                                  {"C_5_3", false},
-                                  {"C_5_4", false},
-                                  {"C_5_5", false},
-                                  {"C_5_6", false},
-                                  {"C_5_7", false},
-                                  {"C_5_8", false},
-                                  {"C_5_9", true},
-                                  {"C_5_10", false},
-                                  {"C_6_1", false},
-                                  {"C_6_2", true},
-                                  {"C_6_3", false},
-                                  {"C_6_4", false},
-                                  {"C_6_5", false},
-                                  {"C_6_6", false},
-                                  {"C_6_7", false},
-                                  {"C_6_8", false},
-                                  {"C_6_9", true},
-                                  {"C_6_10", false},
-                                  {"C_7_1", false},
-                                  {"C_7_2", false},
-                                  {"C_7_3", true},
-                                  {"C_7_4", false},
-                                  {"C_7_5", false},
-                                  {"C_7_6", false},
-                                  {"C_7_7", false},
-                                  {"C_7_8", true},
-                                  {"C_7_9", false},
-                                  {"C_7_10", false},
-                                  {"C_8_1", false},
-                                  {"C_8_2", false},
-                                  {"C_8_3", false},
-                                  {"C_8_4", true},
-                                  {"C_8_5", false},
-                                  {"C_8_6", false},
-                                  {"C_8_7", true},
-                                  {"C_8_8", false},
-                                  {"C_8_9", false},
-                                  {"C_8_10", false},
-                                  {"C_9_1", false},
-                                  {"C_9_2", false},
-                                  {"C_9_3", false},
-                                  {"C_9_4", false},
-                                  {"C_9_5", true},
-                                  {"C_9_6", true},
-                                  {"C_9_7", false},
-                                  {"C_9_8", false},
-                                  {"C_9_9", false},
-                                  {"C_9_10", false},
-                                  {"C_10_1", false},
-                                  {"C_10_2", false},
-                                  {"C_10_3", false},
-                                  {"C_10_4", false},
-                                  {"C_10_5", false},
-                                  {"C_10_6", false},
-                                  {"C_10_7", false},
-                                  {"C_10_8", false},
-                                  {"C_10_9", false},
-                                  {"C_10_10", false}
-                              }
+                            {
+                              {"C_1_1", 3},
+                              {"C_1_2", 5},
+                              {"C_1_3", 5},
+                              {"C_1_4", 5},
+                              {"C_1_5", 5},
+                              {"C_1_6", 5},
+                              {"C_1_7", 5},
+                              {"C_1_8", 5},
+                              {"C_1_9", 5},
+                              {"C_1_10", 3},
+                              {"C_2_1", 5},
+                              {"C_2_2", 8},
+                              {"C_2_3", 8},
+                              {"C_2_4", 8},
+                              {"C_2_5", 8},
+                              {"C_2_6", 8},
+                              {"C_2_7", 8},
+                              {"C_2_8", 8},
+                              {"C_2_9", 8},
+                              {"C_2_10", 5},
+                              {"C_3_1", 5},
+                              {"C_3_2", 8},
+                              {"C_3_3", 8},
+                              {"C_3_4", 8},
+                              {"C_3_5", 8},
+                              {"C_3_6", 8},
+                              {"C_3_7", 8},
+                              {"C_3_8", 8},
+                              {"C_3_9", 8},
+                              {"C_3_10", 5},
+                              {"C_4_1", 5},
+                              {"C_4_2", 8},
+                              {"C_4_3", 8},
+                              {"C_4_4", 8},
+                              {"C_4_5", 8},
+                              {"C_4_6", 8},
+                              {"C_4_7", 8},
+                              {"C_4_8", 8},
+                              {"C_4_9", 8},
+                              {"C_4_10", 5},
+                              {"C_5_1", 5},
+                              {"C_5_2", 8},
+                              {"C_5_3", 8},
+                              {"C_5_4", 8},
+                              {"C_5_5", 8},
+                              {"C_5_6", 8},
+                              {"C_5_7", 8},
+                              {"C_5_8", 8},
+                              {"C_5_9", 8},
+                              {"C_5_10", 5},
+                              {"C_6_1", 5},
+                              {"C_6_2", 8},
+                              {"C_6_3", 8},
+                              {"C_6_4", 8},
+                              {"C_6_5", 8},
+                              {"C_6_6", 8},
+                              {"C_6_7", 8},
+                              {"C_6_8", 8},
+                              {"C_6_9", 8},
+                              {"C_6_10", 5},
+                              {"C_7_1", 5},
+                              {"C_7_2", 8},
+                              {"C_7_3", 8},
+                              {"C_7_4", 8},
+                              {"C_7_5", 8},
+                              {"C_7_6", 8},
+                              {"C_7_7", 8},
+                              {"C_7_8", 8},
+                              {"C_7_9", 8},
+                              {"C_7_10", 5},
+                              {"C_8_1", 5},
+                              {"C_8_2", 8},
+                              {"C_8_3", 8},
+                              {"C_8_4", 8},
+                              {"C_8_5", 8},
+                              {"C_8_6", 8},
+                              {"C_8_7", 8},
+                              {"C_8_8", 8},
+                              {"C_8_9", 8},
+                              {"C_8_10", 5},
+                              {"C_9_1", 5},
+                              {"C_9_2", 8},
+                              {"C_9_3", 8},
+                              {"C_9_4", 8},
+                              {"C_9_5", 8},
+                              {"C_9_6", 8},
+                              {"C_9_7", 8},
+                              {"C_9_8", 8},
+                              {"C_9_9", 8},
+                              {"C_9_10", 5},
+                              {"C_10_1", 3},
+                              {"C_10_2", 5},
+                              {"C_10_3", 5},
+                              {"C_10_4", 5},
+                              {"C_10_5", 5},
+                              {"C_10_6", 5},
+                              {"C_10_7", 5},
+                              {"C_10_8", 5},
+                              {"C_10_9", 5},
+                              {"C_10_10", 3}
+                            },
+                            {
+                              {"C_1_1", false},
+                              {"C_1_2", false},
+                              {"C_1_3", false},
+                              {"C_1_4", false},
+                              {"C_1_5", false},
+                              {"C_1_6", false},
+                              {"C_1_7", false},
+                              {"C_1_8", false},
+                              {"C_1_9", false},
+                              {"C_1_10", false},
+                              {"C_2_1", false},
+                              {"C_2_2", false},
+                              {"C_2_3", false},
+                              {"C_2_4", false},
+                              {"C_2_5", true},
+                              {"C_2_6", true},
+                              {"C_2_7", false},
+                              {"C_2_8", false},
+                              {"C_2_9", false},
+                              {"C_2_10", false},
+                              {"C_3_1", false},
+                              {"C_3_2", false},
+                              {"C_3_3", false},
+                              {"C_3_4", true},
+                              {"C_3_5", false},
+                              {"C_3_6", false},
+                              {"C_3_7", true},
+                              {"C_3_8", false},
+                              {"C_3_9", false},
+                              {"C_3_10", false},
+                              {"C_4_1", false},
+                              {"C_4_2", false},
+                              {"C_4_3", true},
+                              {"C_4_4", false},
+                              {"C_4_5", false},
+                              {"C_4_6", false},
+                              {"C_4_7", false},
+                              {"C_4_8", true},
+                              {"C_4_9", false},
+                              {"C_4_10", false},
+                              {"C_5_1", false},
+                              {"C_5_2", true},
+                              {"C_5_3", false},
+                              {"C_5_4", false},
+                              {"C_5_5", false},
+                              {"C_5_6", false},
+                              {"C_5_7", false},
+                              {"C_5_8", false},
+                              {"C_5_9", true},
+                              {"C_5_10", false},
+                              {"C_6_1", false},
+                              {"C_6_2", true},
+                              {"C_6_3", false},
+                              {"C_6_4", false},
+                              {"C_6_5", false},
+                              {"C_6_6", false},
+                              {"C_6_7", false},
+                              {"C_6_8", false},
+                              {"C_6_9", true},
+                              {"C_6_10", false},
+                              {"C_7_1", false},
+                              {"C_7_2", false},
+                              {"C_7_3", true},
+                              {"C_7_4", false},
+                              {"C_7_5", false},
+                              {"C_7_6", false},
+                              {"C_7_7", false},
+                              {"C_7_8", true},
+                              {"C_7_9", false},
+                              {"C_7_10", false},
+                              {"C_8_1", false},
+                              {"C_8_2", false},
+                              {"C_8_3", false},
+                              {"C_8_4", true},
+                              {"C_8_5", false},
+                              {"C_8_6", false},
+                              {"C_8_7", true},
+                              {"C_8_8", false},
+                              {"C_8_9", false},
+                              {"C_8_10", false},
+                              {"C_9_1", false},
+                              {"C_9_2", false},
+                              {"C_9_3", false},
+                              {"C_9_4", false},
+                              {"C_9_5", true},
+                              {"C_9_6", true},
+                              {"C_9_7", false},
+                              {"C_9_8", false},
+                              {"C_9_9", false},
+                              {"C_9_10", false},
+                              {"C_10_1", false},
+                              {"C_10_2", false},
+                              {"C_10_3", false},
+                              {"C_10_4", false},
+                              {"C_10_5", false},
+                              {"C_10_6", false},
+                              {"C_10_7", false},
+                              {"C_10_8", false},
+                              {"C_10_9", false},
+                              {"C_10_10", false}
+                            }
                           });
 GridGraphManagerParameters graph_parameters({1, 10, 1, 10, 1, 10, 1, 10});
 
-class View : public artis::observer::View<artis::common::DoubleTime>
-{
+class View : public artis::common::observer::View<artis::common::DoubleTime> {
 public:
-  View()
-  {
+  View() {
     selector("Cell:state", {FlatGraphManager::CELL, ALL, Cell::STATE});
   }
 };
 
-void show_state(const artis::observer::View<artis::common::DoubleTime> &view)
-{
+void show_state(const artis::common::observer::View<artis::common::DoubleTime> &view) {
   std::vector<std::vector<std::vector<bool> > > states;
 
   for (unsigned int t = 0; t <= 11; ++t) {
@@ -295,15 +292,14 @@ void show_state(const artis::observer::View<artis::common::DoubleTime> &view)
   }
 }
 
-double lifegame_monothreading()
-{
+double lifegame_monothreading() {
   artis::common::context::Context<artis::common::DoubleTime> context(0, 10);
   artis::common::RootCoordinator<
-      DoubleTime, artis::pdevs::Coordinator<
-          DoubleTime,
-          FlatGraphManager,
-          CellParameters,
-          GridGraphManagerParameters>
+    DoubleTime, artis::pdevs::Coordinator<
+      DoubleTime,
+      FlatGraphManager,
+      CellParameters,
+      GridGraphManagerParameters>
   > rc(context, "root", parameters, graph_parameters);
 
   rc.attachView("Matrix", new ::View());
@@ -321,15 +317,14 @@ double lifegame_monothreading()
   return time_span.count();
 }
 
-double lifegame_multithreading()
-{
+double lifegame_multithreading() {
   artis::common::context::Context<artis::common::DoubleTime> context(0, 10);
   artis::common::RootCoordinator<
-      DoubleTime, artis::pdevs::multithreading::Coordinator<
-          DoubleTime,
-          ParallelHierarchicalGraphManager,
-          CellParameters,
-          GridGraphManagerParameters>
+    DoubleTime, artis::pdevs::multithreading::Coordinator<
+      DoubleTime,
+      ParallelHierarchicalGraphManager,
+      CellParameters,
+      GridGraphManagerParameters>
   > rc(context, "root", parameters, graph_parameters);
 
   steady_clock::time_point t1 = steady_clock::now();
@@ -343,9 +338,8 @@ double lifegame_multithreading()
   return time_span.count();
 }
 
-int main()
-{
-//    std::cout << lifegame_monothreading() << std::endl;
+int main() {
+  std::cout << lifegame_monothreading() << std::endl;
   std::cout << lifegame_multithreading() << std::endl;
   return 0;
 }

+ 27 - 41
src/tests/multithreading/lifegame/models.hpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -36,38 +36,32 @@ namespace tests {
 namespace multithreading {
 namespace lifegame {
 
-struct CellParameters
-{
+struct CellParameters {
   std::map<std::string, int> neighbour_numbers;
   std::map<std::string, bool> initial_states;
 };
 
 class Cell
-    : public artis::pdevs::Dynamics<common::DoubleTime, Cell, CellParameters>
-{
+  : public artis::pdevs::Dynamics<common::DoubleTime, Cell, CellParameters> {
 public:
-  enum inputs
-  {
+  enum inputs {
     IN
   };
-  enum outputs
-  {
+  enum outputs {
     OUT
   };
-  enum states
-  {
+  enum states {
     STATE
   };
 
   Cell(const std::string &name,
        const artis::pdevs::Context<common::DoubleTime, Cell, CellParameters> &context)
-      :
-      artis::pdevs::Dynamics<common::DoubleTime, Cell, CellParameters>(name,
-                                                                       context),
-      _neighbour_number(
-          context.parameters().neighbour_numbers.find(name)->second),
-      _initial_state(context.parameters().initial_states.find(name)->second)
-  {
+    :
+    artis::pdevs::Dynamics<common::DoubleTime, Cell, CellParameters>(name,
+                                                                     context),
+    _neighbour_number(
+      context.parameters().neighbour_numbers.find(name)->second),
+    _initial_state(context.parameters().initial_states.find(name)->second) {
     input_ports({{IN, "in"}});
     output_ports({{OUT, "out"}});
     observables({{STATE, "state"}});
@@ -75,14 +69,13 @@ public:
 
   ~Cell() override = default;
 
-  void dint(const typename common::DoubleTime::type & /* t */) override
-  {
+  void dint(const typename common::DoubleTime::type & /* t */) override {
     if (_phase == SEND) {
       _phase = WAIT;
       _sigma = common::DoubleTime::infinity;
     } else if (_phase == NEW_STATE) {
       if (_state and (_true_neighbour_number < 2
-          or _true_neighbour_number > 3)) {
+                      or _true_neighbour_number > 3)) {
         _state = false;
       } else if (not _state and (_true_neighbour_number == 3)) {
         _state = true;
@@ -96,10 +89,9 @@ public:
 
   void dext(const typename common::DoubleTime::type & /* t */,
             const typename common::DoubleTime::type & /* e */,
-            const common::Bag<common::DoubleTime> &bag) override
-  {
+            const common::event::Bag<common::DoubleTime> &bag) override {
     std::for_each(bag.begin(), bag.end(),
-                  [this](const common::ExternalEvent<common::DoubleTime> &e) {
+                  [this](const common::event::ExternalEvent<common::DoubleTime> &e) {
                     if (e.on_port(IN)) {
                       bool data;
 
@@ -122,13 +114,11 @@ public:
   void
   dconf(const typename common::DoubleTime::type &t,
         const typename common::DoubleTime::type &e,
-        const common::Bag<common::DoubleTime> &bag) override
-  {
+        const common::event::Bag<common::DoubleTime> &bag) override {
     dext(t, e, bag);
   }
 
-  void start(const typename common::DoubleTime::type &t) override
-  {
+  void start(const typename common::DoubleTime::type &t) override {
     (void) t;
 
     _phase = SEND;
@@ -139,35 +129,31 @@ public:
   }
 
   typename common::DoubleTime::type
-  ta(const typename common::DoubleTime::type & /* t */) const override
-  {
+  ta(const typename common::DoubleTime::type & /* t */) const override {
     return _sigma;
   }
 
-  common::Bag<common::DoubleTime>
-  lambda(const typename common::DoubleTime::type & /* t */) const override
-  {
-    common::Bag<common::DoubleTime> bag;
+  common::event::Bag<common::DoubleTime>
+  lambda(const typename common::DoubleTime::type & /* t */) const override {
+    common::event::Bag<common::DoubleTime> bag;
 
     if (_phase == SEND) {
       bag.push_back(
-          artis::common::ExternalEvent<common::DoubleTime>(OUT, _state));
+        artis::common::event::ExternalEvent<common::DoubleTime>(OUT, _state));
     }
     return bag;
   }
 
-  common::Value observe(const common::DoubleTime::type & /* t */,
-                        unsigned int index) const override
-  {
+  common::event::Value observe(const common::DoubleTime::type & /* t */,
+                               unsigned int index) const override {
     if (index == STATE) {
       return _state;
     }
-    return common::Value();
+    return common::event::Value();
   }
 
 private:
-  enum Phase
-  {
+  enum Phase {
     SEND, WAIT, NEW_STATE
   };
 

+ 49 - 49
src/tests/multithreading/simple/graph_manager.hpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -195,59 +195,59 @@ public:
     return *std::min(lookaheads.begin(), lookaheads.end());
   }
 
-//  void init()
-//  {
-//    dynamic_cast< coordinator_type *>(this->coordinator())
-//        ->attach_child(&_link_1_2, _link_1_2.get_queue());
-//    dynamic_cast< coordinator_type *>(this->coordinator())
-//        ->attach_child(&_link_3_4, _link_3_4.get_queue());
-//    dynamic_cast< coordinator_type *>(this->coordinator())
-//        ->attach_child(&_link_5_6, _link_5_6.get_queue());
-//    dynamic_cast< coordinator_type *>(this->coordinator())
-//        ->attach_child(&_link_7_8, _link_7_8.get_queue());
-//
-//    _link_1_2.attach_parent(dynamic_cast< coordinator_type *>(this->coordinator())->get_queue());
-//    _link_3_4.attach_parent(dynamic_cast< coordinator_type *>(this->coordinator())->get_queue());
-//    _link_5_6.attach_parent(dynamic_cast< coordinator_type *>(this->coordinator())->get_queue());
-//    _link_7_8.attach_parent(dynamic_cast< coordinator_type *>(this->coordinator())->get_queue());
-//  }
+  void init()
+  {
+    dynamic_cast< coordinator_type *>(this->coordinator())
+        ->attach_child(&_link_1_2, _link_1_2.get_queue());
+    dynamic_cast< coordinator_type *>(this->coordinator())
+        ->attach_child(&_link_3_4, _link_3_4.get_queue());
+    dynamic_cast< coordinator_type *>(this->coordinator())
+        ->attach_child(&_link_5_6, _link_5_6.get_queue());
+    dynamic_cast< coordinator_type *>(this->coordinator())
+        ->attach_child(&_link_7_8, _link_7_8.get_queue());
+
+    _link_1_2.attach_parent(dynamic_cast< coordinator_type *>(this->coordinator())->get_queue());
+    _link_3_4.attach_parent(dynamic_cast< coordinator_type *>(this->coordinator())->get_queue());
+    _link_5_6.attach_parent(dynamic_cast< coordinator_type *>(this->coordinator())->get_queue());
+    _link_7_8.attach_parent(dynamic_cast< coordinator_type *>(this->coordinator())->get_queue());
+  }
 
 private:
   artis::pdevs::Simulator<artis::common::DoubleTime, Generator, GeneratorParameters> _generator;
 
-  artis::pdevs::Coordinator<artis::common::DoubleTime,
-                            LinksGraphManager,
-                            GeneratorParameters,
-                            artis::common::NoParameters> _link_1_2;
-  artis::pdevs::Coordinator<artis::common::DoubleTime,
-                            LinksGraphManager,
-                            GeneratorParameters,
-                            artis::common::NoParameters> _link_3_4;
-  artis::pdevs::Coordinator<artis::common::DoubleTime,
-                            LinksGraphManager,
-                            GeneratorParameters,
-                            artis::common::NoParameters> _link_5_6;
-  artis::pdevs::Coordinator<artis::common::DoubleTime,
-                            LinksGraphManager,
-                            GeneratorParameters,
-                            artis::common::NoParameters> _link_7_8;
+//  artis::pdevs::Coordinator<artis::common::DoubleTime,
+//                            LinksGraphManager,
+//                            GeneratorParameters,
+//                            artis::common::NoParameters> _link_1_2;
+//  artis::pdevs::Coordinator<artis::common::DoubleTime,
+//                            LinksGraphManager,
+//                            GeneratorParameters,
+//                            artis::common::NoParameters> _link_3_4;
+//  artis::pdevs::Coordinator<artis::common::DoubleTime,
+//                            LinksGraphManager,
+//                            GeneratorParameters,
+//                            artis::common::NoParameters> _link_5_6;
+//  artis::pdevs::Coordinator<artis::common::DoubleTime,
+//                            LinksGraphManager,
+//                            GeneratorParameters,
+//                            artis::common::NoParameters> _link_7_8;
 
-//  artis::pdevs::multithreading::Coordinator<artis::common::DoubleTime,
-//                                            LinksGraphManager,
-//                                            GeneratorParameters,
-//                                            artis::common::NoParameters> _link_1_2;
-//  artis::pdevs::multithreading::Coordinator<artis::common::DoubleTime,
-//                                            LinksGraphManager,
-//                                            GeneratorParameters,
-//                                            artis::common::NoParameters> _link_3_4;
-//  artis::pdevs::multithreading::Coordinator<artis::common::DoubleTime,
-//                                            LinksGraphManager,
-//                                            GeneratorParameters,
-//                                            artis::common::NoParameters> _link_5_6;
-//  artis::pdevs::multithreading::Coordinator<artis::common::DoubleTime,
-//                                            LinksGraphManager,
-//                                            GeneratorParameters,
-//                                            artis::common::NoParameters> _link_7_8;
+  artis::pdevs::multithreading::Coordinator<artis::common::DoubleTime,
+                                            LinksGraphManager,
+                                            GeneratorParameters,
+                                            artis::common::NoParameters> _link_1_2;
+  artis::pdevs::multithreading::Coordinator<artis::common::DoubleTime,
+                                            LinksGraphManager,
+                                            GeneratorParameters,
+                                            artis::common::NoParameters> _link_3_4;
+  artis::pdevs::multithreading::Coordinator<artis::common::DoubleTime,
+                                            LinksGraphManager,
+                                            GeneratorParameters,
+                                            artis::common::NoParameters> _link_5_6;
+  artis::pdevs::multithreading::Coordinator<artis::common::DoubleTime,
+                                            LinksGraphManager,
+                                            GeneratorParameters,
+                                            artis::common::NoParameters> _link_7_8;
 
   artis::pdevs::Simulator<artis::common::DoubleTime, Counter> _counter;
 };

+ 29 - 29
src/tests/multithreading/simple/main.cpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
  */
 
 #include <artis-star/common/RootCoordinator.hpp>
-#include <artis-star/kernel/pdevs/multithreading/RootCoordinator.hpp>
+#include <artis-star/kernel/pdevs/multithreading/Coordinator.hpp>
 
 #include <tests/multithreading/simple/graph_manager.hpp>
 #include <tests/multithreading/simple/models.hpp>
@@ -37,35 +37,12 @@ using namespace artis::common;
 using namespace std::chrono;
 using namespace artis::tests::multithreading::simple;
 
-void simple_monothreading()
-{
-  GeneratorParameters parameters = {10, 2, 5, 763752};
-  artis::common::context::Context<artis::common::DoubleTime> context(0, 200000);
-  artis::common::RootCoordinator<
-      DoubleTime, artis::pdevs::Coordinator<
-          DoubleTime,
-          SimpleGraphManager,
-          GeneratorParameters,
-          NoParameters>
-  > rc(context, "root", parameters, NoParameters());
-
-  steady_clock::time_point t1 = steady_clock::now();
-
-  rc.run(context);
-
-  steady_clock::time_point t2 = steady_clock::now();
-
-  duration<double> time_span = duration_cast<duration<double> >(t2 - t1);
-
-  std::cout << "Time = " << time_span.count() << std::endl;
-}
-
-//void simple_multithreading()
+//void simple_monothreading()
 //{
 //  GeneratorParameters parameters = {10, 2, 5, 763752};
 //  artis::common::context::Context<artis::common::DoubleTime> context(0, 200000);
 //  artis::common::RootCoordinator<
-//      DoubleTime, artis::pdevs::multithreading::Coordinator<
+//      DoubleTime, artis::pdevs::Coordinator<
 //          DoubleTime,
 //          SimpleGraphManager,
 //          GeneratorParameters,
@@ -83,9 +60,32 @@ void simple_monothreading()
 //  std::cout << "Time = " << time_span.count() << std::endl;
 //}
 
+void simple_multithreading()
+{
+  GeneratorParameters parameters = {10, 2, 5, 763752};
+  artis::common::context::Context<artis::common::DoubleTime> context(0, 200000);
+  artis::common::RootCoordinator<
+      DoubleTime, artis::pdevs::multithreading::Coordinator<
+          DoubleTime,
+          SimpleGraphManager,
+          GeneratorParameters,
+          NoParameters>
+  > rc(context, "root", parameters, NoParameters());
+
+  steady_clock::time_point t1 = steady_clock::now();
+
+  rc.run(context);
+
+  steady_clock::time_point t2 = steady_clock::now();
+
+  duration<double> time_span = duration_cast<duration<double> >(t2 - t1);
+
+  std::cout << "Time = " << time_span.count() << std::endl;
+}
+
 int main()
 {
-  simple_monothreading();
-//  simple_multithreading();
+//  simple_monothreading();
+  simple_multithreading();
   return 0;
 }

+ 12 - 12
src/tests/multithreading/simple/models.hpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -142,10 +142,10 @@ public:
   ta(const artis::common::DoubleTime::type & /* t */) const override
   { return _sigma; }
 
-  artis::common::Bag<artis::common::DoubleTime>
+  artis::common::event::Bag<artis::common::DoubleTime>
   lambda(const artis::common::DoubleTime::type &t) const override
   {
-    artis::common::Bag<artis::common::DoubleTime> bag;
+    artis::common::event::Bag<artis::common::DoubleTime> bag;
 
 //    std::cout << get_full_name() << " at " << t << " - lambda" << std::endl;
 
@@ -153,7 +153,7 @@ public:
       Vehicle vehicle = {_index, _next_v_max, 0.5, State::STOP, t};
 
       bag.push_back(
-          artis::common::ExternalEvent<artis::common::DoubleTime>(
+          artis::common::event::ExternalEvent<artis::common::DoubleTime>(
               outputs::OUT + _next_port, vehicle));
     }
     return bag;
@@ -215,7 +215,7 @@ public:
 
   void dext(const artis::common::DoubleTime::type & /* t */,
             const artis::common::DoubleTime::type & /* e */,
-            const artis::common::Bag<artis::common::DoubleTime> &bag) override
+            const artis::common::event::Bag<artis::common::DoubleTime> &bag) override
   {
 
 //    std::cout << get_full_name() << " at " << t << " - dext" << std::endl;
@@ -237,13 +237,13 @@ public:
     return artis::common::DoubleTime::infinity;
   }
 
-  artis::common::Value observe(const artis::common::DoubleTime::type & /* t */,
+  artis::common::event::Value observe(const artis::common::DoubleTime::type & /* t */,
           unsigned int index) const override
   {
     if (index == vars::COUNTER) {
       return _counter;
     } else {
-      return artis::common::Value();
+      return artis::common::event::Value();
     }
   }
 
@@ -335,13 +335,13 @@ public :
 
   void dext(const artis::common::DoubleTime::type &t,
             const artis::common::DoubleTime::type & /* e */,
-            const artis::common::Bag<artis::common::DoubleTime> &bag) override
+            const artis::common::event::Bag<artis::common::DoubleTime> &bag) override
   {
 
 //    std::cout << get_full_name() << " at " << t << " - dext" << std::endl;
 
     std::for_each(bag.begin(), bag.end(),
-                  [this, t](const common::ExternalEvent<common::DoubleTime> &event) {
+                  [this, t](const common::event::ExternalEvent<common::DoubleTime> &event) {
                     if (event.on_port(inputs::IN)) {
                       Vehicle vehicle;
 
@@ -357,17 +357,17 @@ public :
   artis::common::DoubleTime::type ta(const artis::common::DoubleTime::type & /* t */) const override
   { return _sigma; }
 
-  artis::common::Bag<artis::common::DoubleTime>
+  artis::common::event::Bag<artis::common::DoubleTime>
   lambda(const artis::common::DoubleTime::type &t) const override
   {
-    artis::common::Bag<artis::common::DoubleTime> bag;
+    artis::common::event::Bag<artis::common::DoubleTime> bag;
 
 //    std::cout << get_full_name() << " at " << t << " - lambda" << std::endl;
 
     for (auto vehicle: _vehicles) {
       if (vehicle.next_time == t and vehicle.state == State::STOP) {
         bag.push_back(
-            artis::common::ExternalEvent<artis::common::DoubleTime>(
+            artis::common::event::ExternalEvent<artis::common::DoubleTime>(
                 outputs::OUT, vehicle));
       }
     }

+ 1 - 1
src/tests/pdevs/graph_manager.hpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by

+ 1 - 1
src/tests/pdevs/main.cpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by

+ 19 - 19
src/tests/pdevs/models.hpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -118,7 +118,7 @@ public:
   void
   dext(const typename common::DoubleTime::type &t,
        const typename common::DoubleTime::type & /* e */,
-       const common::Bag <common::DoubleTime> &msgs) override
+       const common::event::Bag <common::DoubleTime> &msgs) override
   {
 
 #ifndef WITH_TRACE
@@ -141,7 +141,7 @@ public:
 
   void dconf(const typename common::DoubleTime::type &t,
              const typename common::DoubleTime::type & /* e */,
-             const common::Bag <common::DoubleTime> &msgs) override
+             const common::event::Bag <common::DoubleTime> &msgs) override
   {
 
 #ifndef WITH_TRACE
@@ -204,17 +204,17 @@ public:
     }
   }
 
-  common::Bag <common::DoubleTime>
+  common::event::Bag <common::DoubleTime>
   lambda(const typename common::DoubleTime::type &t) const override
   {
 #ifndef WITH_TRACE
     (void)t;
 #endif
-    common::Bag<common::DoubleTime> msgs;
+    common::event::Bag<common::DoubleTime> msgs;
 
     if (_phase == SEND) {
       msgs.push_back(
-          artis::common::ExternalEvent<common::DoubleTime>(OUT, _value));
+          artis::common::event::ExternalEvent<common::DoubleTime>(OUT, _value));
     }
 
 #ifdef WITH_TRACE
@@ -288,7 +288,7 @@ public:
   void
   dext(const typename common::DoubleTime::type &t,
        const typename common::DoubleTime::type & /* e */,
-       const common::Bag <common::DoubleTime> &msgs) override
+       const common::event::Bag <common::DoubleTime> &msgs) override
   {
 
 #ifndef WITH_TRACE
@@ -311,7 +311,7 @@ public:
 
   void dconf(const typename common::DoubleTime::type &t,
              const typename common::DoubleTime::type &e,
-             const common::Bag <common::DoubleTime> &msgs) override
+             const common::event::Bag <common::DoubleTime> &msgs) override
   {
 
 #ifndef WITH_TRACE
@@ -376,17 +376,17 @@ public:
     }
   }
 
-  common::Bag <common::DoubleTime> lambda(
+  common::event::Bag <common::DoubleTime> lambda(
       const typename common::DoubleTime::type &t) const override
   {
 #ifndef WITH_TRACE
     (void)t;
 #endif
-    common::Bag<common::DoubleTime> msgs;
+    common::event::Bag<common::DoubleTime> msgs;
 
     if (_phase == SEND) {
       msgs.push_back(
-          artis::common::ExternalEvent<common::DoubleTime>(OUT, _value));
+          artis::common::event::ExternalEvent<common::DoubleTime>(OUT, _value));
     }
 
 #ifdef WITH_TRACE
@@ -451,13 +451,13 @@ public:
     }
   }
 
-  common::Bag <common::DoubleTime>
+  common::event::Bag <common::DoubleTime>
   lambda(const typename common::DoubleTime::type &t) const override
   {
 
     std::cout << (t - _last_time) << std::endl;
 
-    return common::Bag<common::DoubleTime>();
+    return common::event::Bag<common::DoubleTime>();
   }
 
 private:
@@ -505,16 +505,16 @@ public:
 
   void dconf(const typename common::DoubleTime::type &t,
              const typename common::DoubleTime::type &e,
-             const common::Bag <common::DoubleTime> &msgs) override
+             const common::event::Bag <common::DoubleTime> &msgs) override
   {
     dext(t, e, msgs);
   }
 
   void dext(const typename common::DoubleTime::type & /* t */,
             const typename common::DoubleTime::type & /* e */,
-            const common::Bag <common::DoubleTime> &msgs) override
+            const common::event::Bag <common::DoubleTime> &msgs) override
   {
-    for (common::Bag<common::DoubleTime>::const_iterator it = msgs.begin();
+    for (common::event::Bag<common::DoubleTime>::const_iterator it = msgs.begin();
          it != msgs.end();
          ++it) {
       ++n;
@@ -563,13 +563,13 @@ public:
   ta(const typename common::DoubleTime::type & /* t */) const override
   { return sigma; }
 
-  common::Bag <common::DoubleTime>
+  common::event::Bag <common::DoubleTime>
   lambda(const typename common::DoubleTime::type & /* t */) const override
   {
-    common::Bag<common::DoubleTime> msgs;
+    common::event::Bag<common::DoubleTime> msgs;
 
     if (full()) {
-      msgs.push_back(artis::common::ExternalEvent<common::DoubleTime>(OUT, 0));
+      msgs.push_back(artis::common::event::ExternalEvent<common::DoubleTime>(OUT, 0));
     }
     return msgs;
   }

+ 1 - 1
src/tests/pdevs/tests.cpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by

+ 1 - 1
src/tests/qss/graph_manager.hpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by

+ 91 - 103
src/tests/qss/main.cpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
 #include <tests/qss/graph_manager.hpp>
 
 #include <artis-star/common/RootCoordinator.hpp>
-#include <artis-star/common/observer/Iterator.hpp>
+#include <artis-star/common/observer/TimedIterator.hpp>
 #include <artis-star/common/observer/Output.hpp>
 
 #include <fstream>
@@ -36,17 +36,14 @@
 
 using namespace artis::tests::qss;
 
-void test_parabola()
-{
+void test_parabola() {
   artis::qss::QSSParameters<ParabolaParameters> parameters = {{0.5},
                                                               {true, true, 0.001, 3},
                                                               {0.2}};
 
-  class View : public artis::observer::View<artis::common::DoubleTime>
-  {
+  class View : public artis::common::observer::View<artis::common::DoubleTime> {
   public:
-    View()
-    {
+    View() {
       selector("Value",
                {OnlyOneParabolaGraphManager::A, ParabolaGraphManager::submodel::S_Integrator,
                 artis::qss::Integrator<artis::common::DoubleTime>::var::VALUE});
@@ -55,31 +52,29 @@ void test_parabola()
 
   artis::common::context::Context<artis::common::DoubleTime> context(0, 5);
   artis::common::RootCoordinator<
-      artis::common::DoubleTime, artis::pdevs::Coordinator<
-          artis::common::DoubleTime,
-          OnlyOneParabolaGraphManager,
-          artis::qss::QSSParameters<ParabolaParameters>>
+    artis::common::DoubleTime, artis::pdevs::Coordinator<
+      artis::common::DoubleTime,
+      OnlyOneParabolaGraphManager,
+      artis::qss::QSSParameters<ParabolaParameters>>
   > rc(context, "root", parameters, artis::common::NoParameters());
 
-  rc.attachView("Value", new View());
+//  rc.attachView("Value", new View());
 
   rc.run(context);
 
-  const View::Values &values = rc.observer().view("Value").get("Value");
-
-  for (const auto &value: values) {
-    double v;
-
-    value.second(v);
-    std::cout << value.first << ": " << v << std::endl;
-  }
+//  const View::Values &values = rc.observer().view("Value").get("Value");
+//
+//  for (const auto &value: values) {
+//    double v;
+//
+//    value.second(v);
+//    std::cout << value.first << ": " << v << std::endl;
+//  }
 }
 
-class PredatorPreyView : public artis::observer::View<artis::common::DoubleTime>
-{
+class PredatorPreyView : public artis::common::observer::View<artis::common::DoubleTime> {
 public:
-  PredatorPreyView()
-  {
+  PredatorPreyView() {
     selector("PredatorView",
              {PreyPredatorGraphManager::PREDATOR, PredatorGraphManager::submodel::S_Integrator,
               artis::qss::Integrator<artis::common::DoubleTime>::var::VALUE});
@@ -90,24 +85,23 @@ public:
 };
 
 void run_predator_prey(artis::common::context::Context<artis::common::DoubleTime> &context,
-                       const PreyPredatorGraphManagerParameters &parameters)
-{
+                       const PreyPredatorGraphManagerParameters &parameters) {
   artis::common::RootCoordinator<
-      artis::common::DoubleTime, artis::pdevs::Coordinator<
-          artis::common::DoubleTime,
-          PreyPredatorGraphManager,
-          PreyPredatorGraphManagerParameters>
+    artis::common::DoubleTime, artis::pdevs::Coordinator<
+      artis::common::DoubleTime,
+      PreyPredatorGraphManager,
+      PreyPredatorGraphManagerParameters>
   > rc(context, "root", parameters, artis::common::NoParameters());
 
-  rc.attachView("Value1", new PredatorPreyView());
+//  rc.attachView("Value1", new PredatorPreyView());
 
   rc.run(context);
 
-  artis::observer::Output<artis::common::DoubleTime,
-                          artis::observer::TimedIterator<artis::common::DoubleTime>>
-      output(rc.observer());
-
-  output(context.begin(), context.end(), {context.begin(), 0.1});
+//  artis::common::observer::Output<artis::common::DoubleTime,
+//    artis::common::observer::TimedIterator<artis::common::DoubleTime>>
+//    output(rc.observer());
+//
+//  output(context.begin(), context.end(), {context.begin(), 0.1});
 
   //  rc.save(context);
 //
@@ -142,14 +136,13 @@ void run_predator_prey(artis::common::context::Context<artis::common::DoubleTime
 //  }
 }
 
-void test_predator_prey()
-{
+void test_predator_prey() {
   PreyPredatorGraphManagerParameters parameters = {{{45.},
-                                                    {true, true, 0.1, 3},
-                                                    {0.5, 0.01, 0.01, 0.2}},
+                                                     {true, true, 0.1, 3},
+                                                     {0.5, 0.01, 0.01, 0.2}},
                                                    {{5000.},
-                                                    {true, true, 1, 3},
-                                                    {0.5, 0.01, 0.01, 0.2}}};
+                                                     {true, true, 1,   3},
+                                                     {0.5, 0.01, 0.01, 0.2}}};
 
   artis::common::context::Context<artis::common::DoubleTime> context(0, 100);
 
@@ -161,11 +154,9 @@ void test_predator_prey()
 //  run_predator_prey(new_context, parameters);
 }
 
-class PredatorPreySmartGardenerView : public artis::observer::View<artis::common::DoubleTime>
-{
+class PredatorPreySmartGardenerView : public artis::common::observer::View<artis::common::DoubleTime> {
 public:
-  PredatorPreySmartGardenerView()
-  {
+  PredatorPreySmartGardenerView() {
     selector("PredatorView",
              {PreyPredatorSmartGardenerGraphManager::PREY_PREDATOR,
               PreyPredatorGraphManager::PREDATOR, PredatorGraphManager::submodel::S_Integrator,
@@ -177,40 +168,37 @@ public:
   }
 };
 
-void test_predator_prey_smart_gardener()
-{
+void test_predator_prey_smart_gardener() {
   PreyPredatorSmartGardenerGraphManagerParameters parameters = {{{{45.},
-                                                                  {true, true, 0.1, 3},
-                                                                  {0.5, 0.01, 0.01, 0.2}},
-                                                                 {{5000.},
-                                                                  {true, true, 1, 3},
-                                                                  {0.5, 0.01, 0.01, 0.2}}},
+                                                                   {true, true, 0.1, 3},
+                                                                   {0.5, 0.01, 0.01, 0.2}},
+                                                                       {{5000.},
+                                                                         {true, true, 1, 3},
+                                                                         {0.5, 0.01, 0.01, 0.2}}},
                                                                 {2000, 0.25, 0.75, 5}};
 
   artis::common::context::Context<artis::common::DoubleTime> context(0, 100);
   artis::common::RootCoordinator<
-      artis::common::DoubleTime, artis::pdevs::Coordinator<
-          artis::common::DoubleTime,
-          PreyPredatorSmartGardenerGraphManager,
-          PreyPredatorSmartGardenerGraphManagerParameters>
+    artis::common::DoubleTime, artis::pdevs::Coordinator<
+      artis::common::DoubleTime,
+      PreyPredatorSmartGardenerGraphManager,
+      PreyPredatorSmartGardenerGraphManagerParameters>
   > rc(context, "root", parameters, artis::common::NoParameters());
 
-  rc.attachView("Value2", new PredatorPreySmartGardenerView());
+//  rc.attachView("Value2", new PredatorPreySmartGardenerView());
 
   rc.run(context);
 
-  artis::observer::Output<artis::common::DoubleTime,
-                          artis::observer::TimedIterator<artis::common::DoubleTime>>
-      output(rc.observer());
-
-  output(context.begin(), context.end(), {context.begin(), 0.1});
+//  artis::common::observer::Output<artis::common::DoubleTime,
+//    artis::common::observer::TimedIterator<artis::common::DoubleTime>>
+//    output(rc.observer());
+//
+//  output(context.begin(), context.end(), {context.begin(), 0.1});
 }
 
-class MixedPredatorPreyView : public artis::observer::View<artis::common::DoubleTime>
-{
+class MixedPredatorPreyView : public artis::common::observer::View<artis::common::DoubleTime> {
 public:
-  MixedPredatorPreyView()
-  {
+  MixedPredatorPreyView() {
     selector("PredatorView",
              {MixedPreyPredatorGraphManager::PREDATOR, DiscretePredatorGraphManager::PREDATOR,
               DiscretePredator::VALUE});
@@ -220,36 +208,33 @@ public:
   }
 };
 
-void test_mixed_predator_prey()
-{
+void test_mixed_predator_prey() {
   MixedPreyPredatorGraphManagerParameters parameters = {{0.0001, 45., 0.5, 0.01, 0.01, 0.2},
                                                         {{5000.},
-                                                         {true, true, 1, 3},
-                                                         {0.5, 0.01, 0.01, 0.2}}};
+                                                                 {true, true, 1, 3},
+                                                                      {0.5, 0.01, 0.01, 0.2}}};
   artis::common::context::Context<artis::common::DoubleTime> context(0, 100);
   artis::common::RootCoordinator<
-      artis::common::DoubleTime, artis::pdevs::Coordinator<
-          artis::common::DoubleTime,
-          MixedPreyPredatorGraphManager,
-          MixedPreyPredatorGraphManagerParameters>
+    artis::common::DoubleTime, artis::pdevs::Coordinator<
+      artis::common::DoubleTime,
+      MixedPreyPredatorGraphManager,
+      MixedPreyPredatorGraphManagerParameters>
   > rc(context, "root", parameters, artis::common::NoParameters());
 
-  rc.attachView("Value3", new MixedPredatorPreyView());
+//  rc.attachView("Value3", new MixedPredatorPreyView());
 
   rc.run(context);
 
-  artis::observer::Output<artis::common::DoubleTime,
-                          artis::observer::TimedIterator<artis::common::DoubleTime>>
-      output(rc.observer());
-
-  output(context.begin(), context.end(), {context.begin(), 0.1});
+//  artis::common::observer::Output<artis::common::DoubleTime,
+//    artis::common::observer::TimedIterator<artis::common::DoubleTime>>
+//    output(rc.observer());
+//
+//  output(context.begin(), context.end(), {context.begin(), 0.1});
 }
 
-class MultiPredatorPreyView : public artis::observer::View<artis::common::DoubleTime>
-{
+class MultiPredatorPreyView : public artis::common::observer::View<artis::common::DoubleTime> {
 public:
-  MultiPredatorPreyView()
-  {
+  MultiPredatorPreyView() {
     selector("PredatorView",
              {MultiPreyPredatorGraphManager::submodel::S_Integrator,
               artis::qss::Integrator<artis::common::DoubleTime>::var::VALUE});
@@ -265,37 +250,40 @@ public:
   }
 };
 
-void test_multi_predator_prey()
-{
+void test_multi_predator_prey() {
   artis::qss::MultiQSSParameters<PreyPredatorParameters> parameters = {
-      {{5000.}, {45.}},
-      {{true, true, 1, 3}, {true, true, 0.1, 3}},
-      {0.5, 0.01, 0.01, 0.2}
+    {{5000.},            {45.}},
+    {{true, true, 1, 3}, {true, true, 0.1, 3}},
+    {0.5,                0.01, 0.01, 0.2}
   };
   artis::common::context::Context<artis::common::DoubleTime> context(0, 100);
   artis::common::RootCoordinator<
-      artis::common::DoubleTime, artis::pdevs::Coordinator<
-          artis::common::DoubleTime,
-          MultiPreyPredatorGraphManager,
-          artis::qss::MultiQSSParameters<PreyPredatorParameters>>
+    artis::common::DoubleTime, artis::pdevs::Coordinator<
+      artis::common::DoubleTime,
+      MultiPreyPredatorGraphManager,
+      artis::qss::MultiQSSParameters<PreyPredatorParameters>>
   > rc(context, "root", parameters, artis::common::NoParameters());
 
-  rc.attachView("Value4", new MultiPredatorPreyView());
+//  rc.attachView("Value4", new MultiPredatorPreyView());
 
   rc.run(context);
 
-  artis::observer::Output<artis::common::DoubleTime,
-                          artis::observer::TimedIterator<artis::common::DoubleTime>>
-      output(rc.observer());
-
-  output(context.begin(), context.end(), {context.begin(), 0.1});
+//  artis::common::observer::Output<artis::common::DoubleTime,
+//    artis::common::observer::TimedIterator<artis::common::DoubleTime>>
+//    output(rc.observer());
+//
+//  output(context.begin(), context.end(), {context.begin(), 0.1});
 }
 
-int main()
-{
+int main() {
+  std::cout << "test_parabola START" << std::endl;
   test_parabola();
+  std::cout << "test_predator_prey START" << std::endl;
   test_predator_prey();
+  std::cout << "test_predator_prey_smart_gardener START" << std::endl;
   test_predator_prey_smart_gardener();
+  std::cout << "test_mixed_predator_prey START" << std::endl;
   test_mixed_predator_prey();
+  std::cout << "test_multi_predator_prey START" << std::endl;
   test_multi_predator_prey();
 }

+ 14 - 14
src/tests/qss/models.hpp

@@ -8,7 +8,7 @@
  * ARTIS - the multimodeling and simulation environment
  * This file is a part of the ARTIS environment
  *
- * Copyright (C) 2013-2019 ULCO http://www.univ-littoral.fr
+ * Copyright (C) 2013-2022 ULCO http://www.univ-littoral.fr
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -226,10 +226,10 @@ public:
   void
   dext(const typename common::DoubleTime::type & /* t */,
        const typename common::DoubleTime::type &e,
-       const common::Bag<common::DoubleTime> &bag) override
+       const common::event::Bag<common::DoubleTime> &bag) override
   {
     std::for_each(bag.begin(), bag.end(),
-                  [this](const common::ExternalEvent<common::DoubleTime> &event) {
+                  [this](const common::event::ExternalEvent<common::DoubleTime> &event) {
                     artis::qss::IntegratorData data;
 
                     event.data()(data);
@@ -257,17 +257,17 @@ public:
     return common::DoubleTime::infinity;
   }
 
-  common::Bag<common::DoubleTime>
+  common::event::Bag<common::DoubleTime>
   lambda(const typename common::DoubleTime::type & /* t */) const override
   {
-    common::Bag<common::DoubleTime> bag;
+    common::event::Bag<common::DoubleTime> bag;
 
     if (_phase == PEST) {
       artis::qss::IntegratorData data = {_prey_amount * _prey_proportion};
 
-      bag.push_back(common::ExternalEvent<common::DoubleTime>(OUT_X, data));
+      bag.push_back(common::event::ExternalEvent<common::DoubleTime>(OUT_X, data));
       data = {_predator_amount * _predator_proportion};
-      bag.push_back(common::ExternalEvent<common::DoubleTime>(OUT_Y, data));
+      bag.push_back(common::event::ExternalEvent<common::DoubleTime>(OUT_Y, data));
     }
     return bag;
   }
@@ -341,11 +341,11 @@ public:
 
   ~DiscretePredator() override = default;
 
-  void transition(const artis::common::Bag<artis::common::DoubleTime> &bag,
+  void transition(const artis::common::event::Bag<artis::common::DoubleTime> &bag,
                   const artis::common::DoubleTime::type & /* t */) override
   {
     std::for_each(bag.begin(), bag.end(),
-                  [this](const artis::common::ExternalEvent<artis::common::DoubleTime> &event) {
+                  [this](const artis::common::event::ExternalEvent<artis::common::DoubleTime> &event) {
                     if (event.on_port(IN_X)) {
                       artis::qss::IntegratorData data;
 
@@ -363,24 +363,24 @@ public:
     _y = _init_value;
   }
 
-  artis::common::Bag<artis::common::DoubleTime>
+  artis::common::event::Bag<artis::common::DoubleTime>
   lambda(const artis::common::DoubleTime::type & /* t */) const override
   {
-    artis::common::Bag<artis::common::DoubleTime> msgs;
+    artis::common::event::Bag<artis::common::DoubleTime> msgs;
     artis::qss::IntegratorData data = {_y};
 
     msgs.push_back(
-        artis::common::ExternalEvent<artis::common::DoubleTime>(OUT, data));
+        artis::common::event::ExternalEvent<artis::common::DoubleTime>(OUT, data));
     return msgs;
   }
 
-  artis::common::Value observe(const artis::common::DoubleTime::type & /* t */,
+  artis::common::event::Value observe(const artis::common::DoubleTime::type & /* t */,
                                unsigned int index) const override
   {
     if (index == VALUE) {
       return (double) _y;
     }
-    return artis::common::Value();
+    return artis::common::event::Value();
   }
 
 private: