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

Remove Scheduler template

Eric Ramat преди 9 години
родител
ревизия
f0ea741f43

+ 6 - 6
src/paradevs/common/Bag.hpp

@@ -35,11 +35,11 @@
 
 namespace paradevs { namespace common {
 
-template < class Time, class SchedulerHandle >
+template < class Time >
 class ExternalEvent;
 
-template < class Time, class SchedulerHandle >
-class Bag : public std::vector < ExternalEvent < Time, SchedulerHandle > >
+template < class Time >
+class Bag : public std::vector < ExternalEvent < Time > >
 {
 public:
     Bag()
@@ -52,9 +52,9 @@ public:
         std::ostringstream ss;
 
         ss << "{ ";
-        for (typename Bag < Time, SchedulerHandle >::const_iterator it =
-                 Bag < Time, SchedulerHandle >::begin();
-             it != Bag < Time, SchedulerHandle >::end(); ++it) {
+        for (typename Bag < Time >::const_iterator it =
+                 Bag < Time >::begin();
+             it != Bag < Time >::end(); ++it) {
             ss << it->to_string() << " ";
         }
         ss << "}";

+ 2 - 1
src/paradevs/common/CMakeLists.txt

@@ -11,7 +11,8 @@ LINK_DIRECTORIES(
   ${Boost_LIBRARY_DIRS})
 
 SET(COMMON_HPP Bag.hpp Coordinator.hpp ExternalEvent.hpp InternalEvent.hpp
-  Links.hpp Model.hpp Node.hpp Parameters.hpp RootCoordinator.hpp Simulator.hpp)
+  Links.hpp Model.hpp Node.hpp Parameters.hpp RootCoordinator.hpp Scheduler.hpp
+  Simulator.hpp)
 
 INSTALL(FILES ${COMMON_HPP} DESTINATION ${PARADEVS_INCLUDE_DIRS}/common)
 

+ 7 - 10
src/paradevs/common/Coordinator.hpp

@@ -37,14 +37,14 @@
 
 namespace paradevs { namespace common {
 
-template < class Time, class SchedulerHandle >
+template < class Time >
 class Model;
 
-template < class Time, class SchedulerHandle >
-class Coordinator : public virtual Model < Time, SchedulerHandle >
+template < class Time >
+class Coordinator : public virtual Model < Time >
 {
 public :
-    Coordinator(const std::string& name) : Model < Time, SchedulerHandle >(name)
+    Coordinator(const std::string& name) : Model < Time >(name)
     { }
 
     virtual ~Coordinator()
@@ -58,7 +58,7 @@ public :
         std::ostringstream ss;
 
         ss << "Coordinator "
-           << Coordinator < Time, SchedulerHandle >::get_name();
+           << Coordinator < Time >::get_name();
         return ss.str();
     }
 
@@ -66,11 +66,8 @@ public :
     virtual void observation(std::ostream& file) const =0;
     virtual void output(typename Time::type t) =0;
     virtual void post_event(typename Time::type t,
-                            const common::ExternalEvent < Time,
-                                                          SchedulerHandle >&
-                            event) =0;
-    virtual typename Time::type dispatch_events(common::Bag < Time,
-                                                              SchedulerHandle >
+                            const common::ExternalEvent < Time >& event) =0;
+    virtual typename Time::type dispatch_events(common::Bag < Time >
                                                 bag,
                                                 typename Time::type t) =0;
     virtual typename Time::type start(typename Time::type t) =0;

+ 9 - 9
src/paradevs/common/ExternalEvent.hpp

@@ -36,12 +36,12 @@
 
 namespace paradevs { namespace common {
 
-template < class Time, class SchedulerHandle >
+template < class Time >
 class Node;
-template < class Time, class SchedulerHandle >
+template < class Time >
 class Model;
 
-template < class Time, class SchedulerHandle >
+template < class Time >
 class ExternalEvent
 {
 public:
@@ -49,7 +49,7 @@ public:
         _port_name(port_name), _model(0), _content(content)
     { }
 
-    ExternalEvent(const Node < Time, SchedulerHandle >& node, void* content) :
+    ExternalEvent(const Node < Time >& node, void* content) :
         _port_name(node.get_port_name()),
         _model(node.get_model()),
         _content(content)
@@ -70,13 +70,13 @@ public:
     void set_content(void* content)
     { _content = content; }
 
-    Model < Time, SchedulerHandle >* get_model() const
+    Model < Time >* get_model() const
     { return _model; }
 
     bool on_port(const std::string& port_name) const
     { return _port_name == port_name; }
 
-    void set_model(Model < Time, SchedulerHandle >* model)
+    void set_model(Model < Time >* model)
     { _model = model; }
 
     std::string to_string() const
@@ -89,9 +89,9 @@ public:
     }
 
 private :
-    std::string                      _port_name;
-    Model < Time, SchedulerHandle >* _model;
-    void*                            _content;
+    std::string     _port_name;
+    Model < Time >* _model;
+    void*           _content;
 };
 
 } } // namespace paradevs common

+ 6 - 7
src/paradevs/common/InternalEvent.hpp

@@ -33,22 +33,21 @@
 
 namespace paradevs { namespace common {
 
-template < class Time, class SchedulerHandle >
+template < class Time >
 class Model;
 
-template < class Time, class SchedulerHandle >
+template < class Time >
 class InternalEvent
 {
 public:
-    InternalEvent(const typename Time::type& time,
-                  Model < Time, SchedulerHandle >* model)
+    InternalEvent(const typename Time::type& time, Model < Time >* model)
         : _time(time), _model(model)
     { }
 
     virtual ~InternalEvent()
     { }
 
-    Model < Time, SchedulerHandle >* get_model() const
+    Model < Time >* get_model() const
     { return _model; }
 
     typename Time::type get_time() const
@@ -78,8 +77,8 @@ public:
     { _time = time; }
 
 private:
-    typename Time::type              _time;
-    Model < Time, SchedulerHandle >* _model;
+    typename Time::type _time;
+    Model < Time >*     _model;
 };
 
 template < typename Event >

+ 29 - 29
src/paradevs/common/Links.hpp

@@ -35,18 +35,18 @@
 
 namespace paradevs { namespace common {
 
-template < class Time, class SchedulerHandle >
+template < class Time >
 class Node;
 
-template < class Time, class SchedulerHandle >
-class Links : public std::multimap < Node < Time, SchedulerHandle >,
-                                     Node < Time, SchedulerHandle > >
+template < class Time >
+class Links : public std::multimap < Node < Time >,
+                                     Node < Time > >
 {
 public:
 
     typedef std::pair <
-        typename Links < Time, SchedulerHandle >::const_iterator,
-        typename Links < Time, SchedulerHandle >::const_iterator
+        typename Links < Time >::const_iterator,
+        typename Links < Time >::const_iterator
     > Result;
 
     Links()
@@ -54,47 +54,47 @@ public:
     virtual ~Links()
     { }
 
-    void add(Model < Time, SchedulerHandle >* out_model,
+    void add(Model < Time >* out_model,
              const std::string& out_port_name,
-             Model < Time, SchedulerHandle >* in_model,
+             Model < Time >* in_model,
              const std::string& in_port_name)
     {
-        std::multimap < Node < Time, SchedulerHandle >,
-                        Node < Time, SchedulerHandle > >::insert(
-                            std::pair < Node < Time, SchedulerHandle >,
-                                        Node < Time, SchedulerHandle > >(
-                                            Node < Time, SchedulerHandle >(
+        std::multimap < Node < Time >,
+                        Node < Time > >::insert(
+                            std::pair < Node < Time >,
+                                        Node < Time > >(
+                                            Node < Time >(
                                                 out_model, out_port_name),
-                                            Node < Time, SchedulerHandle >(
+                                            Node < Time >(
                                                 in_model, in_port_name)));
     }
 
-    bool exist(Model < Time, SchedulerHandle >* out_model,
+    bool exist(Model < Time >* out_model,
                const std::string& out_port_name,
-               Model < Time, SchedulerHandle >* in_model,
+               Model < Time >* in_model,
                const std::string& in_port_name) const
     {
-        typename Links < Time, SchedulerHandle >::const_iterator it =
-            std::multimap < Node < Time, SchedulerHandle >,
-                            Node < Time, SchedulerHandle > >::find(
-                                Node < Time, SchedulerHandle >(out_model,
+        typename Links < Time >::const_iterator it =
+            std::multimap < Node < Time >,
+                            Node < Time > >::find(
+                                Node < Time >(out_model,
                                                                out_port_name));
         bool found = false;
 
-        while (not found and it != Links < Time, SchedulerHandle >::end()) {
-            found = it->second == Node < Time, SchedulerHandle >(
+        while (not found and it != Links < Time >::end()) {
+            found = it->second == Node < Time >(
                 in_model, in_port_name);
             ++it;
         }
         return found;
     }
 
-    Links::Result find(Model < Time, SchedulerHandle >* out_model,
+    Links::Result find(Model < Time >* out_model,
                        const std::string& out_port_name) const
     {
-        return std::multimap < Node < Time, SchedulerHandle >,
-                               Node < Time, SchedulerHandle > >::equal_range(
-                                   common::Node < Time, SchedulerHandle >(
+        return std::multimap < Node < Time >,
+                               Node < Time > >::equal_range(
+                                   common::Node < Time >(
                                        out_model, out_port_name));
     }
 
@@ -103,9 +103,9 @@ public:
         std::stringstream ss;
 
         ss << common::spaces(level * 2) << "Links:" << std::endl;
-        for (typename Links < Time, SchedulerHandle >::const_iterator it =
-                 Links < Time, SchedulerHandle >::begin();
-             it != Links < Time, SchedulerHandle >::end(); ++it) {
+        for (typename Links < Time >::const_iterator it =
+                 Links < Time >::begin();
+             it != Links < Time >::end(); ++it) {
             ss << common::spaces((level + 1) * 2)
                << it->first.get_model()->get_name() << "::"
                << it->first.get_port_name()

+ 23 - 25
src/paradevs/common/Model.hpp

@@ -30,6 +30,7 @@
 #include <paradevs/common/Bag.hpp>
 #include <paradevs/common/ExternalEvent.hpp>
 #include <paradevs/common/InternalEvent.hpp>
+#include <paradevs/common/Scheduler.hpp>
 
 #include <algorithm>
 #include <cassert>
@@ -39,19 +40,19 @@
 
 namespace paradevs { namespace common {
 
-template < class Time, class SchedulerHandle >
+template < class Time >
 class ExternalEvent;
 
-template < class Time, class SchedulerHandle >
+template < class Time >
 class InternalEvent;
 
-template < class Tim, class SchedulerHandlee >
+template < class Time >
 class Bag;
 
 typedef std::string Port;
 typedef std::vector < Port > Ports;
 
-template < class Time, class SchedulerHandle >
+template < class Time >
 class Model
 {
 public:
@@ -112,22 +113,21 @@ public:
     const std::string& get_name() const
     { return _name; }
 
-    Model < Time, SchedulerHandle >* get_parent() const
+    Model < Time >* get_parent() const
     { return _parent; }
 
     virtual bool is_atomic() const = 0;
 
-    void set_parent(Model < Time, SchedulerHandle >* 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, SchedulerHandle >&
-                   message)
+    void add_event(const common::ExternalEvent < Time >& message)
     {
         if (_inputs == 0) {
-            _inputs = new Bag < Time, SchedulerHandle >;
+            _inputs = new Bag < Time >;
         }
         _inputs->push_back(message);
     }
@@ -149,10 +149,10 @@ public:
         }
     }
 
-    const common::Bag < Time, SchedulerHandle >& get_bag()
+    const common::Bag < Time >& get_bag()
     {
         if (_inputs == 0) {
-            _inputs = new Bag < Time, SchedulerHandle >;
+            _inputs = new Bag < Time >;
         }
         return *_inputs;
     }
@@ -168,9 +168,7 @@ public:
     virtual void observation(std::ostream& file) const =0;
     virtual void output(typename Time::type t) =0;
     virtual void post_event(typename Time::type t,
-                            const common::ExternalEvent < Time,
-                                                          SchedulerHandle >&
-                            event) = 0;
+                            const common::ExternalEvent < Time >& event) = 0;
     virtual typename Time::type start(typename Time::type t) =0;
     virtual typename Time::type transition(typename Time::type t) =0;
 
@@ -186,17 +184,17 @@ protected:
     typename Time::type _tn;
 
 private :
-    Model < Time, SchedulerHandle >* _parent;
-    std::string                      _name;
-    Ports                            _in_ports;
-    Ports                            _out_ports;
+    Model < Time >* _parent;
+    std::string     _name;
+    Ports           _in_ports;
+    Ports           _out_ports;
 
-    Bag < Time, SchedulerHandle >*   _inputs;
-    SchedulerHandle                  _handle;
+    Bag < Time >*   _inputs;
+    SchedulerHandle _handle;
 };
 
-template < class Time, class SchedulerHandle >
-class Models : public std::vector < Model < Time, SchedulerHandle >* >
+template < class Time >
+class Models : public std::vector < Model < Time >* >
 {
 public:
     Models()
@@ -209,9 +207,9 @@ public:
         std::ostringstream ss;
 
         ss << "{ ";
-        for (typename Models < Time, SchedulerHandle >::const_iterator it =
-                 Models < Time, SchedulerHandle >::begin();
-             it != Models < Time, SchedulerHandle >::end(); ++it) {
+        for (typename Models < Time >::const_iterator it =
+                 Models < Time >::begin();
+             it != Models < Time >::end(); ++it) {
             ss << (*it)->get_name() << " ";
         }
         ss << "}";

+ 9 - 9
src/paradevs/common/Node.hpp

@@ -33,25 +33,25 @@
 
 namespace paradevs { namespace common {
 
-template < class Time, class SchedulerHandle >
+template < class Time >
 class Model;
 
-template < class Time, class SchedulerHandle >
+template < class Time >
 class Node
 {
 public :
-    Node(Model < Time, SchedulerHandle >* model, const std::string& port_name)
+    Node(Model < Time >* model, const std::string& port_name)
         : _model(model), _port_name(port_name)
     { }
 
-    Node(const Node < Time, SchedulerHandle >& other)
+    Node(const Node < Time >& other)
     : _model(other._model), _port_name(other._port_name)
     { }
 
     virtual ~Node()
     { }
 
-    bool operator<(const Node < Time, SchedulerHandle >& o) const
+    bool operator<(const Node < Time >& o) const
     {
         if (o._model == _model) {
             return o._port_name < _port_name;
@@ -60,7 +60,7 @@ public :
         }
     }
 
-    bool operator==(const Node < Time, SchedulerHandle >& o) const
+    bool operator==(const Node < Time >& o) const
     {
         return (o._port_name == _port_name and o._model == _model);
     }
@@ -68,12 +68,12 @@ public :
     const std::string& get_port_name() const
     { return _port_name; }
 
-    Model < Time, SchedulerHandle >* get_model() const
+    Model < Time >* get_model() const
     { return _model; }
 
 private :
-    Model < Time, SchedulerHandle >* _model;
-    std::string                      _port_name;
+    Model < Time >* _model;
+    std::string     _port_name;
 };
 
 } } // namespace paradevs common

+ 59 - 0
src/paradevs/common/Scheduler.hpp

@@ -0,0 +1,59 @@
+/**
+ * @file Scheduler.hpp
+ * @author The PARADEVS Development Team
+ * See the AUTHORS or Authors.txt file
+ */
+
+/*
+ * PARADEVS - the multimodeling and simulation environment
+ * This file is a part of the PARADEVS environment
+ *
+ * Copyright (C) 2013-2015 ULCO http://www.univ-litoral.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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef COMMON_SCHEDULER
+#define COMMON_SCHEDULER 1
+
+#include <paradevs/common/scheduler/HeapScheduler.hpp>
+
+namespace paradevs { namespace common {
+
+struct SchedulerHandle;
+
+typedef typename paradevs::common::scheduler::HeapScheduler <
+    common::DoubleTime, SchedulerHandle >::type SchedulerType;
+
+struct SchedulerHandle
+{
+    SchedulerHandle()
+    { }
+
+    SchedulerHandle(const SchedulerType::handle_type& handle)
+        : _handle(handle)
+    { }
+
+    const SchedulerHandle& handle() const
+    { return *this; }
+
+    void handle(const SchedulerHandle& handle)
+    { _handle = handle._handle; }
+
+    SchedulerType::handle_type _handle;
+};
+
+} } // namespace paradevs common
+
+#endif

+ 5 - 7
src/paradevs/common/Simulator.hpp

@@ -33,11 +33,11 @@
 
 namespace paradevs { namespace common {
 
-template < class Time, class SchedulerHandle >
-class Simulator : public virtual Model < Time, SchedulerHandle >
+template < class Time >
+class Simulator : public virtual Model < Time >
 {
 public :
-    Simulator(const std::string& name) : Model < Time, SchedulerHandle >(name)
+    Simulator(const std::string& name) : Model < Time >(name)
     { }
     virtual ~Simulator()
     { }
@@ -49,7 +49,7 @@ public :
     {
         std::ostringstream ss;
 
-        ss << "Simulator " << Simulator < Time, SchedulerHandle >::get_name();
+        ss << "Simulator " << Simulator < Time >::get_name();
         return ss.str();
     }
 
@@ -57,9 +57,7 @@ public :
     virtual void observation(std::ostream& file) const =0;
     virtual void output(typename Time::type t) =0;
     virtual void post_event(typename Time::type t,
-                            const common::ExternalEvent < Time,
-                                                          SchedulerHandle >&
-                            event) = 0;
+                            const common::ExternalEvent < Time >& event) = 0;
     virtual typename Time::type start(typename Time::type t) =0;
     virtual typename Time::type transition(typename Time::type t) =0;
 };

+ 15 - 7
src/paradevs/common/scheduler/HeapScheduler.hpp

@@ -33,20 +33,28 @@
 
 #include <sstream>
 
-namespace paradevs { namespace common { namespace scheduler {
+namespace paradevs { namespace common {
+
+template < class Time >
+class Model;
+
+template < class Time >
+class Models;
+
+namespace scheduler {
 
 template < class Time, class T >
 class HeapScheduler :
         public boost::heap::fibonacci_heap <
-    InternalEvent < Time, T >,
+    InternalEvent < Time >,
     boost::heap::compare <
-        EventCompare < InternalEvent < Time, T > > > >
+        EventCompare < InternalEvent < Time > > > >
 {
 public:
     typedef HeapScheduler < Time, T > type;
-    typedef Model < Time, T >         model_type;
-    typedef Models < Time, T >        models_type;
-    typedef InternalEvent < Time, T > internal_event_type;
+    typedef Model < Time >            model_type;
+    typedef Models < Time >           models_type;
+    typedef InternalEvent < Time >    internal_event_type;
 
     HeapScheduler()
     { }
@@ -79,7 +87,7 @@ public:
         model->handle(T(type::push(internal_event_type(time, model))));
     }
 
-    void put(typename Time::type time, model_type* model)
+    void put(typename Time::type time, const model_type* model)
     {
         typename Time::type previous_time =
             (*model->handle()._handle).get_time();

+ 7 - 9
src/paradevs/kernel/dtss/Coordinator.hpp

@@ -47,11 +47,11 @@ public:
 };
 
 template < class Time, class Policy, class GraphManager,
-           class SchedulerHandle, class Parameters = Parameters < Time >,
+           class Parameters = Parameters < Time >,
            class GraphParameters = common::NoParameters >
-class Coordinator : public common::Coordinator < Time, SchedulerHandle >
+class Coordinator : public common::Coordinator < Time >
 {
-    typedef Coordinator < Time, Policy, GraphManager, SchedulerHandle,
+    typedef Coordinator < Time, Policy, GraphManager,
                           Parameters, GraphParameters > type;
 
 public:
@@ -61,8 +61,8 @@ public:
     Coordinator(const std::string& name,
                 const Parameters& parameters,
                 const GraphParameters& graph_paramaters) :
-        common::Model < Time, SchedulerHandle >(name),
-        common::Coordinator < Time, SchedulerHandle >(name),
+        common::Model < Time >(name),
+        common::Coordinator < Time >(name),
         _graph_manager(this, graph_paramaters),
         _time_step(parameters._time_step)
     { }
@@ -102,8 +102,7 @@ public:
         return type::_tn;
     }
 
-    typename Time::type dispatch_events(common::Bag < Time,
-                                                      SchedulerHandle > bag,
+    typename Time::type dispatch_events(common::Bag < Time > bag,
                                         typename Time::type t)
     {
 
@@ -166,8 +165,7 @@ public:
     }
 
     void post_event(typename Time::type t,
-                    const common::ExternalEvent < Time,
-                                                  SchedulerHandle >& event)
+                    const common::ExternalEvent < Time >& event)
     {
 
 #ifdef WITH_TRACE

+ 3 - 5
src/paradevs/kernel/dtss/Dynamics.hpp

@@ -34,7 +34,6 @@
 namespace paradevs { namespace dtss {
 
 template < class Time,
-           class SchedulerHandle = common::scheduler::NoSchedulerHandle,
            class Parameters = common::NoParameters >
 class Dynamics
 {
@@ -46,17 +45,16 @@ public:
     virtual ~Dynamics()
     { }
 
-    virtual void transition(const common::Bag < Time,
-                                                SchedulerHandle >& /* x */,
+    virtual void transition(const common::Bag < Time >& /* x */,
                             typename Time::type /* t */)
     { }
 
     virtual typename Time::type start(typename Time::type/* time */)
     { return Time::infinity; }
 
-    common::Bag < Time, SchedulerHandle > lambda(
+    common::Bag < Time > lambda(
         typename Time::type /* time */) const
-    { return common::Bag < Time, SchedulerHandle >(); }
+    { return common::Bag < Time >(); }
 
     virtual void observation(std::ostream& /* file */) const
     { }

+ 22 - 33
src/paradevs/kernel/dtss/GraphManager.hpp

@@ -31,18 +31,15 @@
 #include <paradevs/common/Links.hpp>
 #include <paradevs/common/Model.hpp>
 #include <paradevs/common/Parameters.hpp>
-#include <paradevs/common/scheduler/SchedulerHandle.hpp>
 
 namespace paradevs { namespace dtss {
 
 template < class Time,
-           class SchedulerHandle =
-               paradevs::common::scheduler::NoSchedulerHandle,
            class GraphParameters = common::NoParameters >
 class GraphManager
 {
 public:
-    GraphManager(common::Coordinator < Time, SchedulerHandle >* coordinator,
+    GraphManager(common::Coordinator < Time >* coordinator,
                  const GraphParameters& /* parameters */) :
         _coordinator(coordinator)
     { }
@@ -50,15 +47,15 @@ public:
     virtual ~GraphManager()
     { }
 
-    void add_child(common::Model < Time, SchedulerHandle >* child)
+    void add_child(common::Model < Time >* child)
     {
         _child_list.push_back(child);
         child->set_parent(_coordinator);
     }
 
-    void add_link(common::Model < Time, SchedulerHandle >* src_model,
+    void add_link(common::Model < Time >* src_model,
                   const std::string& src_port_name,
-                  common::Model < Time, SchedulerHandle >* dst_model,
+                  common::Model < Time >* dst_model,
                   const std::string& dst_port_name)
     {
         assert((src_model != _coordinator and
@@ -77,64 +74,56 @@ public:
         _link_list.add(src_model, src_port_name, dst_model, dst_port_name);
     }
 
-    const common::Models < Time, SchedulerHandle >& children() const
+    const common::Models < Time >& children() const
     { return _child_list; }
 
-    void dispatch_events(common::Bag < Time, SchedulerHandle > bag,
+    void dispatch_events(common::Bag < Time > bag,
                          typename Time::type t)
     {
         for (auto & ymsg : bag) {
-            typename common::Links < Time,
-                                     SchedulerHandle >::Result result_model =
+            typename common::Links < Time >::Result result_model =
                 _link_list.find(ymsg.get_model(),
                                 ymsg.get_port_name());
 
-            for (typename common::Links < Time,
-                                          SchedulerHandle >::const_iterator it =
+            for (typename common::Links < Time >::const_iterator it =
                      result_model.first; it != result_model.second; ++it) {
                 // event on output port of coupled model
                 if (it->second.get_model() == _coordinator) {
-                    common::Bag < Time, SchedulerHandle > ymessages;
+                    common::Bag < Time > ymessages;
 
                     ymessages.push_back(
-                        common::ExternalEvent < Time,
-                                                SchedulerHandle >(
-                                                    it->second,
-                                                    ymsg.get_content()));
-                    dynamic_cast < common::Coordinator <
-                        Time, SchedulerHandle >* >(_coordinator->get_parent())
+                        common::ExternalEvent < Time >(
+                            it->second, ymsg.get_content()));
+                    dynamic_cast < common::Coordinator <Time >* >(
+                        _coordinator->get_parent())
                         ->dispatch_events(ymessages, t);
                 } else { // event on input port of internal model
                     it->second.get_model()->post_event(
-                        t, common::ExternalEvent < Time,
-                                                   SchedulerHandle >(
-                                                       it->second,
-                                                       ymsg.get_content()));
+                        t, common::ExternalEvent < Time >(
+                            it->second, ymsg.get_content()));
                 }
             }
         }
     }
 
     void post_event(typename Time::type t,
-                    const common::ExternalEvent < Time,
-                                                  SchedulerHandle >& event)
+                    const common::ExternalEvent < Time >& event)
     {
-        typename common::Links < Time, SchedulerHandle >::Result result =
+        typename common::Links < Time >::Result result =
             _link_list.find(_coordinator, event.get_port_name());
 
-        for (typename common::Links < Time,
-                                      SchedulerHandle >::const_iterator it_r =
+        for (typename common::Links < Time >::const_iterator it_r =
                  result.first; it_r != result.second; ++it_r) {
             it_r->second.get_model()->post_event(
-                t, common::ExternalEvent < Time, SchedulerHandle >(it_r->second,
+                t, common::ExternalEvent < Time >(it_r->second,
                                          event.get_content()));
         }
     }
 
 private:
-    common::Links < Time, SchedulerHandle >        _link_list;
-    common::Models < Time, SchedulerHandle >       _child_list;
-    common::Coordinator < Time, SchedulerHandle >* _coordinator;
+    common::Links < Time >        _link_list;
+    common::Models < Time >       _child_list;
+    common::Coordinator < Time >* _coordinator;
 };
 
 } } // namespace paradevs dtss

+ 7 - 10
src/paradevs/kernel/dtss/Simulator.hpp

@@ -37,18 +37,16 @@
 namespace paradevs { namespace dtss {
 
 template < class Time, class Dynamics,
-           class SchedulerHandle =
-               paradevs::common::scheduler::NoSchedulerHandle,
            class Parameters = common::NoParameters >
-class Simulator : public common::Simulator < Time, SchedulerHandle >
+class Simulator : public common::Simulator < Time >
 {
-    typedef Simulator < Time, Dynamics, SchedulerHandle, Parameters > type;
+    typedef Simulator < Time, Dynamics, Parameters > type;
 
 public:
     Simulator(const std::string& name, typename Time::type time_step,
         const Parameters& parameters) :
-        common::Model < Time, SchedulerHandle >(name),
-        common::Simulator < Time, SchedulerHandle >(name),
+        common::Model < Time >(name),
+        common::Simulator < Time >(name),
         _dynamics(name, parameters),
         _time_step(time_step)
     { }
@@ -100,13 +98,13 @@ public:
 #endif
 
         if (t == type::_tn) {
-            common::Bag < Time, SchedulerHandle > bag = _dynamics.lambda(t);
+            common::Bag < Time > bag = _dynamics.lambda(t);
 
             if (not bag.empty()) {
                 for (auto & event : bag) {
                     event.set_model(this);
                 }
-                dynamic_cast < common::Coordinator < Time, SchedulerHandle >* >(
+                dynamic_cast < common::Coordinator < Time >* >(
                     type::get_parent())->dispatch_events(bag, t);
             }
         }
@@ -121,8 +119,7 @@ public:
     }
 
     void post_event(typename Time::type t,
-                    const common::ExternalEvent < Time,
-                                                  SchedulerHandle >& event)
+                    const common::ExternalEvent < Time >& event)
     {
 
 #ifndef WITH_TRACE

+ 12 - 14
src/paradevs/kernel/pdevs/Coordinator.hpp

@@ -29,6 +29,7 @@
 
 #include <paradevs/common/Coordinator.hpp>
 #include <paradevs/common/Parameters.hpp>
+#include <paradevs/common/Scheduler.hpp>
 #include <paradevs/common/utils/String.hpp>
 #include <paradevs/common/utils/Trace.hpp>
 
@@ -38,14 +39,12 @@
 namespace paradevs { namespace pdevs {
 
 template < class Time,
-           class Scheduler,
-           class SchedulerHandle,
            class GraphManager,
            class Parameters = common::NoParameters,
            class GraphParameters = common::NoParameters >
-class Coordinator : public common::Coordinator < Time, SchedulerHandle >
+class Coordinator : public common::Coordinator < Time >
 {
-    typedef Coordinator < Time, Scheduler, SchedulerHandle, GraphManager,
+    typedef Coordinator < Time, GraphManager,
                           Parameters, GraphParameters > type;
 
 public:
@@ -55,8 +54,8 @@ public:
     Coordinator(const std::string& name,
                 const Parameters& /* parameters */,
                 const GraphParameters& graph_parameters) :
-        common::Model < Time, SchedulerHandle >(name),
-        common::Coordinator < Time, SchedulerHandle >(name),
+        common::Model < Time >(name),
+        common::Coordinator < Time >(name),
         _graph_manager(this, graph_parameters)
     { }
 
@@ -128,7 +127,7 @@ public:
 
         assert(t == type::_tn);
 
-        common::Models < Time, SchedulerHandle > IMM =
+        common::Models < Time > IMM =
             _event_table.get_current_models(t);
 
 #ifdef WITH_TRACE
@@ -179,7 +178,7 @@ public:
 
         assert(t >= type::_tl and t <= type::_tn);
 
-        common::Models < Time, SchedulerHandle > receivers =
+        common::Models < Time > receivers =
             _event_table.get_current_models(t);
 
         add_models_with_inputs(receivers);
@@ -214,8 +213,7 @@ public:
     }
 
     void post_event(typename Time::type t,
-                    const common::ExternalEvent < Time,
-                                                  SchedulerHandle >& event)
+                    const common::ExternalEvent < Time >& event)
     {
 
 #ifdef WITH_TRACE
@@ -245,7 +243,7 @@ public:
  * when y-message(y_d, t) with output y_d from d
  *******************************************************************/
     typename Time::type dispatch_events(
-        common::Bag < Time, SchedulerHandle > bag, typename Time::type t)
+        common::Bag < Time > bag, typename Time::type t)
     {
 
 #ifdef WITH_TRACE
@@ -282,7 +280,7 @@ public:
     }
 
     void add_models_with_inputs(
-        common::Models < Time, SchedulerHandle >& receivers)
+        common::Models < Time >& receivers)
     {
         for (auto & model : _graph_manager.children()) {
             if (model->event_number() > 0) {
@@ -304,8 +302,8 @@ public:
     }
 
 protected:
-    GraphManager _graph_manager;
-    Scheduler    _event_table;
+    GraphManager          _graph_manager;
+    common::SchedulerType _event_table;
 };
 
 } } // namespace paradevs pdevs

+ 5 - 5
src/paradevs/kernel/pdevs/Dynamics.hpp

@@ -36,7 +36,7 @@
 
 namespace paradevs { namespace pdevs {
 
-template < class Time, class SchedulerHandle,
+template < class Time,
            class Parameters = common::NoParameters >
 class Dynamics
 {
@@ -50,7 +50,7 @@ public:
 
     virtual void dconf(typename Time::type /* t */,
                        typename Time::type /* e */,
-                       const common::Bag < Time, SchedulerHandle >& /* bag */)
+                       const common::Bag < Time >& /* bag */)
     { }
 
     virtual void dint(typename Time::type /* t */)
@@ -58,7 +58,7 @@ public:
 
     virtual void dext(typename Time::type /* t */,
                       typename Time::type /* e */,
-                      const common::Bag < Time, SchedulerHandle >& /* bag */)
+                      const common::Bag < Time >& /* bag */)
     { }
 
     virtual typename Time::type start(typename Time::type /* time */)
@@ -67,9 +67,9 @@ public:
     virtual typename Time::type ta(typename Time::type /* time */) const
     { return Time::infinity; }
 
-    virtual common::Bag < Time, SchedulerHandle > lambda(
+    virtual common::Bag < Time > lambda(
         typename Time::type /* time */) const
-    { return common::Bag < Time, SchedulerHandle >(); }
+    { return common::Bag < Time >(); }
 
     virtual void observation(std::ostream& /* file */) const
     { }

+ 28 - 35
src/paradevs/kernel/pdevs/GraphManager.hpp

@@ -37,12 +37,12 @@
 
 namespace paradevs { namespace pdevs {
 
-template < class Time, class SchedulerHandle,
+template < class Time,
            class GraphParameters = common::NoParameters >
 class GraphManager
 {
 public:
-    GraphManager(common::Coordinator < Time, SchedulerHandle >* coordinator,
+    GraphManager(common::Coordinator < Time >* coordinator,
                  const GraphParameters& /* parameters */) :
         _coordinator(coordinator)
     { }
@@ -50,15 +50,15 @@ public:
     virtual ~GraphManager()
     { }
 
-    void add_child(common::Model < Time, SchedulerHandle >* child)
+    void add_child(common::Model < Time >* child)
     {
         _child_list.push_back(child);
         child->set_parent(_coordinator);
     }
 
-    void add_link(common::Model < Time, SchedulerHandle >* src_model,
+    void add_link(common::Model < Time >* src_model,
                   const std::string& src_port_name,
-                  common::Model < Time, SchedulerHandle >* dst_model,
+                  common::Model < Time >* dst_model,
                   const std::string& dst_port_name)
     {
         assert((src_model != _coordinator and
@@ -77,69 +77,62 @@ public:
         _link_list.add(src_model, src_port_name, dst_model, dst_port_name);
     }
 
-    const common::Models < Time, SchedulerHandle >& children() const
+    const common::Models < Time >& children() const
     { return _child_list; }
 
-    void dispatch_events(common::Bag < Time, SchedulerHandle > bag,
+    void dispatch_events(common::Bag < Time > bag,
                          typename Time::type t)
     {
         for (auto & ymsg : bag) {
-            typename common::Links < Time,
-                                     SchedulerHandle >::Result result_model =
+            typename common::Links < Time >::Result result_model =
                 _link_list.find(ymsg.get_model(),
                                 ymsg.get_port_name());
 
-            for (typename common::Links < Time, SchedulerHandle >::
+            for (typename common::Links < Time >::
                      const_iterator it = result_model.first;
                      it != result_model.second; ++it) {
                 // event on output port of coupled Model
                 if (it->second.get_model() == _coordinator) {
-                    common::Bag < Time, SchedulerHandle > ymessages;
+                    common::Bag < Time > ymessages;
 
                     ymessages.push_back(
-                        common::ExternalEvent <
-                            Time, SchedulerHandle >(it->second,
-                                                    ymsg.get_content()));
-                    dynamic_cast < common::Coordinator <
-                        Time,  SchedulerHandle >* >(
-                            _coordinator->get_parent())->dispatch_events(
-                                ymessages, t);
+                        common::ExternalEvent <Time >(it->second,
+                                                      ymsg.get_content()));
+                    dynamic_cast < common::Coordinator < Time >* >(
+                        _coordinator->get_parent())->dispatch_events(
+                            ymessages, t);
                 } else { // event on input port of internal model
                     it->second.get_model()->post_event(
-                        t, common::ExternalEvent <
-                            Time,  SchedulerHandle >(
-                                it->second, ymsg.get_content()));
+                        t, common::ExternalEvent < Time >(
+                            it->second, ymsg.get_content()));
                 }
             }
         }
     }
 
-    bool exist_link(common::Model < Time, SchedulerHandle >* src_model,
+    bool exist_link(common::Model < Time >* src_model,
                     const std::string& src_port_name,
-                    common::Model < Time, SchedulerHandle >* dst_model,
+                    common::Model < Time >* dst_model,
                     const std::string& dst_port_name) const
     {
         return _link_list.exist(src_model, src_port_name, dst_model,
                                 dst_port_name);
     }
 
-    common::Coordinator < Time, SchedulerHandle >* get_coordinator() const
+    common::Coordinator < Time >* get_coordinator() const
     { return _coordinator; }
 
     void post_event(typename Time::type t,
-                    const common::ExternalEvent < Time,
-                                                  SchedulerHandle >& event)
+                    const common::ExternalEvent < Time >& event)
     {
-        typename common::Links < Time, SchedulerHandle >::Result result =
+        typename common::Links < Time >::Result result =
             _link_list.find(_coordinator, event.get_port_name());
 
-        for (typename common::Links < Time,
-                                      SchedulerHandle >::const_iterator it_r =
+        for (typename common::Links < Time >::const_iterator it_r =
                  result.first; it_r != result.second; ++it_r) {
                  it_r->second.get_model()->post_event(
-                     t, common::ExternalEvent <
-                         Time, SchedulerHandle >(it_r->second,
-                                                 event.get_content()));
+                     t, common::ExternalEvent < Time >(it_r->second,
+                                                       event.get_content()));
         }
     }
 
@@ -156,9 +149,9 @@ public:
     }
 
 private:
-    common::Links < Time, SchedulerHandle >        _link_list;
-    common::Models < Time, SchedulerHandle >       _child_list;
-    common::Coordinator < Time, SchedulerHandle >* _coordinator;
+    common::Links < Time >        _link_list;
+    common::Models < Time >       _child_list;
+    common::Coordinator < Time >* _coordinator;
 };
 
 } } // namespace paradevs pdevs

+ 8 - 9
src/paradevs/kernel/pdevs/Simulator.hpp

@@ -37,16 +37,16 @@
 
 namespace paradevs { namespace pdevs {
 
-template < class Time, class Dynamics, class SchedulerHandle,
+template < class Time, class Dynamics,
            class Parameters = common::NoParameters >
-class Simulator : public common::Simulator < Time, SchedulerHandle >
+class Simulator : public common::Simulator < Time >
 {
-    typedef Simulator < Time, Dynamics, SchedulerHandle, Parameters > type;
+    typedef Simulator < Time, Dynamics, Parameters > type;
 
 public :
     Simulator(const std::string& name, const Parameters& parameters) :
-        common::Model < Time, SchedulerHandle >(name),
-        common::Simulator < Time, SchedulerHandle >(name),
+        common::Model < Time >(name),
+        common::Simulator < Time >(name),
         _dynamics(name, parameters)
     { }
 
@@ -117,13 +117,13 @@ public :
 #endif
 
         if(t == type::_tn) {
-            common::Bag < Time, SchedulerHandle > bag = _dynamics.lambda(t);
+            common::Bag < Time > bag = _dynamics.lambda(t);
 
             if (not bag.empty()) {
                 for (auto & event : bag) {
                     event.set_model(this);
                 }
-                dynamic_cast < common::Coordinator < Time, SchedulerHandle >* >(
+                dynamic_cast < common::Coordinator < Time >* >(
                     type::get_parent())->dispatch_events(bag, t);
             }
         }
@@ -138,8 +138,7 @@ public :
     }
 
     void post_event(typename Time::type t,
-                    const common::ExternalEvent < Time,
-                                                  SchedulerHandle >& event)
+                    const common::ExternalEvent < Time >& event)
     {
 
 #ifndef WITH_TRACE

+ 16 - 23
src/paradevs/kernel/pdevs/multithreading/Coordinator.hpp

@@ -52,59 +52,52 @@ struct transition_message
     typename Time::type _t;
 };
 
-template < class Time, class SchedulerHandle >
+template < class Time >
 struct done_start_message
 {
     explicit done_start_message(typename Time::type tn,
-                                common::Model < Time,
-                                                SchedulerHandle >* child) :
+                                common::Model < Time >* child) :
         _tn(tn), _child(child)
     { }
 
-    typename Time::type                      _tn;
-    common::Model < Time, SchedulerHandle >* _child;
+    typename Time::type     _tn;
+    common::Model < Time >* _child;
 };
 
-template < class Time, class SchedulerHandle >
+template < class Time >
 struct done_transition_message
 {
     explicit done_transition_message(typename Time::type tn,
-                                     common::Model < Time,
-                                                     SchedulerHandle >* child) :
+                                     common::Model < Time >* child) :
         _tn(tn), _child(child)
     { }
 
-    typename Time::type                      _tn;
-    common::Model < Time, SchedulerHandle >* _child;
+    typename Time::type     _tn;
+    common::Model < Time >* _child;
 };
 
 template < class Time,
-           class Scheduler,
-           class SchedulerHandle,
            class GraphManager,
            class Parameters = common::NoParameters,
            class GraphParameters = common::NoParameters >
-class Coordinator : public pdevs::Coordinator < Time, Scheduler,
-                                                SchedulerHandle, GraphManager,
+class Coordinator : public pdevs::Coordinator < Time, GraphManager,
                                                 Parameters, GraphParameters >
 {
-    typedef pdevs::Coordinator < Time, Scheduler, SchedulerHandle, GraphManager,
+    typedef pdevs::Coordinator < Time, GraphManager,
                                  Parameters, GraphParameters > parent_type;
-    typedef Coordinator < Time, Scheduler, SchedulerHandle, GraphManager,
+    typedef Coordinator < Time, GraphManager,
                           Parameters, GraphParameters > type;
-    typedef done_start_message < Time,
-                                 SchedulerHandle > done_start_message_type;
+    typedef done_start_message < Time > done_start_message_type;
     typedef start_message < Time > start_message_type;
-    typedef done_transition_message < Time,
-                                 SchedulerHandle > done_transition_message_type;
+    typedef done_transition_message < Time > done_transition_message_type;
     typedef transition_message < Time > transition_message_type;
 
 public:
     Coordinator(const std::string& name,
                 const Parameters& parameters,
                 const GraphParameters& graph_parameters) :
-        common::Model < Time, SchedulerHandle >(name),
-        pdevs::Coordinator < Time, Scheduler, SchedulerHandle, GraphManager,
+        common::Model < Time >(name),
+        pdevs::Coordinator < Time, GraphManager,
                              Parameters, GraphParameters >(name, parameters,
                                                            graph_parameters),
         _thread(std::thread([&]{ loop(); }))
@@ -196,7 +189,7 @@ public:
     {
         assert(t >= type::_tl and t <= type::_tn);
 
-        common::Models < Time, SchedulerHandle > receivers =
+        common::Models < Time > receivers =
             type::_event_table.get_current_models(t);
 
         type::add_models_with_inputs(receivers);

+ 11 - 13
src/paradevs/kernel/sss/Coordinator.hpp

@@ -49,12 +49,12 @@ public:
 };
 
 template < class Time, class Policy, class GraphManager,
-           class SchedulerHandle, class Parameters = Parameters < Time >,
+           class Parameters = Parameters < Time >,
            class GraphParameters = common::NoParameters >
-class Coordinator : public common::Coordinator < Time, SchedulerHandle >,
-                    public sss::Model < Time, SchedulerHandle >
+class Coordinator : public common::Coordinator < Time >,
+                    public sss::Model < Time >
 {
-    typedef Coordinator < Time, Policy, GraphManager, SchedulerHandle,
+    typedef Coordinator < Time, Policy, GraphManager,
                           Parameters, GraphParameters > type;
 
 public:
@@ -64,9 +64,9 @@ public:
     Coordinator(const std::string& name,
                 const Parameters& parameters,
                 const GraphParameters& graph_paramaters) :
-        common::Model < Time, SchedulerHandle >(name),
-        common::Coordinator < Time, SchedulerHandle >(name),
-        sss::Model < Time, SchedulerHandle >(name),
+        common::Model < Time >(name),
+        common::Coordinator < Time >(name),
+        sss::Model < Time >(name),
         _graph_manager(this, graph_paramaters),
         _time_step(parameters._time_step)
     { }
@@ -75,10 +75,10 @@ public:
     { }
 
     virtual bool is_atomic() const
-    { return common::Coordinator < Time, SchedulerHandle >::is_atomic(); }
+    { return common::Coordinator < Time >::is_atomic(); }
 
     virtual std::string to_string(int level) const
-    { return common::Coordinator < Time, SchedulerHandle >::to_string(level); }
+    { return common::Coordinator < Time >::to_string(level); }
 
     typename Time::type start(typename Time::type t)
     {
@@ -92,8 +92,7 @@ public:
         return type::_tn;
     }
 
-    typename Time::type dispatch_events(common::Bag < Time,
-                                                      SchedulerHandle > bag,
+    typename Time::type dispatch_events(common::Bag < Time > bag,
                                         typename Time::type t)
     {
         _graph_manager.dispatch_events(bag, t);
@@ -123,8 +122,7 @@ public:
     }
 
     void post_event(typename Time::type t,
-                    const common::ExternalEvent < Time,
-                                                  SchedulerHandle >& event)
+                    const common::ExternalEvent < Time >& event)
     {
         if (t == type::_tn) {
             _graph_manager.post_event(t, event);

+ 3 - 5
src/paradevs/kernel/sss/Dynamics.hpp

@@ -34,7 +34,6 @@
 namespace paradevs { namespace sss {
 
 template < class Time,
-           class SchedulerHandle = common::scheduler::NoSchedulerHandle,
            class Parameters = common::NoParameters >
 class Dynamics
 {
@@ -46,17 +45,16 @@ public:
     virtual ~Dynamics()
     { }
 
-    virtual void transition(const common::Bag < Time,
-                                                SchedulerHandle >& /* x */,
+    virtual void transition(const common::Bag < Time >& /* x */,
                             typename Time::type /* t */)
     { }
 
     virtual typename Time::type start(typename Time::type/* time */)
     { return Time::infinity; }
 
-    common::Bag < Time, SchedulerHandle > lambda(
+    common::Bag < Time > lambda(
         typename Time::type /* time */) const
-    { return common::Bag < Time, SchedulerHandle >(); }
+    { return common::Bag < Time >(); }
 
     virtual void observation(std::ostream& /* file */) const
     { }

+ 19 - 28
src/paradevs/kernel/sss/GraphManager.hpp

@@ -30,20 +30,17 @@
 #include <paradevs/common/Coordinator.hpp>
 #include <paradevs/common/Links.hpp>
 #include <paradevs/common/Parameters.hpp>
-#include <paradevs/common/scheduler/SchedulerHandle.hpp>
 
 #include <paradevs/kernel/sss/Model.hpp>
 
 namespace paradevs { namespace sss {
 
 template < class Time,
-           class SchedulerHandle =
-               paradevs::common::scheduler::NoSchedulerHandle,
            class GraphParameters = common::NoParameters >
 class GraphManager
 {
 public:
-    GraphManager(common::Coordinator < Time, SchedulerHandle >* coordinator,
+    GraphManager(common::Coordinator < Time >* coordinator,
                  const GraphParameters& /* parameters */) :
         _coordinator(coordinator)
     { }
@@ -51,15 +48,15 @@ public:
     virtual ~GraphManager()
     { }
 
-    void add_child(sss::Model < Time, SchedulerHandle >* child)
+    void add_child(sss::Model < Time >* child)
     {
         _child_list.push_back(child);
         child->set_parent(_coordinator);
     }
 
-    void add_link(common::Model < Time, SchedulerHandle >* src_model,
+    void add_link(common::Model < Time >* src_model,
                   const std::string& src_port_name,
-                  common::Model < Time, SchedulerHandle >* dst_model,
+                  common::Model < Time >* dst_model,
                   const std::string& dst_port_name)
     {
         assert((src_model != _coordinator and
@@ -78,37 +75,33 @@ public:
         _link_list.add(src_model, src_port_name, dst_model, dst_port_name);
     }
 
-    const sss::Models < Time, SchedulerHandle >& children() const
+    const sss::Models < Time >& children() const
     { return _child_list; }
 
-    void dispatch_events(common::Bag < Time, SchedulerHandle > bag,
+    void dispatch_events(common::Bag < Time > bag,
                          typename Time::type t)
     {
         for (auto & ymsg : bag) {
-            typename common::Links < Time,
-                                     SchedulerHandle >::Result result_model =
+            typename common::Links < Time >::Result result_model =
                 _link_list.find(ymsg.get_model(),
                                 ymsg.get_port_name());
 
-            for (typename common::Links < Time,
-                                          SchedulerHandle >::const_iterator it =
+            for (typename common::Links < Time >::const_iterator it =
                      result_model.first; it != result_model.second; ++it) {
                 // event on output port of coupled model
                 if (it->second.get_model() == _coordinator) {
-                    common::Bag < Time, SchedulerHandle > ymessages;
+                    common::Bag < Time > ymessages;
 
                     ymessages.push_back(
-                        common::ExternalEvent < Time,
-                                                SchedulerHandle >(
+                        common::ExternalEvent < Time >(
                                                     it->second,
                                                     ymsg.get_content()));
                     dynamic_cast < common::Coordinator <
-                        Time, SchedulerHandle >* >(_coordinator->get_parent())
+                        Time >* >(_coordinator->get_parent())
                         ->dispatch_events(ymessages, t);
                 } else { // event on input port of internal model
                     it->second.get_model()->post_event(
-                        t, common::ExternalEvent < Time,
-                                                   SchedulerHandle >(
+                        t, common::ExternalEvent < Time >(
                                                        it->second,
                                                        ymsg.get_content()));
                 }
@@ -117,25 +110,23 @@ public:
     }
 
     void post_event(typename Time::type t,
-                    const common::ExternalEvent < Time,
-                                                  SchedulerHandle >& event)
+                    const common::ExternalEvent < Time >& event)
     {
-        typename common::Links < Time, SchedulerHandle >::Result result =
+        typename common::Links < Time >::Result result =
             _link_list.find(_coordinator, event.get_port_name());
 
-        for (typename common::Links < Time,
-                                      SchedulerHandle >::const_iterator it_r =
+        for (typename common::Links < Time >::const_iterator it_r =
                  result.first; it_r != result.second; ++it_r) {
             it_r->second.get_model()->post_event(
-                t, common::ExternalEvent < Time, SchedulerHandle >(it_r->second,
+                t, common::ExternalEvent < Time >(it_r->second,
                                          event.get_content()));
         }
     }
 
 private:
-    common::Links < Time, SchedulerHandle >        _link_list;
-    sss::Models < Time, SchedulerHandle >          _child_list;
-    common::Coordinator < Time, SchedulerHandle >* _coordinator;
+    common::Links < Time >        _link_list;
+    sss::Models < Time >          _child_list;
+    common::Coordinator < Time >* _coordinator;
 };
 
 } } // namespace paradevs sss

+ 12 - 12
src/paradevs/kernel/sss/Model.hpp

@@ -31,12 +31,12 @@
 
 namespace paradevs { namespace sss {
 
-template < class Time, class SchedulerHandle >
-class Model : public virtual common::Model < Time, SchedulerHandle >
+template < class Time >
+class Model : public virtual common::Model < Time >
 {
 public:
     Model(const std::string& name) :
-        common::Model < Time, SchedulerHandle >(name)
+        common::Model < Time >(name)
     {
         assigned = 0;
         _mark = false;
@@ -48,10 +48,10 @@ public:
 
     virtual void update_buffer(typename Time::type /* time */) = 0;
 
-    void add_event(const common::ExternalEvent < Time, SchedulerHandle >&
+    void add_event(const common::ExternalEvent < Time >&
                    message)
     {
-        common::Model < Time, SchedulerHandle >::add_event(message);
+        common::Model < Time >::add_event(message);
         std::map < std::string, bool >::iterator it =
             port_assigned.find(message.get_port_name());
 
@@ -63,7 +63,7 @@ public:
 
     void add_in_port(const std::string& port_name, bool sync)
     {
-        common::Model < Time, SchedulerHandle >::add_in_port(port_name);
+        common::Model < Time >::add_in_port(port_name);
         if (sync) {
             port_assigned[port_name] = false;
         }
@@ -74,7 +74,7 @@ public:
 
     void clear_bag()
     {
-        common::Model < Time, SchedulerHandle >::clear_bag();
+        common::Model < Time >::clear_bag();
 
         for (auto & p: port_assigned) {
             p.second = false;
@@ -107,8 +107,8 @@ private:
     bool _send;
 };
 
-template < class Time, class SchedulerHandle >
-class Models : public std::vector < sss::Model < Time, SchedulerHandle >* >
+template < class Time >
+class Models : public std::vector < sss::Model < Time >* >
 {
 public:
     Models()
@@ -121,9 +121,9 @@ public:
         std::ostringstream ss;
 
         ss << "{ ";
-        for (typename Models < Time, SchedulerHandle >::const_iterator it =
-                 Models < Time, SchedulerHandle >::begin();
-             it != Models < Time, SchedulerHandle >::end(); ++it) {
+        for (typename Models < Time >::const_iterator it =
+                 Models < Time >::begin();
+             it != Models < Time >::end(); ++it) {
             ss << (*it)->get_name() << " ";
         }
         ss << "}";

+ 11 - 14
src/paradevs/kernel/sss/Simulator.hpp

@@ -39,20 +39,18 @@
 namespace paradevs { namespace sss {
 
 template < class Time, class Dynamics,
-           class SchedulerHandle =
-               paradevs::common::scheduler::NoSchedulerHandle,
            class Parameters = common::NoParameters >
-class Simulator : public common::Simulator < Time, SchedulerHandle >,
-                  public sss::Model < Time, SchedulerHandle >
+class Simulator : public common::Simulator < Time >,
+                  public sss::Model < Time >
 {
-    typedef Simulator < Time, Dynamics, SchedulerHandle, Parameters > type;
+    typedef Simulator < Time, Dynamics, Parameters > type;
 
 public:
     Simulator(const std::string& name, typename Time::type time_step,
         const Parameters& parameters) :
-        common::Model < Time, SchedulerHandle >(name),
-        common::Simulator < Time, SchedulerHandle >(name),
-        sss::Model < Time, SchedulerHandle >(name),
+        common::Model < Time >(name),
+        common::Simulator < Time >(name),
+        sss::Model < Time >(name),
         _dynamics(name, parameters),
         _time_step(time_step)
     { }
@@ -61,10 +59,10 @@ public:
     {  }
 
     virtual bool is_atomic() const
-    { return common::Simulator < Time, SchedulerHandle >::is_atomic(); }
+    { return common::Simulator < Time >::is_atomic(); }
 
     virtual std::string to_string(int level) const
-    { return common::Simulator < Time, SchedulerHandle >::to_string(level); }
+    { return common::Simulator < Time >::to_string(level); }
 
     typename Time::type start(typename Time::type t)
     {
@@ -110,13 +108,13 @@ public:
 #endif
 
         if (t == type::_tn) {
-            common::Bag < Time, SchedulerHandle > bag = _dynamics.lambda(t);
+            common::Bag < Time > bag = _dynamics.lambda(t);
 
             if (not bag.empty()) {
                 for (auto & event : bag) {
                     event.set_model(this);
                 }
-                dynamic_cast < common::Coordinator < Time, SchedulerHandle >* >(
+                dynamic_cast < common::Coordinator < Time >* >(
                     type::get_parent())->dispatch_events(bag, t);
             }
         }
@@ -131,8 +129,7 @@ public:
     }
 
     void post_event(typename Time::type t,
-                    const common::ExternalEvent < Time,
-                                                  SchedulerHandle >& event)
+                    const common::ExternalEvent < Time >& event)
     {
 
 #ifndef WITH_TRACE