Quellcode durchsuchen

Add GraphManager class and introduce more templates

Eric Ramat vor 11 Jahren
Ursprung
Commit
58a1783538

+ 0 - 14
src/apps/main.cpp

@@ -24,21 +24,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-// #include <devs/RootCoordinator.hpp>
-// #include <tests/devs_examples.hpp>
-
-// using namespace paradevs;
-
-// void devs_examples()
-// {
-//     devs::MyBuilder builder;
-//     devs::RootCoordinator rc(0, 10, builder);
-
-//     rc.run();
-// }
-
 int main()
 {
-    // devs_examples();
     return 0;
 }

+ 2 - 2
src/common/CMakeLists.txt

@@ -9,10 +9,10 @@ LINK_DIRECTORIES(
   ${GLIBMM_LIBRARY_DIRS}
   ${LIBXML_LIBRARY_DIR})
 
-SET(COMMON_CPP Bag.cpp Builder.cpp EventTable.cpp ExternalEvent.cpp
+SET(COMMON_CPP Bag.cpp EventTable.cpp ExternalEvent.cpp
   InternalEvent.cpp Links.cpp Model.cpp Node.cpp RootCoordinator.cpp Trace.cpp)
 
-SET(COMMON_HPP Bag.hpp Builder.hpp EventTable.hpp ExternalEvent.hpp
+SET(COMMON_HPP Bag.hpp EventTable.hpp ExternalEvent.hpp
   InternalEvent.hpp Links.hpp Node.hpp RootCoordinator.hpp Time.hpp Trace.cpp)
 
 ADD_LIBRARY(common SHARED ${COMMON_CPP};${COMMON_HPP})

+ 1 - 0
src/common/Coordinator.hpp

@@ -47,6 +47,7 @@ public :
     { }
 
 // DEVS methods
+    virtual void observation(std::ostream& file) const =0;
     virtual void output(common::Time t) =0;
     virtual void post_event(common::Time t,
                             const common::ExternalEvent& event) =0;

+ 1 - 1
src/common/Links.cpp

@@ -37,7 +37,7 @@ void Links::add(Model* out_model, const std::string& out_port_name,
                                     Node(in_model, in_port_name)));
 }
 
-Links::Result Links::find(Model* out_model, const std::string& out_port_name)
+Links::Result Links::find(Model* out_model, const std::string& out_port_name) const
 {
     return equal_range(common::Node(out_model, out_port_name));
 }

+ 3 - 3
src/common/Links.hpp

@@ -39,8 +39,8 @@ class Links : public std::multimap < Node, Node >
 {
 public:
 
-    typedef std::pair < common::Links::iterator,
-                        common::Links::iterator > Result;
+    typedef std::pair < common::Links::const_iterator,
+                        common::Links::const_iterator > Result;
 
     Links()
     { }
@@ -50,7 +50,7 @@ public:
     void add(Model* out_model, const std::string& out_port_name,
              Model* in_model, const std::string& in_port_name);
 
-    Result find(Model* out_model, const std::string& out_port_name);
+    Result find(Model* out_model, const std::string& out_port_name) const;
 
     std::string to_string() const;
 };

+ 0 - 19
src/common/RootCoordinator.cpp

@@ -28,23 +28,4 @@
 
 namespace paradevs { namespace common {
 
-RootCoordinator::RootCoordinator(const common::Time& t_start,
-                                 const common::Time& t_max,
-                                 const common::Builder& builder) :
-    _root(dynamic_cast < common::Coordinator* >(builder.build())),
-    _t_max(t_max), _tn(t_start)
-{ }
-
-RootCoordinator::~RootCoordinator()
-{ delete _root; }
-
-void RootCoordinator::run()
-{
-    _tn = _root->start(_tn);
-    while (_tn <= _t_max) {
-        _root->output(_tn);
-        _tn = _root->transition(_tn);
-    }
-}
-
 } } // namespace paradevs common

+ 22 - 8
src/common/RootCoordinator.hpp

@@ -27,25 +27,39 @@
 #ifndef COMMON_ROOT_COORDINATOR
 #define COMMON_ROOT_COORDINATOR 1
 
-#include <common/Builder.hpp>
-#include <common/Coordinator.hpp>
+#include <common/Time.hpp>
+
+#include <string>
 
 namespace paradevs { namespace common {
 
+template < class Coordinator >
 class RootCoordinator
 {
 public :
     RootCoordinator(const common::Time& t_start, const common::Time& t_max,
-                    const common::Builder& builder);
-    virtual ~RootCoordinator();
+                    const std::string& root_name,
+                    const typename Coordinator::parameters_type& parameters) :
+        _root(root_name, parameters), _t_max(t_max), _tn(t_start)
+    { }
+
+    virtual ~RootCoordinator()
+    { }
 
-    void run();
+    void run()
+    {
+        _tn = _root.start(_tn);
+        while (_tn <= _t_max) {
+            _root.output(_tn);
+            _tn = _root.transition(_tn);
+        }
+    }
 
 private :
-    common::Coordinator* _root;
-    common::Time         _t_max;
+    Coordinator  _root;
+    common::Time _t_max;
 
-    common::Time         _tn;
+    common::Time _tn;
 };
 
 } } // namespace paradevs common

+ 2 - 2
src/dtss/CMakeLists.txt

@@ -9,9 +9,9 @@ LINK_DIRECTORIES(
   ${GLIBMM_LIBRARY_DIRS}
   ${LIBXML_LIBRARY_DIR})
 
-SET(DTSS_CPP Coordinator.cpp Dynamics.cpp Simulator.cpp)
+SET(DTSS_CPP Coordinator.cpp Dynamics.cpp GraphManager.cpp Simulator.cpp)
 
-SET(DTSS_HPP Coordinator.hpp Dynamics.hpp Simulator.hpp)
+SET(DTSS_HPP Coordinator.hpp Dynamics.hpp GraphManager.hpp Simulator.hpp)
 
 ADD_LIBRARY(dtss SHARED ${DTSS_CPP};${DTSS_HPP})
 

+ 26 - 33
src/dtss/Coordinator.hpp

@@ -42,27 +42,34 @@
 
 namespace paradevs { namespace dtss {
 
-template < class Policy >
+class Parameters
+{
+public:
+    Parameters(paradevs::common::Time time_step) : _time_step(time_step)
+    { }
+
+    paradevs::common::Time _time_step;
+};
+
+template < class Policy, class GraphManager >
 class Coordinator : public common::Coordinator
 {
 public:
-    Coordinator(const std::string& name, common::Time time_step) :
-        common::Coordinator(name), _time_step(time_step)
+    typedef Parameters parameters_type;
+
+    Coordinator(const std::string& name, const Parameters& parameters) :
+        common::Coordinator(name), _graph_manager(this),
+        _time_step(parameters._time_step)
     { }
 
     virtual ~Coordinator()
-    {
-        for (auto & child : _child_list) {
-            delete child;
-        }
-    }
+    { }
 
-// DEVS methods
     common::Time start(common::Time t)
     {
-        assert(_child_list.size() > 0);
+        assert(_graph_manager.children().size() > 0);
 
-        for (auto & child : _child_list) {
+        for (auto & child : _graph_manager.children()) {
             child->start(_tn);
         }
         _tl = t;
@@ -74,9 +81,9 @@ public:
     {
         for (auto & ymsg : bag) {
             common::Links::Result result_model =
-                _link_list.find(ymsg.get_model(), ymsg.get_port_name());
+                _graph_manager.links().find(ymsg.get_model(), ymsg.get_port_name());
 
-            for (common::Links::iterator it = result_model.first;
+            for (common::Links::const_iterator it = result_model.first;
                  it != result_model.second; ++it) {
                 // event on output port of coupled model
                 if (it->second.get_model() == this) {
@@ -98,7 +105,7 @@ public:
 
     void observation(std::ostream& file) const
     {
-        for (auto & child : _child_list) {
+        for (auto & child : _graph_manager.children()) {
             child->observation(file);
         }
     }
@@ -106,7 +113,7 @@ public:
     void output(common::Time t)
     {
         if (t == _tn) {
-            for (auto & model : _child_list) {
+            for (auto & model : _graph_manager.children()) {
                 model->output(t);
             }
         }
@@ -117,9 +124,9 @@ public:
     {
         if (t == _tn) {
             common::Links::Result result =
-                _link_list.find(this, event.get_port_name());
+                _graph_manager.links().find(this, event.get_port_name());
 
-            for (common::Links::iterator it_r = result.first;
+            for (common::Links::const_iterator it_r = result.first;
                  it_r != result.second; ++it_r) {
                 it_r->second.get_model()->post_event(
                     t, common::ExternalEvent(it_r->second,
@@ -136,7 +143,7 @@ public:
             for (auto & event : _policy.bag()) {
                 post_event(t, event);
             }
-            for (auto & model : _child_list) {
+            for (auto & model : _graph_manager.children()) {
                 model->transition(t);
             }
             _tl = t;
@@ -146,22 +153,8 @@ public:
         return _tn;
     }
 
-// graph methods
-    void add_child(Model* child)
-    {
-        _child_list.push_back(child);
-        child->set_parent(this);
-    }
-
-    void add_link(Model* out_model, const std::string& out_port_name,
-                  Model* in_model, const std::string& in_port_name)
-    {
-        _link_list.add(out_model, out_port_name, in_model, in_port_name);
-    }
-
 private:
-    common::Links  _link_list;
-    common::Models _child_list;
+    GraphManager   _graph_manager;
     common::Time   _time_step;
     Policy         _policy;
 };

+ 24 - 7
src/common/Builder.cpp

@@ -1,5 +1,5 @@
 /**
- * @file Builder.cpp
+ * @file GraphManager.cpp
  * @author The PARADEVS Development Team
  * See the AUTHORS or Authors.txt file
  */
@@ -24,14 +24,31 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <common/Builder.hpp>
+#include <dtss/GraphManager.hpp>
 
-namespace paradevs { namespace common {
+namespace paradevs { namespace dtss {
 
-Builder::Builder()
+GraphManager::GraphManager(common::Coordinator* coordinator) :
+    _coordinator(coordinator)
 { }
 
-Builder::~Builder()
-{ }
+GraphManager::~GraphManager()
+{
+    for (auto & child : _child_list) {
+        delete child;
+    }
+}
+
+void GraphManager::add_child(common::Model* child)
+{
+    _child_list.push_back(child);
+    child->set_parent(_coordinator);
+}
+
+void GraphManager::add_link(common::Model* out_model, const std::string& out_port_name,
+                            common::Model* in_model, const std::string& in_port_name)
+{
+    _link_list.add(out_model, out_port_name, in_model, in_port_name);
+}
 
-} } // namespace paradevs common
+} } // namespace paradevs dtss

+ 58 - 0
src/dtss/GraphManager.hpp

@@ -0,0 +1,58 @@
+/**
+ * @file GraphManager.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 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 DTSS_GRAPH_MANANGER
+#define DTSS_GRAPH_MANANGER 1
+
+#include <common/Coordinator.hpp>
+#include <common/Links.hpp>
+#include <common/Model.hpp>
+
+namespace paradevs { namespace dtss {
+
+class GraphManager
+{
+public:
+    GraphManager(common::Coordinator* coordinator);
+    virtual ~GraphManager();
+
+    virtual void add_child(common::Model* child);
+    virtual void add_link(common::Model* out_model, const std::string& out_port_name,
+                          common::Model* in_model, const std::string& in_port_name);
+    const common::Models& children() const
+    { return _child_list; }
+    const common::Links& links() const
+    { return _link_list; }
+
+private:
+    common::Links        _link_list;
+    common::Models       _child_list;
+    common::Coordinator* _coordinator;
+};
+
+} } // namespace paradevs dtss
+
+#endif

+ 2 - 2
src/pdevs/CMakeLists.txt

@@ -9,9 +9,9 @@ LINK_DIRECTORIES(
   ${GLIBMM_LIBRARY_DIRS}
   ${LIBXML_LIBRARY_DIR})
 
-SET(PDEVS_CPP Coordinator.cpp Dynamics.cpp Simulator.cpp)
+SET(PDEVS_CPP Coordinator.cpp Dynamics.cpp GraphManager.cpp Simulator.cpp)
 
-SET(PDEVS_HPP Coordinator.hpp Dynamics.hpp Simulator.hpp)
+SET(PDEVS_HPP Coordinator.hpp Dynamics.hpp GraphManager.hpp Simulator.hpp)
 
 ADD_LIBRARY(pdevs SHARED ${PDEVS_CPP};${PDEVS_HPP})
 

+ 0 - 240
src/pdevs/Coordinator.cpp

@@ -34,244 +34,4 @@
 
 namespace paradevs { namespace pdevs {
 
-Coordinator::Coordinator(const std::string& name) : common::Coordinator(name)
-{ }
-
-Coordinator::~Coordinator()
-{
-    for (auto & child : _child_list) {
-        delete child;
-    }
-}
-
-common::Time Coordinator::start(common::Time t)
-{
-
-    common::Trace::trace() << common::TraceElement(get_name(), t,
-                                                   common::I_MESSAGE)
-                           << ": BEFORE => "
-                           << "tl = " << _tl << " ; tn = " << _tn;
-    common::Trace::trace().flush();
-
-    assert(_child_list.size() > 0);
-
-    for (auto & child : _child_list) {
-        _event_table.init(child->start(_tn), child);
-    }
-    _tl = t;
-    _tn = _event_table.get_current_time();
-
-    common::Trace::trace() << common::TraceElement(get_name(), t,
-                                                   common::I_MESSAGE)
-                           << ": AFTER => "
-                           << "tl = " << _tl << " ; tn = " << _tn;
-    common::Trace::trace().flush();
-
-    return _tn;
-}
-
-/**************************************************
- * when *-message(t)
- *   calculate IMM (models with tn = t in scheduler
- *   calculate INF from IMM
- *   for each e in IMM U INF
- *     calculate influencer
- *   ...
- *  send done to parent
- **************************************************/
-void Coordinator::output(common::Time t)
-{
-
-    common::Trace::trace() << common::TraceElement(get_name(), t,
-                                                   common::OUTPUT)
-                           << ": BEFORE => "
-                           << "tl = " << _tl << " ; tn = " << _tn
-                           << " ; scheduler = " << _event_table.to_string();
-    common::Trace::trace().flush();
-
-    assert(t == _tn);
-
-    common::Models IMM = _event_table.get_current_models(t);
-
-    common::Trace::trace() << common::TraceElement(get_name(), t,
-                                                   common::OUTPUT)
-                           << ": IMM = " << IMM.to_string();
-    common::Trace::trace().flush();
-
-    for (auto & model : IMM) {
-        model->output(t);
-    }
-
-    common::Trace::trace() << common::TraceElement(get_name(), t,
-                                                   common::OUTPUT)
-                           << ": AFTER => "
-                           << "tl = " << _tl << " ; tn = " << _tn
-                           << " ; scheduler = " << _event_table.to_string();
-    common::Trace::trace().flush();
-
-}
-
-/*******************************************************************
- * when x-message(t)
- *   receivers = { r | r in children, N in Ir, Z(N,r)(x) isn't empty
- *   for each r in receivers
- *     send x-message(Z(N,r)(x), t) with input value Z(N,r)(x) to r
- *   for each r in IMM and not in receivers
- *     send x-message(empty, t) to r
- *   sort event list acocrding to tn
- *   tl = t
- *   tn = min(tn_d | d in D)
- *******************************************************************/
-common::Time Coordinator::transition(common::Time t)
-{
-
-    common::Trace::trace() << common::TraceElement(get_name(), t,
-                                                   common::S_MESSAGE)
-                           << ": BEFORE => "
-                           << "tl = " << _tl << " ; tn = " << _tn
-                           << " ; scheduler = " << _event_table.to_string();
-    common::Trace::trace().flush();
-
-    assert(t >= _tl and t <= _tn);
-
-    common::Models receivers = _event_table.get_current_models(t);
-
-    add_models_with_inputs(receivers);
-
-    common::Trace::trace() << common::TraceElement(get_name(), t,
-                                                   common::S_MESSAGE)
-                           << ": receivers = " << receivers.to_string();
-    common::Trace::trace().flush();
-
-    for (auto & model : receivers) {
-        _event_table.put(model->transition(t), model);
-    }
-    update_event_table(t);
-    _tl = t;
-    _tn = _event_table.get_current_time();
-    clear_bag();
-
-    common::Trace::trace() << common::TraceElement(get_name(), t,
-                                                   common::S_MESSAGE)
-                           << ": AFTER => "
-                           << "tl = " << _tl << " ; tn = " << _tn
-                           << " ; scheduler = " << _event_table.to_string();
-    common::Trace::trace().flush();
-
-    return _tn;
-}
-
-void Coordinator::post_event(common::Time t,
-                             const common::ExternalEvent& event)
-{
-
-    common::Trace::trace() << common::TraceElement(get_name(), t,
-                                                   common::POST_EVENT)
-                           << ": BEFORE => " << event.to_string();
-    common::Trace::trace().flush();
-
-    add_event(event);
-
-    common::Links::Result result =
-        _link_list.find(this, event.get_port_name());
-
-    for (common::Links::iterator it_r = result.first;
-         it_r != result.second; ++it_r) {
-        it_r->second.get_model()->post_event(
-            t, common::ExternalEvent(it_r->second, event.get_content()));
-    }
-    update_event_table(t);
-    _tn = _event_table.get_current_time();
-
-    common::Trace::trace() << common::TraceElement(get_name(), t,
-                                                   common::POST_EVENT)
-                           << ": AFTER => " << event.to_string();
-    common::Trace::trace().flush();
-
-}
-
-/*******************************************************************
- * when y-message(y_d, t) with output y_d from d
- *******************************************************************/
-common::Time Coordinator::dispatch_events(common::Bag bag, common::Time t)
-{
-
-    common::Trace::trace() << common::TraceElement(get_name(), t,
-                                                   common::Y_MESSAGE)
-                           << ": BEFORE => "
-                           << "tl = " << _tl << " ; tn = " << _tn
-                           << " ; bag = " << bag.to_string();
-    common::Trace::trace().flush();
-
-    for (auto & ymsg : bag) {
-            common::Links::Result result_model =
-                _link_list.find(ymsg.get_model(), ymsg.get_port_name());
-
-        for (common::Links::iterator it = result_model.first;
-             it != result_model.second; ++it) {
-            // event on output port of coupled model
-            if (it->second.get_model() == this) {
-                common::Bag ymessages;
-
-                ymessages.push_back(
-                    common::ExternalEvent(it->second, ymsg.get_content()));
-                dynamic_cast < Coordinator* >(get_parent())->dispatch_events(
-                    ymessages, t);
-            } else { // event on input port of internal model
-                    it->second.get_model()->post_event(
-                        t, common::ExternalEvent(it->second,
-                                                 ymsg.get_content()));
-            }
-        }
-    }
-
-    common::Trace::trace() << common::TraceElement(get_name(), t,
-                                                   common::Y_MESSAGE)
-                           << ": BEFORE => "
-                           << "tl = " << _tl << " ; tn = " << _tn;
-    common::Trace::trace().flush();
-
-    return _tn;
-}
-
-void Coordinator::observation(std::ostream& file) const
-{
-    for (auto & child : _child_list) {
-        child->observation(file);
-    }
-}
-
-void Coordinator::add_child(Model* child)
-{
-    _child_list.push_back(child);
-    child->set_parent(this);
-}
-
-void Coordinator::add_link(Model* out_model, const std::string& out_port_name,
-                           Model* in_model, const std::string& in_port_name)
-{
-    _link_list.add(out_model, out_port_name, in_model, in_port_name);
-}
-
-void Coordinator::add_models_with_inputs(common::Models& receivers)
-{
-    for (auto & model : _child_list) {
-        if (model->event_number() > 0) {
-            if (std::find(receivers.begin(), receivers.end(), model) ==
-                receivers.end()) {
-                receivers.push_back(model);
-            }
-        }
-    }
-}
-
-void Coordinator::update_event_table(common::Time t)
-{
-    for (auto & model : _child_list) {
-        if (model->event_number() > 0) {
-            _event_table.put(t, model);
-        }
-    }
-}
-
 } } // namespace paradevs pdevs

+ 238 - 24
src/pdevs/Coordinator.hpp

@@ -33,38 +33,252 @@
 #include <common/Links.hpp>
 #include <common/ExternalEvent.hpp>
 #include <common/Node.hpp>
+#include <common/Trace.hpp>
 
+#include <cassert>
 #include <iostream>
 
 namespace paradevs { namespace pdevs {
 
+class Parameters
+{
+public:
+    Parameters()
+    { }
+};
+
+template < class GraphManager >
 class Coordinator : public common::Coordinator
 {
 public:
-    Coordinator(const std::string& name);
-    virtual ~Coordinator();
-
-// DEVS methods
-    virtual void output(common::Time /* t */);
-    virtual void post_event(common::Time /* t */,
-                            const common::ExternalEvent& /* event */);
-    virtual common::Time dispatch_events(common::Bag /* bag */,
-                                         common::Time /* t */);
-    virtual common::Time start(common::Time /* t */);
-    virtual common::Time transition(common::Time /* t */);
-    virtual void observation(std::ostream& file) const;
-
-// graph methods
-    virtual void add_child(Model* child);
-    virtual void add_link(Model* out_model, const std::string& out_port_name,
-                          Model* in_model, const std::string& in_port_name);
-
-private:
-    void add_models_with_inputs(common::Models& receivers);
-    void update_event_table(common::Time t);
-
-    common::Links      _link_list;
-    common::Models     _child_list;
+    typedef Parameters parameters_type;
+
+    Coordinator(const std::string& name, const Parameters& /* parameters */) :
+        common::Coordinator(name), _graph_manager(this)
+    { }
+
+    virtual ~Coordinator()
+    { }
+
+    common::Time start(common::Time t)
+    {
+
+        common::Trace::trace() << common::TraceElement(get_name(), t,
+                                                       common::I_MESSAGE)
+                               << ": BEFORE => "
+                               << "tl = " << _tl << " ; tn = " << _tn;
+        common::Trace::trace().flush();
+
+        assert(_graph_manager.children().size() > 0);
+
+        for (auto & child : _graph_manager.children()) {
+            _event_table.init(child->start(_tn), child);
+        }
+        _tl = t;
+        _tn = _event_table.get_current_time();
+
+        common::Trace::trace() << common::TraceElement(get_name(), t,
+                                                       common::I_MESSAGE)
+                               << ": AFTER => "
+                               << "tl = " << _tl << " ; tn = " << _tn;
+        common::Trace::trace().flush();
+
+        return _tn;
+    }
+
+/**************************************************
+ * when *-message(t)
+ *   calculate IMM (models with tn = t in scheduler
+ *   calculate INF from IMM
+ *   for each e in IMM U INF
+ *     calculate influencer
+ *   ...
+ *  send done to parent
+ **************************************************/
+    void output(common::Time t)
+    {
+
+        common::Trace::trace() << common::TraceElement(get_name(), t,
+                                                       common::OUTPUT)
+                               << ": BEFORE => "
+                               << "tl = " << _tl << " ; tn = " << _tn
+                               << " ; scheduler = " << _event_table.to_string();
+        common::Trace::trace().flush();
+
+        assert(t == _tn);
+
+        common::Models IMM = _event_table.get_current_models(t);
+
+        common::Trace::trace() << common::TraceElement(get_name(), t,
+                                                       common::OUTPUT)
+                               << ": IMM = " << IMM.to_string();
+        common::Trace::trace().flush();
+
+        for (auto & model : IMM) {
+            model->output(t);
+        }
+
+        common::Trace::trace() << common::TraceElement(get_name(), t,
+                                                       common::OUTPUT)
+                               << ": AFTER => "
+                               << "tl = " << _tl << " ; tn = " << _tn
+                               << " ; scheduler = " << _event_table.to_string();
+        common::Trace::trace().flush();
+
+    }
+
+/*******************************************************************
+ * when x-message(t)
+ *   receivers = { r | r in children, N in Ir, Z(N,r)(x) isn't empty
+ *   for each r in receivers
+ *     send x-message(Z(N,r)(x), t) with input value Z(N,r)(x) to r
+ *   for each r in IMM and not in receivers
+ *     send x-message(empty, t) to r
+ *   sort event list acocrding to tn
+ *   tl = t
+ *   tn = min(tn_d | d in D)
+ *******************************************************************/
+    common::Time transition(common::Time t)
+    {
+
+        common::Trace::trace() << common::TraceElement(get_name(), t,
+                                                       common::S_MESSAGE)
+                               << ": BEFORE => "
+                               << "tl = " << _tl << " ; tn = " << _tn
+                               << " ; scheduler = " << _event_table.to_string();
+        common::Trace::trace().flush();
+
+        assert(t >= _tl and t <= _tn);
+
+        common::Models receivers = _event_table.get_current_models(t);
+
+        add_models_with_inputs(receivers);
+
+        common::Trace::trace() << common::TraceElement(get_name(), t,
+                                                       common::S_MESSAGE)
+                               << ": receivers = " << receivers.to_string();
+        common::Trace::trace().flush();
+
+        for (auto & model : receivers) {
+            _event_table.put(model->transition(t), model);
+        }
+        update_event_table(t);
+        _tl = t;
+        _tn = _event_table.get_current_time();
+        clear_bag();
+
+        common::Trace::trace() << common::TraceElement(get_name(), t,
+                                                       common::S_MESSAGE)
+                               << ": AFTER => "
+                               << "tl = " << _tl << " ; tn = " << _tn
+                               << " ; scheduler = " << _event_table.to_string();
+        common::Trace::trace().flush();
+
+        return _tn;
+    }
+
+    void post_event(common::Time t,
+                    const common::ExternalEvent& event)
+    {
+
+        common::Trace::trace() << common::TraceElement(get_name(), t,
+                                                       common::POST_EVENT)
+                               << ": BEFORE => " << event.to_string();
+        common::Trace::trace().flush();
+
+        add_event(event);
+
+        common::Links::Result result =
+            _graph_manager.links().find(this, event.get_port_name());
+
+        for (common::Links::const_iterator it_r = result.first;
+             it_r != result.second; ++it_r) {
+            it_r->second.get_model()->post_event(
+                t, common::ExternalEvent(it_r->second, event.get_content()));
+        }
+        update_event_table(t);
+        _tn = _event_table.get_current_time();
+
+        common::Trace::trace() << common::TraceElement(get_name(), t,
+                                                       common::POST_EVENT)
+                               << ": AFTER => " << event.to_string();
+        common::Trace::trace().flush();
+
+    }
+
+/*******************************************************************
+ * when y-message(y_d, t) with output y_d from d
+ *******************************************************************/
+    common::Time dispatch_events(common::Bag bag, common::Time t)
+    {
+
+        common::Trace::trace() << common::TraceElement(get_name(), t,
+                                                       common::Y_MESSAGE)
+                               << ": BEFORE => "
+                               << "tl = " << _tl << " ; tn = " << _tn
+                               << " ; bag = " << bag.to_string();
+        common::Trace::trace().flush();
+
+        for (auto & ymsg : bag) {
+            common::Links::Result result_model =
+                _graph_manager.links().find(ymsg.get_model(), ymsg.get_port_name());
+
+            for (common::Links::const_iterator it = result_model.first;
+                 it != result_model.second; ++it) {
+                // event on output port of coupled model
+                if (it->second.get_model() == this) {
+                    common::Bag ymessages;
+
+                    ymessages.push_back(
+                        common::ExternalEvent(it->second, ymsg.get_content()));
+                    dynamic_cast < common::Coordinator* >(get_parent())->dispatch_events(
+                        ymessages, t);
+                } else { // event on input port of internal model
+                    it->second.get_model()->post_event(
+                        t, common::ExternalEvent(it->second,
+                                                 ymsg.get_content()));
+                }
+            }
+        }
+
+        common::Trace::trace() << common::TraceElement(get_name(), t,
+                                                       common::Y_MESSAGE)
+                               << ": BEFORE => "
+                               << "tl = " << _tl << " ; tn = " << _tn;
+        common::Trace::trace().flush();
+
+        return _tn;
+    }
+
+    void observation(std::ostream& file) const
+    {
+        for (auto & child : _graph_manager.children()) {
+            child->observation(file);
+        }
+    }
+
+    void add_models_with_inputs(common::Models& receivers)
+    {
+        for (auto & model : _graph_manager.children()) {
+            if (model->event_number() > 0) {
+                if (std::find(receivers.begin(), receivers.end(), model) ==
+                    receivers.end()) {
+                    receivers.push_back(model);
+                }
+            }
+        }
+    }
+
+    void update_event_table(common::Time t)
+    {
+        for (auto & model : _graph_manager.children()) {
+            if (model->event_number() > 0) {
+                _event_table.put(t, model);
+            }
+        }
+    }
+
+    GraphManager       _graph_manager;
     common::EventTable _event_table;
 };
 

+ 22 - 13
src/common/Builder.hpp

@@ -1,5 +1,5 @@
 /**
- * @file Builder.hpp
+ * @file GraphManager.cpp
  * @author The PARADEVS Development Team
  * See the AUTHORS or Authors.txt file
  */
@@ -24,22 +24,31 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef COMMON_BUILDER
-#define COMMON_BUILDER 1
+#include <pdevs/GraphManager.hpp>
 
-#include <common/Model.hpp>
+namespace paradevs { namespace pdevs {
 
-namespace paradevs { namespace common {
+GraphManager::GraphManager(common::Coordinator* coordinator) :
+    _coordinator(coordinator)
+{ }
 
-class Builder
+GraphManager::~GraphManager()
 {
-public :
-    Builder();
-    virtual ~Builder();
+    for (auto & child : _child_list) {
+        delete child;
+    }
+}
 
-    virtual Model* build() const =0;
-};
+void GraphManager::add_child(common::Model* child)
+{
+    _child_list.push_back(child);
+    child->set_parent(_coordinator);
+}
 
-} } // namespace paradevs common
+void GraphManager::add_link(common::Model* out_model, const std::string& out_port_name,
+                            common::Model* in_model, const std::string& in_port_name)
+{
+    _link_list.add(out_model, out_port_name, in_model, in_port_name);
+}
 
-#endif
+} } // namespace paradevs pdevs

+ 58 - 0
src/pdevs/GraphManager.hpp

@@ -0,0 +1,58 @@
+/**
+ * @file GraphManager.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 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 PDEVS_GRAPH_MANANGER
+#define PDEVS_GRAPH_MANANGER 1
+
+#include <common/Coordinator.hpp>
+#include <common/Links.hpp>
+#include <common/Model.hpp>
+
+namespace paradevs { namespace pdevs {
+
+class GraphManager
+{
+public:
+    GraphManager(common::Coordinator* coordinator);
+    virtual ~GraphManager();
+
+    virtual void add_child(common::Model* child);
+    virtual void add_link(common::Model* out_model, const std::string& out_port_name,
+                          common::Model* in_model, const std::string& in_port_name);
+    const common::Models& children() const
+    { return _child_list; }
+    const common::Links& links() const
+    { return _link_list; }
+
+private:
+    common::Links        _link_list;
+    common::Models       _child_list;
+    common::Coordinator* _coordinator;
+};
+
+} } // namespace paradevs pdevs
+
+#endif

+ 38 - 22
src/tests/dtss_tests.cpp

@@ -30,6 +30,7 @@
 #include <common/Trace.hpp>
 
 #include <dtss/Coordinator.hpp>
+#include <dtss/GraphManager.hpp>
 
 #define CATCH_CONFIG_MAIN
 #include "catch.hpp"
@@ -116,35 +117,48 @@ private:
     common::Bag _bag;
 };
 
-common::Model* OnlyOneBuilder::build() const
+class OnlyOneGraphManager : public dtss::GraphManager
 {
-    dtss::Coordinator < Policy >* root =
-        new dtss::Coordinator < Policy >("root", 1);
-    dtss::Simulator < A >* a = new dtss::Simulator < A >("a", 1);
+public:
+    OnlyOneGraphManager(common::Coordinator* coordinator) :
+        dtss::GraphManager(coordinator)
+    {
+        dtss::Simulator < A >* a = new dtss::Simulator < A >("a", 1);
 
-    root->add_child(a);
-    return root;
-}
+        add_child(a);
+    }
 
-common::Model* TwoBuilder::build() const
+    virtual ~OnlyOneGraphManager()
+    { }
+};
+
+class TwoGraphManager : public dtss::GraphManager
 {
-    dtss::Coordinator < Policy >* root =
-        new dtss::Coordinator < Policy >("root", 1);
-    dtss::Simulator < A >* a = new dtss::Simulator < A >("a", 1);
-    dtss::Simulator < B >* b = new dtss::Simulator < B >("b", 1);
-
-    root->add_child(a);
-    root->add_child(b);
-    root->add_link(a, "out", b, "in");
-    return root;
-}
+public:
+    TwoGraphManager(common::Coordinator* coordinator) :
+        dtss::GraphManager(coordinator)
+    {
+        dtss::Simulator < A >* a = new dtss::Simulator < A >("a", 1);
+        dtss::Simulator < B >* b = new dtss::Simulator < B >("b", 1);
+
+        add_child(a);
+        add_child(b);
+        add_link(a, "out", b, "in");
+    }
+
+    virtual ~TwoGraphManager()
+    { }
+};
 
 } } // namespace paradevs dtss
 
 TEST_CASE("dtss/only_one", "run")
 {
-    paradevs::dtss::OnlyOneBuilder builder;
-    paradevs::common::RootCoordinator rc(0, 10, builder);
+
+    paradevs::common::RootCoordinator <
+        paradevs::dtss::Coordinator < paradevs::dtss::Policy,
+                                      paradevs::dtss::OnlyOneGraphManager >
+        > rc(0, 10, "root", paradevs::dtss::Parameters(1));
 
     paradevs::common::Trace::trace().clear();
     rc.run();
@@ -164,8 +178,10 @@ TEST_CASE("dtss/only_one", "run")
 
 TEST_CASE("dtss/two", "run")
 {
-    paradevs::dtss::TwoBuilder builder;
-    paradevs::common::RootCoordinator rc(0, 10, builder);
+    paradevs::common::RootCoordinator <
+        paradevs::dtss::Coordinator < paradevs::dtss::Policy,
+                                      paradevs::dtss::TwoGraphManager >
+        > rc(0, 10, "root", paradevs::dtss::Parameters(1));
 
     paradevs::common::Trace::trace().clear();
     rc.run();

+ 0 - 24
src/tests/dtss_tests.hpp

@@ -24,9 +24,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <common/Builder.hpp>
 #include <dtss/Dynamics.hpp>
-#include <dtss/Simulator.hpp>
 
 namespace paradevs { namespace dtss {
 
@@ -56,26 +54,4 @@ public:
     virtual common::Bag lambda(common::Time /* t */) const;
 };
 
-class OnlyOneBuilder : public common::Builder
-{
-public:
-    OnlyOneBuilder()
-    { }
-    virtual ~OnlyOneBuilder()
-    { }
-
-    virtual common::Model* build() const;
-};
-
-class TwoBuilder : public common::Builder
-{
-public:
-    TwoBuilder()
-    { }
-    virtual ~TwoBuilder()
-    { }
-
-    virtual common::Model* build() const;
-};
-
 } } // namespace paradevs dtss

+ 55 - 21
src/tests/mixed_tests.cpp

@@ -30,7 +30,12 @@
 #include <common/Trace.hpp>
 
 #include <dtss/Coordinator.hpp>
+#include <dtss/GraphManager.hpp>
+#include <dtss/Simulator.hpp>
+
 #include <pdevs/Coordinator.hpp>
+#include <pdevs/GraphManager.hpp>
+#include <pdevs/Simulator.hpp>
 
 #define CATCH_CONFIG_MAIN
 #include "catch.hpp"
@@ -274,44 +279,73 @@ private:
     common::Bag _bag;
 };
 
-common::Model* HierachicalBuilder::build() const
+class S1GraphManager : public pdevs::GraphManager
 {
-    pdevs::Coordinator* root = new pdevs::Coordinator("root");
-
-    pdevs::Coordinator* S1 = new pdevs::Coordinator("S1");
+public:
+    S1GraphManager(common::Coordinator* coordinator) :
+        pdevs::GraphManager(coordinator)
     {
         pdevs::Simulator < A1 >* a = new pdevs::Simulator < A1 >("a1");
         pdevs::Simulator < B1 >* b = new pdevs::Simulator < B1 >("b1");
 
-        S1->add_child(a);
-        S1->add_child(b);
-        S1->add_link(a, "out", b, "in");
-        S1->add_link(b, "out", S1, "out");
+        add_child(a);
+        add_child(b);
+        add_link(a, "out", b, "in");
+        add_link(b, "out", coordinator, "out");
     }
 
-    dtss::Coordinator < LastBagPolicy >* S2 =
-        new dtss::Coordinator < LastBagPolicy >("S2", 20);
+    virtual ~S1GraphManager()
+    { }
+};
+
+class S2GraphManager : public dtss::GraphManager
+{
+public:
+    S2GraphManager(common::Coordinator* coordinator) :
+        dtss::GraphManager(coordinator)
     {
         dtss::Simulator < A2 >* a = new dtss::Simulator < A2 >("a2", 20);
         dtss::Simulator < B2 >* b = new dtss::Simulator < B2 >("b2", 20);
 
-        S2->add_child(a);
-        S2->add_child(b);
-        S2->add_link(a, "out", b, "in");
-        S2->add_link(S2, "in", a, "in");
+        add_child(a);
+        add_child(b);
+        add_link(a, "out", b, "in");
+        add_link(coordinator, "in", a, "in");
     }
-    root->add_child(S1);
-    root->add_child(S2);
-    root->add_link(S1, "out", S2, "in");
-    return root;
-}
+
+    virtual ~S2GraphManager()
+    { }
+};
+
+class RootGraphManager : public pdevs::GraphManager
+{
+public:
+    RootGraphManager(common::Coordinator* coordinator) :
+        pdevs::GraphManager(coordinator)
+    {
+        pdevs::Coordinator < S1GraphManager >* S1 =
+            new pdevs::Coordinator < S1GraphManager >(
+                "S1", paradevs::pdevs::Parameters());
+        dtss::Coordinator < LastBagPolicy, S2GraphManager >* S2 =
+            new dtss::Coordinator < LastBagPolicy, S2GraphManager >(
+                "S2", paradevs::dtss::Parameters(20));
+
+        add_child(S1);
+        add_child(S2);
+        add_link(S1, "out", S2, "in");
+    }
+
+    virtual ~RootGraphManager()
+    { }
+};
 
 } // namespace paradevs
 
 TEST_CASE("mixed/hierachical", "run")
 {
-    paradevs::HierachicalBuilder builder;
-    paradevs::common::RootCoordinator rc(0, 100, builder);
+    paradevs::common::RootCoordinator <
+        paradevs::pdevs::Coordinator < paradevs::RootGraphManager >
+        > rc(0, 100, "root", paradevs::pdevs::Parameters());
 
     paradevs::common::Trace::trace().clear();
     rc.run();

+ 0 - 16
src/tests/mixed_tests.hpp

@@ -24,13 +24,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <common/Builder.hpp>
-
 #include <dtss/Dynamics.hpp>
-#include <dtss/Simulator.hpp>
-
 #include <pdevs/Dynamics.hpp>
-#include <pdevs/Simulator.hpp>
 
 namespace paradevs {
 
@@ -106,15 +101,4 @@ public:
     virtual common::Bag lambda(common::Time /* t */) const;
 };
 
-class HierachicalBuilder : public common::Builder
-{
-public:
-    HierachicalBuilder()
-    { }
-    virtual ~HierachicalBuilder()
-    { }
-
-    virtual common::Model* build() const;
-};
-
 } // namespace paradevs

+ 90 - 46
src/tests/pdevs_tests.cpp

@@ -30,6 +30,8 @@
 #include <common/Trace.hpp>
 
 #include <pdevs/Coordinator.hpp>
+#include <pdevs/GraphManager.hpp>
+#include <pdevs/Simulator.hpp>
 
 #define CATCH_CONFIG_MAIN
 #include "catch.hpp"
@@ -185,70 +187,110 @@ common::Bag B::lambda(common::Time t) const
 void B::observation(std::ostream& /* file */) const
 { }
 
-common::Model* HierachicalBuilder::build() const
+class S1GraphManager : public pdevs::GraphManager
 {
-    pdevs::Coordinator* root = new pdevs::Coordinator("root");
-
-    pdevs::Coordinator* S1 = new pdevs::Coordinator("S1");
+public:
+    S1GraphManager(common::Coordinator* coordinator) :
+        pdevs::GraphManager(coordinator)
     {
         pdevs::Simulator < A >* a = new pdevs::Simulator < A >("a1");
         pdevs::Simulator < B >* b = new pdevs::Simulator < B >("b1");
 
-        S1->add_child(a);
-        S1->add_child(b);
-        S1->add_link(a, "out", b, "in");
-        S1->add_link(b, "out", S1, "out");
+        add_child(a);
+        add_child(b);
+        add_link(a, "out", b, "in");
+        add_link(b, "out", coordinator, "out");
     }
 
-    pdevs::Coordinator* S2 = new pdevs::Coordinator("S2");
+    virtual ~S1GraphManager()
+    { }
+};
+
+class S2GraphManager : public pdevs::GraphManager
+{
+public:
+    S2GraphManager(common::Coordinator* coordinator) :
+        pdevs::GraphManager(coordinator)
     {
         pdevs::Simulator < A >* a = new pdevs::Simulator < A >("a2");
         pdevs::Simulator < B >* b = new pdevs::Simulator < B >("b2");
 
-        S2->add_child(a);
-        S2->add_child(b);
-        S2->add_link(a, "out", b, "in");
-        S2->add_link(S2, "in", a, "in");
+        add_child(a);
+        add_child(b);
+        add_link(a, "out", b, "in");
+        add_link(coordinator, "in", a, "in");
     }
-    root->add_child(S1);
-    root->add_child(S2);
-    root->add_link(S1, "out", S2, "in");
-    return root;
-}
 
-common::Model* OnlyOneBuilder::build() const
+    virtual ~S2GraphManager()
+    { }
+};
+
+class RootGraphManager : public pdevs::GraphManager
 {
-    pdevs::Coordinator* root = new pdevs::Coordinator("root");
-    pdevs::Simulator < A >* a = new pdevs::Simulator < A >("a");
+public:
+    RootGraphManager(common::Coordinator* coordinator) :
+        pdevs::GraphManager(coordinator)
+    {
+        Coordinator < S1GraphManager >* S1 =
+            new Coordinator < S1GraphManager >("S1", Parameters());
+        Coordinator < S2GraphManager >* S2 =
+            new Coordinator < S2GraphManager >("S2", Parameters());
+
+        add_child(S1);
+        add_child(S2);
+        add_link(S1, "out", S2, "in");
+    }
 
-    root->add_child(a);
-    return root;
-}
+    virtual ~RootGraphManager()
+    { }
+};
 
-common::Model* FlatBuilder::build() const
+class OnlyOneGraphManager : public pdevs::GraphManager
 {
-    pdevs::Coordinator* root = new pdevs::Coordinator("root");
-    pdevs::Simulator < A >* a1 = new pdevs::Simulator < A >("a1");
-    pdevs::Simulator < B >* b1 = new pdevs::Simulator < B >("b1");
-    pdevs::Simulator < A >* a2 = new pdevs::Simulator < A >("a2");
-    pdevs::Simulator < B >* b2 = new pdevs::Simulator < B >("b2");
-
-    root->add_child(a1);
-    root->add_child(b1);
-    root->add_child(a2);
-    root->add_child(b2);
-    root->add_link(a1, "out", b1, "in");
-    root->add_link(b1, "out", a2, "in");
-    root->add_link(a2, "out", b2, "in");
-    return root;
-}
+public:
+    OnlyOneGraphManager(common::Coordinator* coordinator) :
+        pdevs::GraphManager(coordinator)
+    {
+        pdevs::Simulator < A >* a = new pdevs::Simulator < A >("a");
+
+        add_child(a);
+    }
+
+    virtual ~OnlyOneGraphManager()
+    { }
+};
+
+class FlatGraphManager : public pdevs::GraphManager
+{
+public:
+    FlatGraphManager(common::Coordinator* coordinator) :
+        pdevs::GraphManager(coordinator)
+    {
+        pdevs::Simulator < A >* a1 = new pdevs::Simulator < A >("a1");
+        pdevs::Simulator < B >* b1 = new pdevs::Simulator < B >("b1");
+        pdevs::Simulator < A >* a2 = new pdevs::Simulator < A >("a2");
+        pdevs::Simulator < B >* b2 = new pdevs::Simulator < B >("b2");
+
+        add_child(a1);
+        add_child(b1);
+        add_child(a2);
+        add_child(b2);
+        add_link(a1, "out", b1, "in");
+        add_link(b1, "out", a2, "in");
+        add_link(a2, "out", b2, "in");
+    }
+
+    virtual ~FlatGraphManager()
+    { }
+};
 
 } } // namespace paradevs pdevs
 
 TEST_CASE("pdevs/only_one", "run")
 {
-    paradevs::pdevs::OnlyOneBuilder builder;
-    paradevs::common::RootCoordinator rc(0, 10, builder);
+    paradevs::common::RootCoordinator <
+        paradevs::pdevs::Coordinator < paradevs::pdevs::OnlyOneGraphManager >
+        > rc(0, 10, "root", paradevs::pdevs::Parameters());
 
     paradevs::common::Trace::trace().clear();
     rc.run();
@@ -277,8 +319,9 @@ TEST_CASE("pdevs/only_one", "run")
 
 TEST_CASE("pdevs/flat", "run")
 {
-    paradevs::pdevs::FlatBuilder builder;
-    paradevs::common::RootCoordinator rc(0, 10, builder);
+    paradevs::common::RootCoordinator <
+        paradevs::pdevs::Coordinator < paradevs::pdevs::FlatGraphManager >
+        > rc(0, 10, "root", paradevs::pdevs::Parameters());
 
     paradevs::common::Trace::trace().clear();
     rc.run();
@@ -362,8 +405,9 @@ TEST_CASE("pdevs/flat", "run")
 
 TEST_CASE("pdevs/hierachical", "run")
 {
-    paradevs::pdevs::HierachicalBuilder builder;
-    paradevs::common::RootCoordinator rc(0, 10, builder);
+    paradevs::common::RootCoordinator <
+        paradevs::pdevs::Coordinator < paradevs::pdevs::RootGraphManager >
+        > rc(0, 10, "root", paradevs::pdevs::Parameters());
 
     paradevs::common::Trace::trace().clear();
     rc.run();

+ 0 - 35
src/tests/pdevs_tests.hpp

@@ -24,9 +24,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <common/Builder.hpp>
 #include <pdevs/Dynamics.hpp>
-#include <pdevs/Simulator.hpp>
 
 namespace paradevs { namespace pdevs {
 
@@ -78,37 +76,4 @@ private:
     Phase _phase;
 };
 
-class HierachicalBuilder : public common::Builder
-{
-public:
-    HierachicalBuilder()
-    { }
-    virtual ~HierachicalBuilder()
-    { }
-
-    virtual common::Model* build() const;
-};
-
-class OnlyOneBuilder : public common::Builder
-{
-public:
-    OnlyOneBuilder()
-    { }
-    virtual ~OnlyOneBuilder()
-    { }
-
-    virtual common::Model* build() const;
-};
-
-class FlatBuilder : public common::Builder
-{
-public:
-    FlatBuilder()
-    { }
-    virtual ~FlatBuilder()
-    { }
-
-    virtual common::Model* build() const;
-};
-
 } } // namespace paradevs pdevs