Browse Source

Add new QSS: multiQSS

Eric Ramat 6 months ago
parent
commit
439234f961
73 changed files with 2272 additions and 1057 deletions
  1. 1 3
      AUTHORS
  2. 2 1
      src/apps/main.cpp
  3. 50 19
      src/artis-star/common/Any.hpp
  4. 10 5
      src/artis-star/common/Bag.hpp
  5. 30 15
      src/artis-star/common/Coordinator.hpp
  6. 34 17
      src/artis-star/common/ExternalEvent.hpp
  7. 26 13
      src/artis-star/common/GraphManager.hpp
  8. 24 12
      src/artis-star/common/InternalEvent.hpp
  9. 20 10
      src/artis-star/common/Links.hpp
  10. 94 47
      src/artis-star/common/Model.hpp
  11. 16 8
      src/artis-star/common/Node.hpp
  12. 4 2
      src/artis-star/common/Parameters.hpp
  13. 22 11
      src/artis-star/common/RootCoordinator.hpp
  14. 10 5
      src/artis-star/common/Scheduler.hpp
  15. 10 5
      src/artis-star/common/Simulator.hpp
  16. 24 12
      src/artis-star/common/States.hpp
  17. 32 16
      src/artis-star/common/Value.hpp
  18. 28 14
      src/artis-star/common/context/Context.hpp
  19. 26 13
      src/artis-star/common/context/State.hpp
  20. 14 7
      src/artis-star/common/context/StateValues.hpp
  21. 18 9
      src/artis-star/common/observer/Iterator.hpp
  22. 22 11
      src/artis-star/common/observer/Observer.hpp
  23. 8 4
      src/artis-star/common/observer/Output.hpp
  24. 26 13
      src/artis-star/common/observer/View.hpp
  25. 22 11
      src/artis-star/common/scheduler/HeapScheduler.hpp
  26. 8 4
      src/artis-star/common/scheduler/SchedulerHandle.hpp
  27. 20 10
      src/artis-star/common/scheduler/VectorScheduler.hpp
  28. 2 1
      src/artis-star/common/time/Limits.hpp
  29. 2 1
      src/artis-star/common/time/RationalTime.hpp
  30. 2 1
      src/artis-star/common/time/Time.hpp
  31. 6 3
      src/artis-star/common/utils/FormalismType.hpp
  32. 6 3
      src/artis-star/common/utils/FunctionType.hpp
  33. 6 3
      src/artis-star/common/utils/LevelType.hpp
  34. 62 31
      src/artis-star/common/utils/Multithreading.hpp
  35. 4 2
      src/artis-star/common/utils/String.hpp
  36. 68 34
      src/artis-star/common/utils/Trace.hpp
  37. 34 17
      src/artis-star/kernel/devs/Coordinator.hpp
  38. 34 17
      src/artis-star/kernel/devs/Dynamics.hpp
  39. 18 9
      src/artis-star/kernel/devs/GraphManager.hpp
  40. 40 20
      src/artis-star/kernel/devs/Simulator.hpp
  41. 34 17
      src/artis-star/kernel/dsde/Coordinator.hpp
  42. 70 35
      src/artis-star/kernel/dsde/Executive.hpp
  43. 20 10
      src/artis-star/kernel/dsde/GraphManager.hpp
  44. 28 14
      src/artis-star/kernel/dtss/Coordinator.hpp
  45. 40 20
      src/artis-star/kernel/dtss/Dynamics.hpp
  46. 26 13
      src/artis-star/kernel/dtss/GraphManager.hpp
  47. 20 10
      src/artis-star/kernel/dtss/Policy.hpp
  48. 38 19
      src/artis-star/kernel/dtss/Simulator.hpp
  49. 8 4
      src/artis-star/kernel/fddevs/Coordinator.hpp
  50. 46 23
      src/artis-star/kernel/fddevs/Dynamics.hpp
  51. 4 2
      src/artis-star/kernel/fddevs/GraphManager.hpp
  52. 38 19
      src/artis-star/kernel/fddevs/Simulator.hpp
  53. 10 5
      src/artis-star/kernel/pdevs/Context.hpp
  54. 34 17
      src/artis-star/kernel/pdevs/Coordinator.hpp
  55. 48 24
      src/artis-star/kernel/pdevs/Dynamics.hpp
  56. 32 16
      src/artis-star/kernel/pdevs/GraphManager.hpp
  57. 30 15
      src/artis-star/kernel/pdevs/Simulator.hpp
  58. 10 5
      src/artis-star/kernel/pdevs/mpi/Coordinator.hpp
  59. 10 5
      src/artis-star/kernel/pdevs/mpi/GraphManager.hpp
  60. 10 5
      src/artis-star/kernel/pdevs/mpi/LogicalProcessor.hpp
  61. 30 15
      src/artis-star/kernel/pdevs/mpi/ModelProxy.hpp
  62. 36 18
      src/artis-star/kernel/pdevs/multithreading/Coordinator.hpp
  63. 1 1
      src/artis-star/kernel/qss/CMakeLists.txt
  64. 6 3
      src/artis-star/kernel/qss/Data.hpp
  65. 107 72
      src/artis-star/kernel/qss/Derivative.hpp
  66. 117 85
      src/artis-star/kernel/qss/Integrator.hpp
  67. 275 0
      src/artis-star/kernel/qss/MultiDerivative.hpp
  68. 131 82
      src/artis-star/kernel/qss/Quantifier.hpp
  69. 32 16
      src/artis-star/kernel/sss/Coordinator.hpp
  70. 22 11
      src/artis-star/kernel/sss/Dynamics.hpp
  71. 12 6
      src/artis-star/kernel/sss/GraphManager.hpp
  72. 34 17
      src/artis-star/kernel/sss/Model.hpp
  73. 28 14
      src/artis-star/kernel/sss/Simulator.hpp

+ 1 - 3
AUTHORS

@@ -26,6 +26,4 @@ Main programmer and founder
 
 
 Contributors
-------------
-
-- Christopher Herbez <christopher.herbez@gmail.com>
+------------

+ 2 - 1
src/apps/main.cpp

@@ -24,6 +24,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-int main() {
+int main()
+{
   return 0;
 }

+ 50 - 19
src/artis-star/common/Any.hpp

@@ -37,20 +37,26 @@
 namespace artis {
 namespace common {
 
-class Any {
+class Any
+{
 private:
-  struct base {
-    virtual ~base() {}
+  struct base
+  {
+    virtual ~base()
+    {}
 
     virtual base *clone() const = 0;
   };
 
   template<typename T, typename V>
-  struct data : base {
+  struct data : base
+  {
     data(V T::* const &value)
-        : value_(value) {}
+        : value_(value)
+    {}
 
-    base *clone() const { return new data<T, V>(*this); }
+    base *clone() const
+    { return new data<T, V>(*this); }
 
     V T::* value_;
   };
@@ -59,37 +65,60 @@ private:
 
 public:
   Any()
-      : ptr_(nullptr) {}
+      : ptr_(nullptr)
+  {}
 
   template<typename T, typename V>
   Any(V T::* const &value)
-      : ptr_(new data<T, V>(value)) {}
+      : ptr_(new data<T, V>(value))
+  {}
 
   Any(Any const &other)
-      : ptr_(other.ptr_ ? other.ptr_->clone() : nullptr) {}
+      : ptr_(other.ptr_ ? other.ptr_->clone() : nullptr)
+  {}
 
-  virtual ~Any() {
-    if (ptr_)
+  virtual ~Any()
+  {
+    if (ptr_) {
       delete ptr_;
+    }
   }
 
-  void operator=(Any const &other) { Any(other).swap(*this); }
+  void operator=(Any const &other)
+  { Any(other).swap(*this); }
 
-  void swap(Any &other) { std::swap(ptr_, other.ptr_); }
+  void swap(Any &other)
+  { std::swap(ptr_, other.ptr_); }
 
   template<typename T, typename V>
-  V T::* get() const { return dynamic_cast < data<T, V> * >(ptr_)->value_; }
+  V T::* get() const
+  { return dynamic_cast < data<T, V> * >(ptr_)->value_; }
+
+  template<typename T, typename V>
+  void get(T *o, V &value) const
+  {
+    data<T, V> *q = dynamic_cast < data<T, V> * >(ptr_);
+
+    if (q) {
+      value = o->*(q->value_);
+    } else {
+      assert(false);
+    }
+  }
 
-  bool is_null() const { return ptr_ == nullptr; }
+  bool is_null() const
+  { return ptr_ == nullptr; }
 
   template<typename T, typename V>
-  void put(T *o, const V &value) {
+  void put(T *o, const V &value)
+  {
     V T::* p = dynamic_cast <data<T, V> * >(ptr_)->value_;
     o->*(p) = value;
   }
 
   template<typename T>
-  void restore(T *o, const common::Value &value) {
+  void restore(T *o, const common::Value &value)
+  {
     if (value.is_type<double>()) {
       double v;
 
@@ -136,7 +165,8 @@ public:
   }
 
   template<typename T>
-  common::Value save(const T *o) const {
+  common::Value save(const T *o) const
+  {
     if (ptr_) {
       data<T, double> *q_double =
           dynamic_cast < data<T, double> * >(ptr_);
@@ -196,7 +226,8 @@ public:
   }
 
   template<typename T>
-  std::string to_string(const T *o) const {
+  std::string to_string(const T *o) const
+  {
     if (ptr_) {
       data<T, double> *q_double =
           dynamic_cast < data<T, double> * >(ptr_);

+ 10 - 5
src/artis-star/common/Bag.hpp

@@ -42,15 +42,18 @@ template<class Time>
 class ExternalEvent;
 
 template<class Time>
-class Bag : public std::vector<ExternalEvent<Time> > {
+class Bag : public std::vector<ExternalEvent<Time> >
+{
 public:
   Bag() = default;
 
-  Bag(const ExternalEvent<Time> &event) { this->push_back(event); }
+  Bag(const ExternalEvent<Time> &event)
+  { this->push_back(event); }
 
   virtual ~Bag() = default;
 
-  std::string to_string() const {
+  std::string to_string() const
+  {
     std::ostringstream ss;
 
     ss << "{ ";
@@ -67,7 +70,8 @@ private:
   friend class boost::serialization::access;
 
   template<class Archive>
-  void save(Archive &ar, const unsigned int version) const {
+  void save(Archive &ar, const unsigned int version) const
+  {
     (void) version;
 
     ar & *dynamic_cast < const std::vector<ExternalEvent<Time> > * >(
@@ -75,7 +79,8 @@ private:
   }
 
   template<class Archive>
-  void load(Archive &ar, const unsigned int version) {
+  void load(Archive &ar, const unsigned int version)
+  {
     (void) version;
 
     ar & *dynamic_cast < std::vector<ExternalEvent<Time> > * >(this);

+ 30 - 15
src/artis-star/common/Coordinator.hpp

@@ -45,18 +45,22 @@ template<class Time>
 class GraphManager;
 
 template<class Time>
-class Coordinator : public virtual Model<Time> {
+class Coordinator : public virtual Model<Time>
+{
 public :
   Coordinator(const std::string &name)
-      : Model<Time>(name) {}
+      : Model<Time>(name)
+  {}
 
-  virtual ~Coordinator() {}
+  virtual ~Coordinator()
+  {}
 
   virtual GraphManager<Time> &get_graph_manager() = 0;
 
   virtual const GraphManager<Time> &get_graph_manager() const = 0;
 
-  virtual const Model<Time> *get_submodel(unsigned int index) const {
+  virtual const Model<Time> *get_submodel(unsigned int index) const
+  {
     const GraphManager<Time> &graph_manager = get_graph_manager();
     typename common::ModelMap<Time>::const_iterator it = graph_manager.child_map().find(
         index);
@@ -68,7 +72,8 @@ public :
     }
   }
 
-  virtual const Model<Time> *get_submodel(unsigned int index, unsigned int rank) const {
+  virtual const Model<Time> *get_submodel(unsigned int index, unsigned int rank) const
+  {
     const GraphManager<Time> &graph_manager = get_graph_manager();
     typename common::ModelsMap<Time>::const_iterator it = graph_manager.children_map().find(
         index);
@@ -80,7 +85,8 @@ public :
     }
   }
 
-  virtual unsigned int get_submodel_number(unsigned int index) const {
+  virtual unsigned int get_submodel_number(unsigned int index) const
+  {
     const GraphManager<Time> &graph_manager = get_graph_manager();
     typename common::ModelsMap<Time>::const_iterator it = graph_manager.children_map().find(
         index);
@@ -92,9 +98,11 @@ public :
     }
   }
 
-  void input_port(common::Port p) { Coordinator<Time>::add_in_port(p); }
+  void input_port(common::Port p)
+  { Coordinator<Time>::add_in_port(p); }
 
-  void input_ports(std::initializer_list<common::Port> list) {
+  void input_ports(std::initializer_list<common::Port> list)
+  {
     for (typename std::initializer_list<common::Port>::iterator it = list.begin();
          it != list.end();
          ++it) {
@@ -102,11 +110,14 @@ public :
     }
   }
 
-  virtual bool is_atomic() const { return false; }
+  virtual bool is_atomic() const
+  { return false; }
 
-  void output_port(common::Port p) { Coordinator<Time>::add_out_port(p); }
+  void output_port(common::Port p)
+  { Coordinator<Time>::add_out_port(p); }
 
-  void output_ports(std::initializer_list<common::Port> list) {
+  void output_ports(std::initializer_list<common::Port> list)
+  {
     for (typename std::initializer_list<common::Port>::iterator it = list.begin();
          it != list.end();
          ++it) {
@@ -114,21 +125,25 @@ public :
     }
   }
 
-  virtual void remove_model(const typename Time::type &t, common::Model<Time> *model) {
+  virtual void remove_model(const typename Time::type &t, common::Model<Time> *model)
+  {
     model->finish(t);
   }
 
-  void restore(const common::context::State<Time> &state) {
+  void restore(const common::context::State<Time> &state)
+  {
     Model<Time>::restore(state);
     get_graph_manager().restore(state);
   }
 
-  void save(common::context::State<Time> &state) const {
+  void save(common::context::State<Time> &state) const
+  {
     Model<Time>::save(state);
     get_graph_manager().save(state);
   }
 
-  virtual std::string to_string(int /* level */) const {
+  virtual std::string to_string(int /* level */) const
+  {
     std::ostringstream ss;
 
     ss << "Coordinator " << Coordinator<Time>::get_name();

+ 34 - 17
src/artis-star/common/ExternalEvent.hpp

@@ -48,68 +48,84 @@ template<class Time>
 class Model;
 
 template<class Time>
-class ExternalEvent {
+class ExternalEvent
+{
 public:
   ExternalEvent(const Value &data)
       :
-      _port_index(-1), _model(nullptr), _data(data) {}
+      _port_index(-1), _model(nullptr), _data(data)
+  {}
 
   ExternalEvent(int port_index)
       :
-      _port_index(port_index), _model(nullptr), _data(Value()) {}
+      _port_index(port_index), _model(nullptr), _data(Value())
+  {}
 
   ExternalEvent(int port_index, const Value &data)
       :
-      _port_index(port_index), _model(nullptr), _data(data) {}
+      _port_index(port_index), _model(nullptr), _data(data)
+  {}
 
   ExternalEvent(const Node<Time> &node, const Value &data)
       :
       _port_index(node.get_port_index()),
       _model(node.get_model()),
-      _data(data) {}
+      _data(data)
+  {}
 
   ExternalEvent(const ExternalEvent &event)
       :
       _port_index(event._port_index), _model(event._model),
-      _data(event._data) {}
+      _data(event._data)
+  {}
 
   ExternalEvent()
-      : _port_index(-2), _model(nullptr) {}
+      : _port_index(-2), _model(nullptr)
+  {}
 
   virtual ~ExternalEvent() = default;
 
-  const Value &data() const { return _data; }
+  const Value &data() const
+  { return _data; }
 
-  void data(const Value &data) { _data = data; }
+  void data(const Value &data)
+  { _data = data; }
 
-  Model<Time> *get_model() const { return _model; }
+  Model<Time> *get_model() const
+  { return _model; }
 
-  bool is_void() const { return _port_index == -2; }
+  bool is_void() const
+  { return _port_index == -2; }
 
-  bool on_port(int port_index) const {
+  bool on_port(int port_index) const
+  {
 
     assert(_port_index != -1);
 
     return _port_index == port_index;
   }
 
-  ExternalEvent &operator=(const ExternalEvent &e) {
+  ExternalEvent &operator=(const ExternalEvent &e)
+  {
     _port_index = e._port_index;
     _model = e._model;
     _data = e._data;
     return *this;
   }
 
-  int port_index() const {
+  int port_index() const
+  {
 
     assert(_port_index != -1);
 
     return _port_index;
   }
 
-  void set_model(Model<Time> *model) { _model = model; }
+  void set_model(Model<Time> *model)
+  { _model = model; }
 
-  std::string to_string() const {
+  std::string to_string() const
+  {
     std::ostringstream ss;
 
     ss << "( ";
@@ -133,7 +149,8 @@ private:
   friend class boost::serialization::access;
 
   template<class Archive>
-  void serialize(Archive &ar, const unsigned int version) {
+  void serialize(Archive &ar, const unsigned int version)
+  {
     (void) version;
 
     ar & _port_index;

+ 26 - 13
src/artis-star/common/GraphManager.hpp

@@ -39,21 +39,26 @@ namespace artis {
 namespace common {
 
 template<class Time>
-class GraphManager {
+class GraphManager
+{
 public:
   GraphManager(common::Coordinator<Time> *coordinator)
       :
-      _coordinator(coordinator) {}
+      _coordinator(coordinator)
+  {}
 
-  virtual ~GraphManager() {}
+  virtual ~GraphManager()
+  {}
 
-  virtual void add_child(unsigned int index, common::Model<Time> *child) {
+  virtual void add_child(unsigned int index, common::Model<Time> *child)
+  {
     _children.push_back(child);
     _child_map[index] = child;
     child->set_parent(_coordinator);
   }
 
-  virtual void add_children(unsigned int index, common::Model<Time> *child) {
+  virtual void add_children(unsigned int index, common::Model<Time> *child)
+  {
     _children.push_back(child);
     if (_children_map.find(index) == _children_map.end()) {
       _children_map[index] = Models<Time>();
@@ -62,17 +67,23 @@ public:
     child->set_parent(_coordinator);
   }
 
-  const common::Models<Time> &children() const { return _children; }
+  const common::Models<Time> &children() const
+  { return _children; }
 
-  const common::ModelMap<Time> &child_map() const { return _child_map; }
+  const common::ModelMap<Time> &child_map() const
+  { return _child_map; }
 
-  common::Model<Time> *child_map(size_t index) const { return _child_map.at(index); }
+  common::Model<Time> *child_map(size_t index) const
+  { return _child_map.at(index); }
 
-  const common::ModelsMap<Time> &children_map() const { return _children_map; }
+  const common::ModelsMap<Time> &children_map() const
+  { return _children_map; }
 
-  common::Coordinator<Time> *coordinator() const { return _coordinator; }
+  common::Coordinator<Time> *coordinator() const
+  { return _coordinator; }
 
-  virtual void remove_child(unsigned int index) {
+  virtual void remove_child(unsigned int index)
+  {
     common::Model<Time> *child = _child_map[index];
 
     _children.erase(std::find(_children.begin(), _children.end(), child));
@@ -80,14 +91,16 @@ public:
     _child_map.erase(index);
   }
 
-  void restore(const common::context::State<Time> &state) {
+  void restore(const common::context::State<Time> &state)
+  {
     for (typename common::ModelMap<Time>::iterator it = _child_map.begin(); it != _child_map.end();
          ++it) {
       it->second->restore(state.get_substate(it->first));
     }
   }
 
-  void save(common::context::State<Time> &state) const {
+  void save(common::context::State<Time> &state) const
+  {
     for (typename common::ModelMap<Time>::const_iterator it = _child_map.begin();
          it != _child_map.end(); ++it) {
       context::State<Time> substate;

+ 24 - 12
src/artis-star/common/InternalEvent.hpp

@@ -38,34 +38,44 @@ template<class Time>
 class Model;
 
 template<class Time>
-class InternalEvent {
+class InternalEvent
+{
 public:
   InternalEvent(const typename Time::type &time, Model<Time> *model)
-      : _time(time), _model(model) {}
+      : _time(time), _model(model)
+  {}
 
-  virtual ~InternalEvent() {}
+  virtual ~InternalEvent()
+  {}
 
-  Model<Time> *get_model() const { return _model; }
+  Model<Time> *get_model() const
+  { return _model; }
 
-  typename Time::type get_time() const { return _time; }
+  typename Time::type get_time() const
+  { return _time; }
 
-  bool operator<(InternalEvent const &e) const {
+  bool operator<(InternalEvent const &e) const
+  {
     return _time < e._time;
   }
 
-  bool operator>(InternalEvent const &e) const {
+  bool operator>(InternalEvent const &e) const
+  {
     return _time > e._time;
   }
 
-  bool operator>=(InternalEvent const &e) const {
+  bool operator>=(InternalEvent const &e) const
+  {
     return _time >= e._time;
   }
 
-  bool operator==(InternalEvent const &e) const {
+  bool operator==(InternalEvent const &e) const
+  {
     return _time == e._time;
   }
 
-  void set_time(typename Time::type time) { _time = time; }
+  void set_time(typename Time::type time)
+  { _time = time; }
 
 private:
   typename Time::type _time;
@@ -74,8 +84,10 @@ private:
 
 template<typename Event>
 struct EventCompare
-    : std::binary_function<Event, Event, bool> {
-  bool operator()(const Event &left, const Event &right) const { return left >= right; }
+    : std::binary_function<Event, Event, bool>
+{
+  bool operator()(const Event &left, const Event &right) const
+  { return left >= right; }
 };
 
 }

+ 20 - 10
src/artis-star/common/Links.hpp

@@ -40,7 +40,8 @@ template<class Time>
 class Node;
 
 template<class Time>
-class Links : public std::multimap<Node<Time>, Node<Time> > {
+class Links : public std::multimap<Node<Time>, Node<Time> >
+{
   typedef std::multimap<Node<Time>, Node<Time> > type;
 
 public:
@@ -49,12 +50,15 @@ public:
       typename Links<Time>::const_iterator
   > Result;
 
-  Links() {}
+  Links()
+  {}
 
-  virtual ~Links() {}
+  virtual ~Links()
+  {}
 
   void add(Model<Time> *out_model, unsigned int out_port_index,
-           Model<Time> *in_model, unsigned int in_port_index) {
+           Model<Time> *in_model, unsigned int in_port_index)
+  {
     type::insert(std::pair<Node<Time>, Node<Time> >(
         Node<Time>(out_model, out_port_index),
         Node<Time>(in_model, in_port_index)));
@@ -63,7 +67,8 @@ public:
   bool exist(Model<Time> *out_model,
              unsigned int out_port_index,
              Model<Time> *in_model,
-             unsigned int in_port_index) const {
+             unsigned int in_port_index) const
+  {
     std::pair<typename Links<Time>::const_iterator,
               typename Links<Time>::const_iterator> it =
         type::equal_range(Node<Time>(out_model, out_port_index));
@@ -80,7 +85,8 @@ public:
 
   typename Links<Time>::const_iterator
   find(Model<Time> *out_model, unsigned int out_port_index,
-       Model<Time> *in_model, unsigned int in_port_index) const {
+       Model<Time> *in_model, unsigned int in_port_index) const
+  {
     std::pair<typename Links<Time>::const_iterator,
               typename Links<Time>::const_iterator> it =
         type::equal_range(Node<Time>(out_model, out_port_index));
@@ -97,19 +103,22 @@ public:
     return it2;
   }
 
-  Links::Result find(Model<Time> *out_model, unsigned int out_port_index) const {
+  Links::Result find(Model<Time> *out_model, unsigned int out_port_index) const
+  {
     return type::equal_range(common::Node<Time>(out_model, out_port_index));
   }
 
   void remove(common::Model<Time> *src_model, unsigned int src_port_index,
-              common::Model<Time> *dst_model, unsigned int dst_port_index) {
+              common::Model<Time> *dst_model, unsigned int dst_port_index)
+  {
     typename Links<Time>::const_iterator result = find(src_model, src_port_index,
                                                        dst_model, dst_port_index);
 
     this->erase(result);
   }
 
-  void remove_links(common::Model<Time> *model) {
+  void remove_links(common::Model<Time> *model)
+  {
     typename Links<Time>::iterator it = this->begin();
 
     while (it != this->end()) {
@@ -122,7 +131,8 @@ public:
     }
   }
 
-  std::string to_string(int level = 0) const {
+  std::string to_string(int level = 0) const
+  {
     std::stringstream ss;
 
     ss << common::String::make_spaces(level * 2) << "Links:" << std::endl;

+ 94 - 47
src/artis-star/common/Model.hpp

@@ -51,7 +51,8 @@ class InternalEvent;
 template<class Time>
 class Bag;
 
-struct Port {
+struct Port
+{
   unsigned int index;
   std::string name;
 };
@@ -60,34 +61,40 @@ typedef std::vector<unsigned int> Ports;
 typedef std::map<unsigned int, std::string> PortMap;
 
 template<class Time>
-class Model {
+class Model
+{
 public:
   Model(const std::string &name)
       :
-      _tl(0), _tn(0), _parent(0), _name(name), _inputs(0) {}
+      _tl(0), _tn(0), _parent(0), _name(name), _inputs(0)
+  {}
 
-  virtual ~Model() {
+  virtual ~Model()
+  {
     if (_inputs) {
       delete _inputs;
     }
   }
 
   // structure
-  void add_in_port(const Port &port) {
+  void add_in_port(const Port &port)
+  {
     assert(not exist_in_port(port.index));
 
     _in_ports.push_back(port.index);
     _in_port_map[port.index] = port.name;
   }
 
-  void add_out_port(const Port &port) {
+  void add_out_port(const Port &port)
+  {
     assert(not exist_out_port(port.index));
 
     _out_ports.push_back(port.index);
     _out_port_map[port.index] = port.name;
   }
 
-  void delete_in_port(const Port &port) {
+  void delete_in_port(const Port &port)
+  {
     assert(not exist_in_port(port.index));
 
     _in_ports.erase(std::find(_in_ports.begin(), _in_ports.end(),
@@ -95,7 +102,8 @@ public:
     _in_port_map.erase(port.index);
   }
 
-  void delete_out_port(const Port &port) {
+  void delete_out_port(const Port &port)
+  {
     assert(not exist_out_port(port.index));
 
     _out_ports.erase(std::find(_out_ports.begin(), _out_ports.end(),
@@ -103,42 +111,52 @@ public:
     _out_port_map.erase(port.index);
   }
 
-  bool exist_in_port(unsigned int port_index) const {
+  bool exist_in_port(unsigned int port_index) const
+  {
     return _in_port_map.find(port_index) != _in_port_map.end();
   }
 
-  bool exist_out_port(unsigned int port_index) const {
+  bool exist_out_port(unsigned int port_index) const
+  {
     return _out_port_map.find(port_index) != _out_port_map.end();
   }
 
-  std::string get_in_port_name(unsigned int port_index) const {
+  std::string get_in_port_name(unsigned int port_index) const
+  {
     assert(exist_in_port(port_index));
 
     return _in_port_map.find(port_index)->second;
   }
 
-  size_t get_in_port_number() const { return _in_port_map.size(); }
+  size_t get_in_port_number() const
+  { return _in_port_map.size(); }
 
-  std::string get_out_port_name(unsigned int port_index) const {
+  std::string get_out_port_name(unsigned int port_index) const
+  {
     assert(exist_out_port(port_index));
 
     return _out_port_map.find(port_index)->second;
   }
 
-  size_t get_out_port_number() const { return _out_port_map.size(); }
+  size_t get_out_port_number() const
+  { return _out_port_map.size(); }
 
-  const std::string &get_name() const { return _name; }
+  const std::string &get_name() const
+  { return _name; }
 
-  Model<Time> *get_parent() const { return _parent; }
+  Model<Time> *get_parent() const
+  { return _parent; }
 
   // TODO: to remove
-  virtual int get_receiver_number(typename Time::type t) {
+  virtual int get_receiver_number(typename Time::type t)
+  {
     (void) t;
 
     return 0;
   }
 
-  virtual const Model<Time> *get_submodel(unsigned int index) const {
+  virtual const Model<Time> *get_submodel(unsigned int index) const
+  {
     (void) index;
 
     assert(false);
@@ -147,7 +165,8 @@ public:
   }
 
   virtual const Model<Time> *get_submodel(unsigned int index,
-                                          unsigned int rank) const {
+                                          unsigned int rank) const
+  {
     (void) index;
     (void) rank;
 
@@ -156,7 +175,8 @@ public:
     return nullptr;
   }
 
-  virtual unsigned int get_submodel_number(unsigned int index) const {
+  virtual unsigned int get_submodel_number(unsigned int index) const
+  {
     (void) index;
 
     assert(false);
@@ -166,9 +186,11 @@ public:
 
   virtual bool is_atomic() const = 0;
 
-  virtual bool is_remote() const { return false; }
+  virtual bool is_remote() const
+  { return false; }
 
-  virtual std::string observable_name(unsigned int observable_index) const {
+  virtual std::string observable_name(unsigned int observable_index) const
+  {
     (void) observable_index;
 
     assert(false);
@@ -176,44 +198,52 @@ public:
     return std::string();
   }
 
-  std::string path() const {
+  std::string path() const
+  {
     return (_parent != nullptr ? _parent->path() : "") + ":" + get_name();
   }
 
-  virtual void restore(const common::context::State<Time> &state) {
+  virtual void restore(const common::context::State<Time> &state)
+  {
     _tl = state.last_time();
     _tn = state.next_time();
   }
 
-  virtual void save(common::context::State<Time> &state) const {
+  virtual void save(common::context::State<Time> &state) const
+  {
     state.last_time(_tl);
     state.next_time(_tn);
   }
 
-  void set_parent(Model<Time> *parent) { _parent = parent; }
+  void set_parent(Model<Time> *parent)
+  { _parent = parent; }
 
   virtual std::string to_string(int /* level */) const = 0;
 
   // event
-  void add_event(const common::ExternalEvent<Time> &message) {
+  void add_event(const common::ExternalEvent<Time> &message)
+  {
     if (_inputs == 0) {
       _inputs = new Bag<Time>;
     }
     _inputs->push_back(message);
   }
 
-  void clear_bag() {
+  void clear_bag()
+  {
     if (_inputs) {
       delete _inputs;
       _inputs = 0;
     }
   }
 
-  unsigned int event_number() const {
+  unsigned int event_number() const
+  {
     return _inputs ? _inputs->size() : 0;
   }
 
-  const common::Bag<Time> &get_bag() {
+  const common::Bag<Time> &get_bag()
+  {
     if (_inputs == 0) {
       _inputs = new Bag<Time>;
     }
@@ -221,9 +251,11 @@ public:
   }
 
   // time
-  typename Time::type get_tl() const { return _tl; }
+  typename Time::type get_tl() const
+  { return _tl; }
 
-  typename Time::type get_tn() const { return _tn; }
+  typename Time::type get_tn() const
+  { return _tn; }
 
   // devs methods
   virtual void finish(const typename Time::type &t) = 0;
@@ -240,12 +272,15 @@ public:
 
   virtual typename Time::type transition(const typename Time::type &t) = 0;
 
-  virtual typename Time::type lookahead(const typename Time::type &t) const { return t; }
+  virtual typename Time::type lookahead(const typename Time::type &t) const
+  { return t; }
 
   // scheduler
-  void handle(SchedulerHandle handle) { _handle.handle(handle); }
+  void handle(SchedulerHandle handle)
+  { _handle.handle(handle); }
 
-  const SchedulerHandle &handle() const { return _handle.handle(); }
+  const SchedulerHandle &handle() const
+  { return _handle.handle(); }
 
 protected:
   typename Time::type _tl;
@@ -264,13 +299,17 @@ private :
 };
 
 template<class Time>
-class ModelMap : public std::map<unsigned int, Model<Time> *> {
+class ModelMap : public std::map<unsigned int, Model<Time> *>
+{
 public:
-  ModelMap() {}
+  ModelMap()
+  {}
 
-  virtual ~ModelMap() {}
+  virtual ~ModelMap()
+  {}
 
-  std::string to_string() const {
+  std::string to_string() const
+  {
     std::ostringstream ss;
 
     ss << "{ ";
@@ -285,13 +324,17 @@ public:
 };
 
 template<class Time>
-class Models : public std::vector<Model<Time> *> {
+class Models : public std::vector<Model<Time> *>
+{
 public:
-  Models() {}
+  Models()
+  {}
 
-  virtual ~Models() {}
+  virtual ~Models()
+  {}
 
-  std::string to_string() const {
+  std::string to_string() const
+  {
     std::ostringstream ss;
 
     ss << "{ ";
@@ -306,13 +349,17 @@ public:
 };
 
 template<class Time>
-class ModelsMap : public std::map<unsigned int, Models<Time> > {
+class ModelsMap : public std::map<unsigned int, Models<Time> >
+{
 public:
-  ModelsMap() {}
+  ModelsMap()
+  {}
 
-  virtual ~ModelsMap() {}
+  virtual ~ModelsMap()
+  {}
 
-  std::string to_string() const {
+  std::string to_string() const
+  {
     std::ostringstream ss;
 
     ss << "{ ";

+ 16 - 8
src/artis-star/common/Node.hpp

@@ -38,30 +38,38 @@ template<class Time>
 class Model;
 
 template<class Time>
-class Node {
+class Node
+{
 public :
   Node(Model<Time> *model, unsigned int port_index)
-      : _model(model), _port_index(port_index) {
+      : _model(model), _port_index(port_index)
+  {
     _id = std::hash<std::string>()(model->get_name() +
         std::to_string(port_index));
   }
 
   Node(const Node<Time> &other)
-      : _model(other._model), _port_index(other._port_index), _id(other._id) {}
+      : _model(other._model), _port_index(other._port_index), _id(other._id)
+  {}
 
-  virtual ~Node() {}
+  virtual ~Node()
+  {}
 
-  bool operator<(const Node<Time> &o) const {
+  bool operator<(const Node<Time> &o) const
+  {
     return _id < o._id;
   }
 
-  bool operator==(const Node<Time> &o) const {
+  bool operator==(const Node<Time> &o) const
+  {
     return _id == o._id;
   }
 
-  unsigned int get_port_index() const { return _port_index; }
+  unsigned int get_port_index() const
+  { return _port_index; }
 
-  Model<Time> *get_model() const { return _model; }
+  Model<Time> *get_model() const
+  { return _model; }
 
 private :
   Model<Time> *_model;

+ 4 - 2
src/artis-star/common/Parameters.hpp

@@ -30,9 +30,11 @@
 namespace artis {
 namespace common {
 
-class NoParameters {
+class NoParameters
+{
 public:
-  NoParameters() {}
+  NoParameters()
+  {}
 };
 
 }

+ 22 - 11
src/artis-star/common/RootCoordinator.hpp

@@ -39,7 +39,8 @@ namespace artis {
 namespace common {
 
 template<class Time, class Coordinator>
-class RootCoordinator {
+class RootCoordinator
+{
 public :
   RootCoordinator(const common::context::Context<Time> &context,
                   const std::string &root_name,
@@ -47,30 +48,37 @@ public :
                   const typename Coordinator::graph_parameters_type &graph_parameters)
       :
       _root(root_name, parameters, graph_parameters), _observer(&_root),
-      _t_max(context.end()), _tn(context.begin()) {}
+      _t_max(context.end()), _tn(context.begin())
+  {}
 
   RootCoordinator(const common::context::Context<Time> &context,
                   const std::string &root_name,
                   const typename Coordinator::parameters_type &parameters)
       :
       _root(root_name, parameters, NoParameters()), _observer(&_root),
-      _t_max(context.end()), _tn(context.begin()) {}
+      _t_max(context.end()), _tn(context.begin())
+  {}
 
   RootCoordinator(const common::context::Context<Time> &context,
                   const std::string &root_name)
       :
       _root(root_name, NoParameters(), NoParameters()), _observer(&_root),
-      _t_max(context.end()), _tn(context.begin()) {}
+      _t_max(context.end()), _tn(context.begin())
+  {}
 
-  virtual ~RootCoordinator() {}
+  virtual ~RootCoordinator()
+  {}
 
-  void attachView(const std::string &name, observer::View<Time> *view) {
+  void attachView(const std::string &name, observer::View<Time> *view)
+  {
     _observer.attachView(name, view);
   }
 
-  const observer::Observer<Time> &observer() const { return _observer; }
+  const observer::Observer<Time> &observer() const
+  { return _observer; }
 
-  void run(const common::context::Context<Time> &context) {
+  void run(const common::context::Context<Time> &context)
+  {
 //             DSDE synchroniser
 //               When receive (START,t)
 //                  send (START,0) to child
@@ -99,14 +107,17 @@ public :
     }
   }
 
-  void save(common::context::Context<Time> &context) const {
+  void save(common::context::Context<Time> &context) const
+  {
     _root.save(context.state());
     context.saved();
   }
 
-  void switch_to_timed_observer(double step) { _observer.switch_to_timed_observer(step); }
+  void switch_to_timed_observer(double step)
+  { _observer.switch_to_timed_observer(step); }
 
-  std::string to_string() const {
+  std::string to_string() const
+  {
     std::ostringstream ss;
 
     ss << _root.to_string(0);

+ 10 - 5
src/artis-star/common/Scheduler.hpp

@@ -38,15 +38,20 @@ struct SchedulerHandle;
 typedef typename artis::common::scheduler::HeapScheduler<
     common::DoubleTime, SchedulerHandle>::type SchedulerType;
 
-struct SchedulerHandle {
-  SchedulerHandle() {}
+struct SchedulerHandle
+{
+  SchedulerHandle()
+  {}
 
   SchedulerHandle(const SchedulerType::handle_type &handle)
-      : _handle(handle) {}
+      : _handle(handle)
+  {}
 
-  const SchedulerHandle &handle() const { return *this; }
+  const SchedulerHandle &handle() const
+  { return *this; }
 
-  void handle(const SchedulerHandle &handle) { _handle = handle._handle; }
+  void handle(const SchedulerHandle &handle)
+  { _handle = handle._handle; }
 
   SchedulerType::handle_type _handle;
 };

+ 10 - 5
src/artis-star/common/Simulator.hpp

@@ -35,16 +35,21 @@ namespace artis {
 namespace common {
 
 template<class Time>
-class Simulator : public virtual Model<Time> {
+class Simulator : public virtual Model<Time>
+{
 public :
   Simulator(const std::string &name)
-      : Model<Time>(name) {}
+      : Model<Time>(name)
+  {}
 
-  virtual ~Simulator() {}
+  virtual ~Simulator()
+  {}
 
-  virtual bool is_atomic() const { return true; }
+  virtual bool is_atomic() const
+  { return true; }
 
-  virtual std::string to_string(int /* level */) const {
+  virtual std::string to_string(int /* level */) const
+  {
     std::ostringstream ss;
 
     ss << "Simulator " << Simulator<Time>::get_name();

+ 24 - 12
src/artis-star/common/States.hpp

@@ -37,31 +37,40 @@ namespace artis {
 namespace common {
 
 template<typename Time, typename Dyn>
-class States {
+class States
+{
 public:
   template<class W>
-  struct element {
+  struct element
+  {
     unsigned int index;
     const std::string name;
     W Dyn::* var;
 
     element(unsigned int index, const std::string &name, W Dyn::* var)
         :
-        index(index), name(name), var(var) {}
+        index(index), name(name), var(var)
+    {}
   };
 
-  States() {}
+  States()
+  {}
 
-  virtual ~States() {}
+  virtual ~States()
+  {}
 
-  common::Any &get(unsigned int index) { return states.at(index); }
+  common::Any &get(unsigned int index)
+  { return states.at(index); }
 
-  const common::Any &get(unsigned int index) const { return states.at(index); }
+  const common::Any &get(unsigned int index) const
+  { return states.at(index); }
 
-  unsigned int state_number() const { return states.size(); }
+  unsigned int state_number() const
+  { return states.size(); }
 
   template<class W>
-  void S_(std::initializer_list<element<W> > list) {
+  void S_(std::initializer_list<element<W> > list)
+  {
     for (typename std::initializer_list<element<W> >::iterator it =
         list.begin(); it != list.end(); ++it) {
       if (states.size() <= it->index) {
@@ -73,7 +82,8 @@ public:
     }
   }
 
-  virtual void restore(Dyn *model, const common::context::State<Time> &state) {
+  virtual void restore(Dyn *model, const common::context::State<Time> &state)
+  {
     unsigned int index = 0;
 
     for (typename std::vector<common::Any>::iterator it = states.begin();
@@ -85,7 +95,8 @@ public:
     }
   }
 
-  virtual void save(const Dyn *model, common::context::State<Time> &state) const {
+  virtual void save(const Dyn *model, common::context::State<Time> &state) const
+  {
     unsigned int index = 0;
 
     for (typename std::vector<common::Any>::const_iterator it =
@@ -98,7 +109,8 @@ public:
   }
 
   template<class W>
-  void state_(unsigned int index, const std::string &name, W Dyn::* var) {
+  void state_(unsigned int index, const std::string &name, W Dyn::* var)
+  {
     if (states.size() <= index) {
       states.resize(index + 1, common::Any());
       state_names.resize(index + 1, std::string());

+ 32 - 16
src/artis-star/common/Value.hpp

@@ -39,26 +39,33 @@
 namespace artis {
 namespace common {
 
-class Value {
+class Value
+{
 public:
   Value()
-      : _content(nullptr), _size(0) {}
+      : _content(nullptr), _size(0)
+  {}
 
   template<typename T>
-  Value(T value) { assign(&value, sizeof(T), typeid(T).hash_code()); }
+  Value(T value)
+  { assign(&value, sizeof(T), typeid(T).hash_code()); }
 
   template<typename T>
-  Value(T *value, size_t size) {
+  Value(T *value, size_t size)
+  {
     assign(value, sizeof(T) * size, typeid(T *).hash_code());
   }
 
-  Value(void *content, size_t size) { assign(content, size, typeid(void *).hash_code()); }
+  Value(void *content, size_t size)
+  { assign(content, size, typeid(void *).hash_code()); }
 
-  Value(const char *value, unsigned int size) {
+  Value(const char *value, unsigned int size)
+  {
     assign(value, size * sizeof(char), typeid(char *).hash_code());
   }
 
-  Value(const Value &value) {
+  Value(const Value &value)
+  {
     if (value._content) {
       assign(value._content, value._size, value._type_id);
     } else {
@@ -68,31 +75,37 @@ public:
     }
   }
 
-  virtual ~Value() {
+  virtual ~Value()
+  {
     if (_content != nullptr)
       delete[] _content;
   }
 
-  bool empty() const { return _content == nullptr; }
+  bool empty() const
+  { return _content == nullptr; }
 
   template<typename T>
-  void operator()(T &value) const {
+  void operator()(T &value) const
+  {
     assert(_type_id == typeid(T).hash_code());
 
     value = *(T *) (_content);
   }
 
   template<typename T>
-  void operator()(T *&value) const {
+  void operator()(T *&value) const
+  {
     assert(_type_id == typeid(T *).hash_code());
 
     value = (T *) (_content);
   }
 
   template<typename Z>
-  bool is_type() const { return _type_id == typeid(Z).hash_code(); }
+  bool is_type() const
+  { return _type_id == typeid(Z).hash_code(); }
 
-  Value &operator=(const Value &value) {
+  Value &operator=(const Value &value)
+  {
     if (_content != nullptr) {
       delete _content;
     }
@@ -106,7 +119,8 @@ public:
     return *this;
   }
 
-  std::string to_string() const {
+  std::string to_string() const
+  {
     if (empty()) {
       return "<null>";
     } else if (is_type<double>()) {
@@ -175,7 +189,8 @@ public:
   }
 
 private:
-  void assign(const void *content, size_t size, size_t type_id) {
+  void assign(const void *content, size_t size, size_t type_id)
+  {
     _content = new char[size];
     std::memcpy(_content, content, size);
     _size = size;
@@ -185,7 +200,8 @@ private:
   friend class boost::serialization::access;
 
   template<class Archive>
-  void serialize(Archive &ar, const unsigned int version) {
+  void serialize(Archive &ar, const unsigned int version)
+  {
     (void) version;
 
     ar & _size;

+ 28 - 14
src/artis-star/common/context/Context.hpp

@@ -36,23 +36,31 @@ namespace common {
 namespace context {
 
 template<class Time>
-class Context {
+class Context
+{
 public:
   Context()
-      : _begin(-1), _end(-1), _valid(false) {}
+      : _begin(-1), _end(-1), _valid(false)
+  {}
 
   Context(const typename Time::type &begin, const typename Time::type &end)
-      : _begin(begin), _end(end), _valid(false) {}
+      : _begin(begin), _end(end), _valid(false)
+  {}
 
-  virtual ~Context() {}
+  virtual ~Context()
+  {}
 
-  const typename Time::type &begin() const { return _begin; }
+  const typename Time::type &begin() const
+  { return _begin; }
 
-  const typename Time::type &end() const { return _end; }
+  const typename Time::type &end() const
+  { return _end; }
 
-  void end(const typename Time::type &end) { _end = end; }
+  void end(const typename Time::type &end)
+  { _end = end; }
 
-  const Context &operator=(const Context &context) {
+  const Context &operator=(const Context &context)
+  {
     _begin = context._begin;
     _end = context._end;
     _valid = context._valid;
@@ -60,26 +68,32 @@ public:
     return *this;
   }
 
-  void saved() { _valid = true; }
+  void saved()
+  { _valid = true; }
 
-  const State<Time> &state() const { return _state; }
+  const State<Time> &state() const
+  { return _state; }
 
-  State<Time> &state() { return _state; }
+  State<Time> &state()
+  { return _state; }
 
-  std::string to_string() const {
+  std::string to_string() const
+  {
     return "begin: " + std::to_string(_begin) +
         "; end: " + std::to_string(_end) +
         "; valid: " + (_valid ? "true" : "false") +
         "; state: " + _state.to_string();
   }
 
-  bool valid() const { return _valid; }
+  bool valid() const
+  { return _valid; }
 
 private:
   friend class boost::serialization::access;
 
   template<class Archive>
-  void serialize(Archive &ar, const unsigned int version) {
+  void serialize(Archive &ar, const unsigned int version)
+  {
     (void) version;
 
     ar & _begin;

+ 26 - 13
src/artis-star/common/context/State.hpp

@@ -40,40 +40,52 @@ namespace common {
 namespace context {
 
 template<class Time>
-class State {
+class State
+{
   typedef std::map<unsigned int, State<Time> > Substates;
 
 public:
   State()
-      : _last_time(-1), _next_time(-1) {}
+      : _last_time(-1), _next_time(-1)
+  {}
 
-  virtual ~State() {}
+  virtual ~State()
+  {}
 
-  void add_state(unsigned int variable_key, const Value &value) {
+  void add_state(unsigned int variable_key, const Value &value)
+  {
     _values.add_state(variable_key, value);
   }
 
-  void add_substate(unsigned int model_key, State &state) {
+  void add_substate(unsigned int model_key, State &state)
+  {
     _substates.insert(std::make_pair(model_key, state));
   }
 
-  const Value &get_state(unsigned int variable_key) const {
+  const Value &get_state(unsigned int variable_key) const
+  {
     return _values.get_state(variable_key);
   }
 
-  const State<Time> &get_substate(unsigned int model_key) const {
+  const State<Time> &get_substate(unsigned int model_key) const
+  {
     return _substates.find(model_key)->second;
   }
 
-  typename Time::type last_time() const { return _last_time; }
+  typename Time::type last_time() const
+  { return _last_time; }
 
-  void last_time(typename Time::type t) { _last_time = t; }
+  void last_time(typename Time::type t)
+  { _last_time = t; }
 
-  typename Time::type next_time() const { return _next_time; }
+  typename Time::type next_time() const
+  { return _next_time; }
 
-  void next_time(typename Time::type t) { _next_time = t; }
+  void next_time(typename Time::type t)
+  { _next_time = t; }
 
-  std::string to_string() const {
+  std::string to_string() const
+  {
     std::string str = "last_time: " + std::to_string(_last_time) +
         "; next_time: " + std::to_string(_next_time) +
         "; values: " + _values.to_string() + "; sub_states: [ ";
@@ -90,7 +102,8 @@ private:
   friend class boost::serialization::access;
 
   template<class Archive>
-  void serialize(Archive &ar, const unsigned int version) {
+  void serialize(Archive &ar, const unsigned int version)
+  {
     (void) version;
 
     ar & _values;

+ 14 - 7
src/artis-star/common/context/StateValues.hpp

@@ -38,15 +38,20 @@ namespace artis {
 namespace common {
 namespace context {
 
-class StateValues {
+class StateValues
+{
 public:
-  StateValues() {}
+  StateValues()
+  {}
 
-  virtual ~StateValues() {}
+  virtual ~StateValues()
+  {}
 
-  void add_state(unsigned int key, const Value &value) { _states[key] = value; }
+  void add_state(unsigned int key, const Value &value)
+  { _states[key] = value; }
 
-  const Value &get_state(unsigned int key) const {
+  const Value &get_state(unsigned int key) const
+  {
     std::map<unsigned int, Value>::const_iterator it =
         _states.find(key);
 
@@ -58,7 +63,8 @@ public:
     }
   }
 
-  std::string to_string() const {
+  std::string to_string() const
+  {
     std::string str = "states: [ ";
     for (std::map<unsigned int, Value>::const_iterator it =
         _states.begin(); it != _states.end(); ++it) {
@@ -72,7 +78,8 @@ private:
   friend class boost::serialization::access;
 
   template<class Archive>
-  void serialize(Archive &ar, const unsigned int version) {
+  void serialize(Archive &ar, const unsigned int version)
+  {
     (void) version;
 
     ar & _states;

+ 18 - 9
src/artis-star/common/observer/Iterator.hpp

@@ -33,18 +33,23 @@ namespace artis {
 namespace observer {
 
 template<typename Time>
-class Iterator {
+class Iterator
+{
 public:
   Iterator(const typename View<Time>::Values &view)
-      : _view(view), _iterator(view.begin()) {}
+      : _view(view), _iterator(view.begin())
+  {}
 
   virtual ~Iterator() = default;
 
-  bool has_next() const { return _iterator != _view.end(); }
+  bool has_next() const
+  { return _iterator != _view.end(); }
 
-  virtual void operator++() { _iterator++; }
+  virtual void operator++()
+  { _iterator++; }
 
-  virtual const std::pair<double, common::Value> &operator*() const { return *_iterator; }
+  virtual const std::pair<double, common::Value> &operator*() const
+  { return *_iterator; }
 
 private:
   const typename View<Time>::Values &_view;
@@ -52,11 +57,13 @@ private:
 };
 
 template<typename Time>
-class DiscreteTimeIterator : public Iterator<Time> {
+class DiscreteTimeIterator : public Iterator<Time>
+{
 public:
   DiscreteTimeIterator(const typename View<Time>::Values &view,
                        const typename Time::type &start, const typename Time::type &step)
-      : Iterator<Time>(view), _step(step), _time(start) {
+      : Iterator<Time>(view), _step(step), _time(start)
+  {
     _last_value = &Iterator<Time>::operator*();
     while (Iterator<Time>::operator*().first <= start
         and Iterator<Time>::has_next()) {
@@ -69,7 +76,8 @@ public:
 
   virtual ~DiscreteTimeIterator() = default;
 
-  void operator++() override {
+  void operator++() override
+  {
     _time += _step;
     _last_value = &Iterator<Time>::operator*();
     while (Iterator<Time>::operator*().first <= _time and Iterator<Time>::has_next()) {
@@ -80,7 +88,8 @@ public:
     }
   }
 
-  const std::pair<double, common::Value> &operator*() const override { return *_last_value; }
+  const std::pair<double, common::Value> &operator*() const override
+  { return *_last_value; }
 
 private:
   typename Time::type _step;

+ 22 - 11
src/artis-star/common/observer/Observer.hpp

@@ -36,28 +36,33 @@ namespace artis {
 namespace observer {
 
 template<typename Time>
-class Observer {
+class Observer
+{
 public:
   typedef std::map<std::string, View<Time> *> Views;
 
   Observer(const common::Model<Time> *model)
       :
       _step(0),
-      _model(model) {}
+      _model(model)
+  {}
 
-  virtual ~Observer() {
+  virtual ~Observer()
+  {
     for (typename Views::iterator it = _views.begin(); it != _views.end();
          ++it) {
       delete it->second;
     }
   }
 
-  void attachView(const std::string &name, View<Time> *view) {
+  void attachView(const std::string &name, View<Time> *view)
+  {
     _views[name] = view;
     view->attachModel(_model);
   }
 
-  Views *cloneViews() const {
+  Views *cloneViews() const
+  {
     Views *v = new Views();
 
     for (typename Views::const_iterator it = _views.begin();
@@ -67,15 +72,19 @@ public:
     return v;
   }
 
-  const View<Time> &view(const std::string &name) const {
+  const View<Time> &view(const std::string &name) const
+  {
     return *_views.find(name)->second;
   }
 
-  const Views &views() const { return _views; }
+  const Views &views() const
+  { return _views; }
 
-  void init() {}
+  void init()
+  {}
 
-  void observe(double t, double next_t) {
+  void observe(double t, double next_t)
+  {
     if (_step == 0) {
       observe(t);
     } else {
@@ -88,7 +97,8 @@ public:
     }
   }
 
-  void switch_to_timed_observer(double step) {
+  void switch_to_timed_observer(double step)
+  {
 
     assert(step > 0);
 
@@ -96,7 +106,8 @@ public:
   }
 
 private:
-  void observe(double t) {
+  void observe(double t)
+  {
     for (typename Views::iterator it = _views.begin(); it != _views.end();
          ++it) {
       it->second->observe(t);

+ 8 - 4
src/artis-star/common/observer/Output.hpp

@@ -34,14 +34,18 @@ namespace artis {
 namespace observer {
 
 template<typename Time>
-class Output {
+class Output
+{
 public:
   Output(const Observer<Time> &observer)
-      : _observer(observer) {}
+      : _observer(observer)
+  {}
 
-  virtual ~Output() {}
+  virtual ~Output()
+  {}
 
-  void operator()(double begin, double end, double step) const {
+  void operator()(double begin, double end, double step) const
+  {
     const typename Observer<Time>::Views &views = _observer.views();
 
     for (typename Observer<Time>::Views::const_iterator it =

+ 26 - 13
src/artis-star/common/observer/View.hpp

@@ -38,7 +38,8 @@ namespace artis {
 namespace observer {
 
 template<typename Time>
-class View {
+class View
+{
   typedef std::vector<int> Selector;
 
 public:
@@ -46,18 +47,23 @@ public:
   typedef std::map<std::string, Values> VariableValues;
   typedef std::map<std::string, VariableValues> SelectorValues;
 
-  enum vars {
+  enum vars
+  {
     ALL = -1
   };
 
   View()
-      : _model(0) {}
+      : _model(0)
+  {}
 
-  virtual ~View() {}
+  virtual ~View()
+  {}
 
-  void attachModel(const artis::common::Model<Time> *m) { _model = m; }
+  void attachModel(const artis::common::Model<Time> *m)
+  { _model = m; }
 
-  View *clone() const {
+  View *clone() const
+  {
     View *v = new View();
 
     // v->_selectors = _selectors;
@@ -104,7 +110,8 @@ public:
 //            }
 
   const Values &
-  get(const std::string &selector_name, const std::string &variable_name) const {
+  get(const std::string &selector_name, const std::string &variable_name) const
+  {
     SelectorValues::const_iterator it = _values.find(selector_name);
 
     if (it != _values.end()) {
@@ -120,7 +127,8 @@ public:
     }
   }
 
-  const Values &get(const std::string &selector_name) const {
+  const Values &get(const std::string &selector_name) const
+  {
     SelectorValues::const_iterator it = _values.find(selector_name);
 
     if (it != _values.end()) {
@@ -133,7 +141,8 @@ public:
   }
 
   void observe(double time, const common::Model<common::DoubleTime> *model,
-               const std::string &selector_name, unsigned int variable_index) {
+               const std::string &selector_name, unsigned int variable_index)
+  {
     std::string path = (boost::format("%1%:%2%") % model->path() %
         model->observable_name(variable_index)).str();
     VariableValues &values = _values[selector_name];
@@ -147,7 +156,8 @@ public:
 
   void observe(const Selector &chain, unsigned int i,
                double time, const common::Model<common::DoubleTime> *model,
-               const std::string &selector_name, unsigned int variable_index) {
+               const std::string &selector_name, unsigned int variable_index)
+  {
     assert(model != nullptr);
 
     while (i < chain.size() - 1 and chain[i + 1] != ALL and model) {
@@ -179,7 +189,8 @@ public:
     }
   }
 
-  virtual void observe(double time) {
+  virtual void observe(double time)
+  {
     for (typename Selectors::const_iterator it = _selectors.begin();
          it != _selectors.end(); ++it) {
       const common::Model<common::DoubleTime> *model = _model;
@@ -197,11 +208,13 @@ public:
     }
   }
 
-  void selector(const std::string &name, const Selector &chain) {
+  void selector(const std::string &name, const Selector &chain)
+  {
     _selectors[name] = chain;
   }
 
-  const SelectorValues &values() const { return _values; }
+  const SelectorValues &values() const
+  { return _values; }
 
 private:
   typedef std::map<std::string, Selector> Selectors;

+ 22 - 11
src/artis-star/common/scheduler/HeapScheduler.hpp

@@ -49,22 +49,27 @@ class HeapScheduler :
     public boost::heap::fibonacci_heap<
         InternalEvent<Time>,
         boost::heap::compare<
-            EventCompare<InternalEvent<Time> > > > {
+            EventCompare<InternalEvent<Time> > > >
+{
 public:
   typedef HeapScheduler<Time, T> type;
   typedef Model<Time> model_type;
   typedef Models<Time> models_type;
   typedef InternalEvent<Time> internal_event_type;
 
-  HeapScheduler() {}
+  HeapScheduler()
+  {}
 
-  virtual ~HeapScheduler() {}
+  virtual ~HeapScheduler()
+  {}
 
-  model_type *get_current_model() {
+  model_type *get_current_model()
+  {
     return type::top().get_model();
   }
 
-  models_type get_current_models(const typename Time::type &time) const {
+  models_type get_current_models(const typename Time::type &time) const
+  {
     models_type models;
     typename models_type::iterator it;
 
@@ -84,7 +89,8 @@ public:
   }
 
   models_type get_current_models(const typename Time::type &begin,
-                                 const typename Time::type &end) const {
+                                 const typename Time::type &end) const
+  {
     models_type models;
     typename models_type::iterator it;
 
@@ -105,15 +111,18 @@ public:
     return models;
   }
 
-  typename Time::type get_current_time() const {
+  typename Time::type get_current_time() const
+  {
     return type::top().get_time();
   }
 
-  void init(typename Time::type time, model_type *model) {
+  void init(typename Time::type time, model_type *model)
+  {
     model->handle(T(type::push(internal_event_type(time, model))));
   }
 
-  void put(typename Time::type time, const model_type *model) {
+  void put(typename Time::type time, const model_type *model)
+  {
     typename Time::type previous_time =
         (*model->handle()._handle).get_time();
 
@@ -127,11 +136,13 @@ public:
     }
   }
 
-  void remove_model(model_type *model) {
+  void remove_model(model_type *model)
+  {
     type::erase(model->handle()._handle);
   }
 
-  std::string to_string() const {
+  std::string to_string() const
+  {
     std::stringstream ss;
 
     ss << "Scheduler = { ";

+ 8 - 4
src/artis-star/common/scheduler/SchedulerHandle.hpp

@@ -31,12 +31,16 @@ namespace artis {
 namespace common {
 namespace scheduler {
 
-struct NoSchedulerHandle {
-  NoSchedulerHandle() {}
+struct NoSchedulerHandle
+{
+  NoSchedulerHandle()
+  {}
 
-  const NoSchedulerHandle &handle() const { return *this; }
+  const NoSchedulerHandle &handle() const
+  { return *this; }
 
-  void handle(const NoSchedulerHandle & /* handle */) {}
+  void handle(const NoSchedulerHandle & /* handle */)
+  {}
 };
 
 }

+ 20 - 10
src/artis-star/common/scheduler/VectorScheduler.hpp

@@ -39,18 +39,23 @@ namespace scheduler {
 
 template<class Time>
 class VectorScheduler :
-    protected std::vector<InternalEvent<Time, NoSchedulerHandle> > {
+    protected std::vector<InternalEvent<Time, NoSchedulerHandle> >
+{
 public:
-  VectorScheduler() {}
+  VectorScheduler()
+  {}
 
-  virtual ~VectorScheduler() {}
+  virtual ~VectorScheduler()
+  {}
 
-  Model<Time, NoSchedulerHandle> *get_current_model() {
+  Model<Time, NoSchedulerHandle> *get_current_model()
+  {
     return VectorScheduler<Time>::front().get_model();
   }
 
   Models<Time, NoSchedulerHandle> get_current_models(
-      typename Time::type time) const {
+      typename Time::type time) const
+  {
     Models<Time, NoSchedulerHandle> models;
 
     for (typename VectorScheduler<Time>::const_iterator it =
@@ -62,17 +67,20 @@ public:
     return models;
   }
 
-  typename Time::type get_current_time() const { return VectorScheduler<Time>::front().get_time(); }
+  typename Time::type get_current_time() const
+  { return VectorScheduler<Time>::front().get_time(); }
 
   void init(typename Time::type time,
-            Model<Time, NoSchedulerHandle> *model) {
+            Model<Time, NoSchedulerHandle> *model)
+  {
     VectorScheduler<Time>::push_back(
         InternalEvent<Time, NoSchedulerHandle>(time, model));
     std::sort(VectorScheduler<Time>::begin(),
               VectorScheduler<Time>::end());
   }
 
-  void put(typename Time::type time, Model<Time, NoSchedulerHandle> *model) {
+  void put(typename Time::type time, Model<Time, NoSchedulerHandle> *model)
+  {
     remove(model);
     VectorScheduler<Time>::push_back(
         InternalEvent<Time, NoSchedulerHandle>(time, model));
@@ -80,7 +88,8 @@ public:
               VectorScheduler<Time>::end());
   }
 
-  std::string to_string() const {
+  std::string to_string() const
+  {
     std::stringstream ss;
 
     ss << "Scheduler = { ";
@@ -95,7 +104,8 @@ public:
   }
 
 private:
-  void remove(Model<Time, NoSchedulerHandle> *model) {
+  void remove(Model<Time, NoSchedulerHandle> *model)
+  {
     typename VectorScheduler<Time>::iterator jt =
         VectorScheduler<Time>::begin();
 

+ 2 - 1
src/artis-star/common/time/Limits.hpp

@@ -33,7 +33,8 @@ namespace artis {
 namespace common {
 
 template<typename T>
-struct Limits {
+struct Limits
+{
   static constexpr T negative_infinity = std::numeric_limits<T>::lowest();
   static constexpr T positive_infinity = std::numeric_limits<T>::max();
   static constexpr T null = 0;

+ 2 - 1
src/artis-star/common/time/RationalTime.hpp

@@ -34,7 +34,8 @@
 namespace artis {
 namespace common {
 
-struct RationalLimits {
+struct RationalLimits
+{
   static constexpr boost::rational<int>
       negative_infinity = boost::rational<int>(std::numeric_limits<int>::lowest());
   static constexpr boost::rational<int>

+ 2 - 1
src/artis-star/common/time/Time.hpp

@@ -31,7 +31,8 @@ namespace artis {
 namespace common {
 
 template<typename Type, typename Limits>
-struct Time {
+struct Time
+{
   static Type negative_infinity;
   static Type infinity;
   static Type null;

+ 6 - 3
src/artis-star/common/utils/FormalismType.hpp

@@ -32,13 +32,16 @@
 namespace artis {
 namespace common {
 
-class FormalismType {
+class FormalismType
+{
 public:
-  enum Values {
+  enum Values
+  {
     NONE = 0, DEVS, DSDE, PDEVS, QSS, DTSS, GDEVS, CELLDEVS, FDDEVS, DESS, SSS
   };
 
-  static std::string to_string(const FormalismType::Values &s) {
+  static std::string to_string(const FormalismType::Values &s)
+  {
     switch (s) {
     case NONE:return "none";
     case DEVS:return "devs";

+ 6 - 3
src/artis-star/common/utils/FunctionType.hpp

@@ -32,14 +32,17 @@
 namespace artis {
 namespace common {
 
-class FunctionType {
+class FunctionType
+{
 public:
-  enum Values {
+  enum Values
+  {
     NONE = 0, CONSTRUCTOR, FINISH, I_MESSAGE, POST_EVENT, S_MESSAGE, Y_MESSAGE,
     DELTA_INT, DELTA_EXT, DELTA_CONF, TA, LAMBDA, START, OUTPUT, TRANSITION
   };
 
-  static std::string to_string(const FunctionType::Values &s) {
+  static std::string to_string(const FunctionType::Values &s)
+  {
     switch (s) {
     case NONE:return "none";
     case CONSTRUCTOR:return "constructor";

+ 6 - 3
src/artis-star/common/utils/LevelType.hpp

@@ -32,13 +32,16 @@
 namespace artis {
 namespace common {
 
-class LevelType {
+class LevelType
+{
 public:
-  enum Values {
+  enum Values
+  {
     NONE = 0, COMMON, FORMALISM, USER
   };
 
-  static std::string to_string(const LevelType::Values &s) {
+  static std::string to_string(const LevelType::Values &s)
+  {
     switch (s) {
     case NONE:return "none";
     case COMMON:return "common";

+ 62 - 31
src/artis-star/common/utils/Multithreading.hpp

@@ -34,34 +34,42 @@
 namespace artis {
 namespace common {
 
-struct BaseMessage {
-  virtual ~BaseMessage() {}
+struct BaseMessage
+{
+  virtual ~BaseMessage()
+  {}
 };
 
 template<typename Msg>
-struct Message : BaseMessage {
+struct Message : BaseMessage
+{
   explicit Message(Msg const &content)
-      : _content(content) {}
+      : _content(content)
+  {}
 
   Msg _content;
 };
 
-class Close {
+class Close
+{
 };
 
-class MessageQueue {
+class MessageQueue
+{
 public:
   MessageQueue() = default;
 
   template<typename T>
-  void push(T const &msg) {
+  void push(T const &msg)
+  {
     std::lock_guard<std::mutex> lock(_mutex);
 
     _queue.push(std::make_shared<Message<T> >(msg));
     _condition.notify_all();
   }
 
-  std::shared_ptr<BaseMessage> wait_and_pop() {
+  std::shared_ptr<BaseMessage> wait_and_pop()
+  {
     std::unique_lock<std::mutex> lock(_mutex);
 
     _condition.wait(lock, [&] { return not _queue.empty(); });
@@ -76,16 +84,20 @@ private:
   std::queue<std::shared_ptr<BaseMessage> > _queue;
 };
 
-class Sender {
+class Sender
+{
 public:
   Sender()
-      : _queue(0) {}
+      : _queue(0)
+  {}
 
   explicit Sender(MessageQueue *queue)
-      : _queue(queue) {}
+      : _queue(queue)
+  {}
 
   template<typename Message>
-  void send(Message const &msg) {
+  void send(Message const &msg)
+  {
     if (_queue) {
       _queue->push(msg);
     }
@@ -96,7 +108,8 @@ private:
 };
 
 template<typename PreviousDispatcher, typename Msg, typename Func>
-class TemplateDispatcher {
+class TemplateDispatcher
+{
   template<typename Dispatcher, typename OtherMsg, typename OtherFunc>
   friend
   class TemplateDispatcher;
@@ -108,7 +121,8 @@ public:
         _function(
             std::move(
                 other._function)),
-        _chained(other._chained) { other._chained = true; }
+        _chained(other._chained)
+  { other._chained = true; }
 
   TemplateDispatcher(MessageQueue *queue,
                      PreviousDispatcher *previous,
@@ -116,9 +130,11 @@ public:
       :
       _queue(queue), _previous(previous),
       _function(std::forward<Func>(function)),
-      _chained(false) { previous->_chained = true; }
+      _chained(false)
+  { previous->_chained = true; }
 
-  bool dispatch(std::shared_ptr<BaseMessage> const &msg) {
+  bool dispatch(std::shared_ptr<BaseMessage> const &msg)
+  {
     Message<Msg> *message =
         dynamic_cast < Message<Msg> * >(msg.get());
 
@@ -133,14 +149,16 @@ public:
   template<typename OtherMsg, typename OtherFunc>
   TemplateDispatcher<TemplateDispatcher<PreviousDispatcher, Msg, Func>,
                      OtherMsg, OtherFunc>
-  handle(OtherFunc &&of) {
+  handle(OtherFunc &&of)
+  {
     return TemplateDispatcher<TemplateDispatcher<PreviousDispatcher,
                                                  Msg, Func>,
                               OtherMsg, OtherFunc>(
         _queue, this, std::forward<OtherFunc>(of));
   }
 
-  ~TemplateDispatcher() noexcept(false) {
+  ~TemplateDispatcher() noexcept(false)
+  {
     if (not _chained) {
       wait_and_dispatch();
     }
@@ -151,7 +169,8 @@ private:
 
   TemplateDispatcher &operator=(TemplateDispatcher const &) = delete;
 
-  void wait_and_dispatch() {
+  void wait_and_dispatch()
+  {
     for (;;) {
       auto msg = _queue->wait_and_pop();
 
@@ -167,7 +186,8 @@ private:
   bool _chained;
 };
 
-class Dispatcher {
+class Dispatcher
+{
   template<typename Dispatcher, typename Msg, typename Func>
   friend
   class TemplateDispatcher;
@@ -175,19 +195,23 @@ class Dispatcher {
 public:
   Dispatcher(Dispatcher &&other)
       : _queue(other._queue),
-        _chained(other._chained) { other._chained = true; }
+        _chained(other._chained)
+  { other._chained = true; }
 
   explicit Dispatcher(MessageQueue *queue)
-      : _queue(queue), _chained(false) {}
+      : _queue(queue), _chained(false)
+  {}
 
   template<typename Message, typename Func>
   TemplateDispatcher<Dispatcher, Message, Func>
-  handle(Func &&function) {
+  handle(Func &&function)
+  {
     return TemplateDispatcher<Dispatcher, Message, Func>(
         _queue, this, std::forward<Func>(function));
   }
 
-  ~Dispatcher() noexcept(false) {
+  ~Dispatcher() noexcept(false)
+  {
     if (not _chained) {
       wait_and_dispatch();
     }
@@ -198,7 +222,8 @@ private:
 
   Dispatcher &operator=(Dispatcher const &) = delete;
 
-  void wait_and_dispatch() {
+  void wait_and_dispatch()
+  {
     for (;;) {
       auto msg = _queue->wait_and_pop();
 
@@ -206,7 +231,8 @@ private:
     }
   }
 
-  bool dispatch(std::shared_ptr<BaseMessage> const &msg) {
+  bool dispatch(std::shared_ptr<BaseMessage> const &msg)
+  {
     if (dynamic_cast < Message<Close> * >(msg.get())) {
       throw Close();
     }
@@ -217,15 +243,20 @@ private:
   bool _chained;
 };
 
-class Receiver {
+class Receiver
+{
 public:
-  Receiver() : _queue(new MessageQueue) {}
+  Receiver() : _queue(new MessageQueue)
+  {}
 
-  ~Receiver() { delete _queue; }
+  ~Receiver()
+  { delete _queue; }
 
-  Sender get_sender() { return Sender(_queue); }
+  Sender get_sender()
+  { return Sender(_queue); }
 
-  Dispatcher wait() { return Dispatcher(_queue); }
+  Dispatcher wait()
+  { return Dispatcher(_queue); }
 
 private:
   MessageQueue *_queue;

+ 4 - 2
src/artis-star/common/utils/String.hpp

@@ -32,9 +32,11 @@
 namespace artis {
 namespace common {
 
-class String {
+class String
+{
 public:
-  static std::string make_spaces(unsigned int number) {
+  static std::string make_spaces(unsigned int number)
+  {
     std::string str;
 
     for (unsigned int i = 0; i < number; ++i) {

+ 68 - 34
src/artis-star/common/utils/Trace.hpp

@@ -42,35 +42,47 @@ namespace artis {
 namespace common {
 
 template<class Time>
-class TraceElement {
+class TraceElement
+{
 public:
   TraceElement()
       : _time(Time::null), _formalism_type(FormalismType::NONE),
-        _function_type(FunctionType::NONE), _level_type(LevelType::NONE) {}
+        _function_type(FunctionType::NONE), _level_type(LevelType::NONE)
+  {}
 
   TraceElement(const std::string &model_name, typename Time::type time,
                const FormalismType::Values &formalism_type,
                const FunctionType::Values &function_type, const LevelType::Values &level_type)
       : _model_name(model_name), _time(time), _formalism_type(formalism_type),
-        _function_type(function_type), _level_type(level_type) {}
+        _function_type(function_type), _level_type(level_type)
+  {}
 
-  virtual ~TraceElement() {}
+  virtual ~TraceElement()
+  {}
 
-  const std::string &get_comment() const { return _comment; }
+  const std::string &get_comment() const
+  { return _comment; }
 
-  const std::string &get_model_name() const { return _model_name; }
+  const std::string &get_model_name() const
+  { return _model_name; }
 
-  typename Time::type get_time() const { return _time; }
+  typename Time::type get_time() const
+  { return _time; }
 
-  const FormalismType::Values &get_formalism_type() const { return _formalism_type; }
+  const FormalismType::Values &get_formalism_type() const
+  { return _formalism_type; }
 
-  const FunctionType::Values &get_function_type() const { return _function_type; }
+  const FunctionType::Values &get_function_type() const
+  { return _function_type; }
 
-  const LevelType::Values &get_level_type() const { return _level_type; }
+  const LevelType::Values &get_level_type() const
+  { return _level_type; }
 
-  void set_comment(const std::string &comment) { _comment = comment; }
+  void set_comment(const std::string &comment)
+  { _comment = comment; }
 
-  std::string to_string() const {
+  std::string to_string() const
+  {
     std::ostringstream ss;
 
     ss << "TRACE: " << get_model_name() << " at " << get_time() << " <";
@@ -93,13 +105,17 @@ private:
 };
 
 template<class Time>
-class TraceElements : public std::vector<TraceElement<Time> > {
+class TraceElements : public std::vector<TraceElement<Time> >
+{
 public:
-  TraceElements() {}
+  TraceElements()
+  {}
 
-  virtual ~TraceElements() {}
+  virtual ~TraceElements()
+  {}
 
-  TraceElements filter_model_name(const std::string &model_name) const {
+  TraceElements filter_model_name(const std::string &model_name) const
+  {
     TraceElements<Time> result;
 
     std::copy_if(TraceElements<Time>::begin(),
@@ -110,7 +126,8 @@ public:
     return result;
   }
 
-  TraceElements filter_time(typename Time::type time) const {
+  TraceElements filter_time(typename Time::type time) const
+  {
     TraceElements result;
 
     std::copy_if(TraceElements<Time>::begin(),
@@ -119,7 +136,8 @@ public:
     return result;
   }
 
-  TraceElements filter_formalism_type(const FormalismType::Values &type) const {
+  TraceElements filter_formalism_type(const FormalismType::Values &type) const
+  {
     TraceElements result;
 
     std::copy_if(TraceElements<Time>::begin(),
@@ -128,7 +146,8 @@ public:
     return result;
   }
 
-  TraceElements filter_function_type(const FunctionType::Values &type) const {
+  TraceElements filter_function_type(const FunctionType::Values &type) const
+  {
     TraceElements result;
 
     std::copy_if(TraceElements<Time>::begin(),
@@ -137,7 +156,8 @@ public:
     return result;
   }
 
-  TraceElements filter_level_type(const LevelType::Values &type) const {
+  TraceElements filter_level_type(const LevelType::Values &type) const
+  {
     TraceElements result;
 
     std::copy_if(TraceElements<Time>::begin(),
@@ -146,7 +166,8 @@ public:
     return result;
   }
 
-  std::string to_string() const {
+  std::string to_string() const
+  {
     std::ostringstream ss;
 
     for (typename TraceElements<Time>::const_iterator it = TraceElements<Time>::begin();
@@ -165,11 +186,14 @@ public:
 };
 
 template<class Time>
-class Trace {
+class Trace
+{
 public:
-  virtual ~Trace() {}
+  virtual ~Trace()
+  {}
 
-  static Trace &trace() {
+  static Trace &trace()
+  {
 //                std::call_once(_flag, []() { _instance.reset(new Trace()); });
     if (!_instance) {
       _instance.reset(new Trace());
@@ -177,11 +201,14 @@ public:
     return *_instance;
   }
 
-  void clear() { _trace.clear(); }
+  void clear()
+  { _trace.clear(); }
 
-  const TraceElements<Time> &elements() const { return _trace; }
+  const TraceElements<Time> &elements() const
+  { return _trace; }
 
-  void flush() {
+  void flush()
+  {
     std::lock_guard<std::mutex> lock(_mutex);
 
     if (_sstream) {
@@ -192,11 +219,14 @@ public:
     _trace.push_back(_element);
   }
 
-  std::mutex &mutex() { return _mutex; }
+  std::mutex &mutex()
+  { return _mutex; }
 
-  void set_element(const TraceElement<Time> &element) { _element = element; }
+  void set_element(const TraceElement<Time> &element)
+  { _element = element; }
 
-  std::ostringstream &sstream() {
+  std::ostringstream &sstream()
+  {
     if (_sstream == 0) {
       _sstream = new std::ostringstream();
     }
@@ -204,7 +234,8 @@ public:
   }
 
 private:
-  Trace() { _sstream = 0; }
+  Trace()
+  { _sstream = 0; }
 
   static std::shared_ptr<Trace<Time> > _instance;
 //            static std::once_flag _flag;
@@ -220,7 +251,8 @@ private:
 
 template<class Time>
 artis::common::Trace<Time> &
-operator<<(artis::common::Trace<Time> &trace, const artis::common::TraceElement<Time> &e) {
+operator<<(artis::common::Trace<Time> &trace, const artis::common::TraceElement<Time> &e)
+{
   std::lock_guard<std::mutex> lock(trace.mutex());
 
   trace.set_element(e);
@@ -228,7 +260,8 @@ operator<<(artis::common::Trace<Time> &trace, const artis::common::TraceElement<
 }
 
 template<class Time>
-artis::common::Trace<Time> &operator<<(artis::common::Trace<Time> &trace, const std::string &str) {
+artis::common::Trace<Time> &operator<<(artis::common::Trace<Time> &trace, const std::string &str)
+{
   std::lock_guard<std::mutex> lock(trace.mutex());
 
   trace.sstream() << str;
@@ -236,7 +269,8 @@ artis::common::Trace<Time> &operator<<(artis::common::Trace<Time> &trace, const
 }
 
 template<class Time>
-artis::common::Trace<Time> &operator<<(artis::common::Trace<Time> &trace, typename Time::type t) {
+artis::common::Trace<Time> &operator<<(artis::common::Trace<Time> &trace, typename Time::type t)
+{
   std::lock_guard<std::mutex> lock(trace.mutex());
 
   trace.sstream() << t;

+ 34 - 17
src/artis-star/kernel/devs/Coordinator.hpp

@@ -43,7 +43,8 @@ template<class Time,
     class Select,
     class Parameters = common::NoParameters,
     class GraphParameters = common::NoParameters>
-class Coordinator : public common::Coordinator<Time> {
+class Coordinator : public common::Coordinator<Time>
+{
   typedef Coordinator<Time, GraphManager, Parameters, GraphParameters> type;
 
 public:
@@ -56,15 +57,19 @@ public:
       common::Model<Time>(name),
       common::Coordinator<Time>(name),
       _graph_manager(this, parameters, graph_parameters),
-      _d_star(nullptr) {}
+      _d_star(nullptr)
+  {}
 
   virtual ~Coordinator() = default;
 
-  GraphManager &get_graph_manager() { return _graph_manager; }
+  GraphManager &get_graph_manager()
+  { return _graph_manager; }
 
-  const GraphManager &get_graph_manager() const { return _graph_manager; }
+  const GraphManager &get_graph_manager() const
+  { return _graph_manager; }
 
-  virtual std::string to_string(int level) const {
+  virtual std::string to_string(int level) const
+  {
     std::ostringstream ss;
 
     ss << common::String::make_spaces(level * 2) << "p-devs coordinator \""
@@ -73,14 +78,16 @@ public:
     return ss.str();
   }
 
-  void restore(const common::context::State<Time> &state) {
+  void restore(const common::context::State<Time> &state)
+  {
     common::Coordinator<Time>::restore(state);
     for (auto &child : _graph_manager.children()) {
       _event_table.init(child->get_tn(), child);
     }
   }