Parcourir la source

Remove all tests

Eric Ramat il y a 11 ans
Parent
commit
da4730a4ca
66 fichiers modifiés avec 0 ajouts et 20310 suppressions
  1. 0 18
      src/tests/CMakeLists.txt
  2. 0 24
      src/tests/boost_graph/CMakeLists.txt
  3. 0 466
      src/tests/boost_graph/graph_builder.hpp
  4. 0 78
      src/tests/boost_graph/graph_defs.hpp
  5. 0 758
      src/tests/boost_graph/graph_manager.hpp
  6. 0 171
      src/tests/boost_graph/graph_partitioning.hpp
  7. 0 208
      src/tests/boost_graph/models.hpp
  8. 0 31
      src/tests/boost_graph/partitioning/CMakeLists.txt
  9. 0 71
      src/tests/boost_graph/partitioning/defs.hpp
  10. 0 939
      src/tests/boost_graph/partitioning/gggp.cpp
  11. 0 68
      src/tests/boost_graph/partitioning/gggp.hpp
  12. 0 434
      src/tests/boost_graph/partitioning/graph_build.cpp
  13. 0 39
      src/tests/boost_graph/partitioning/graph_build.hpp
  14. 0 132
      src/tests/boost_graph/partitioning/main.cpp
  15. 0 1588
      src/tests/boost_graph/partitioning/utils.cpp
  16. 0 114
      src/tests/boost_graph/partitioning/utils.hpp
  17. 0 378
      src/tests/boost_graph/tests.cpp
  18. 0 6446
      src/tests/catch.hpp
  19. 0 12
      src/tests/common/CMakeLists.txt
  20. 0 19
      src/tests/common/scheduler/CMakeLists.txt
  21. 0 167
      src/tests/common/scheduler/tests.cpp
  22. 0 23
      src/tests/corsen/CMakeLists.txt
  23. 0 27
      src/tests/corsen/lib/CMakeLists.txt
  24. 0 149
      src/tests/corsen/lib/Constantes.h
  25. 0 112
      src/tests/corsen/lib/ContextData.h
  26. 0 234
      src/tests/corsen/lib/ContextFileReader.h
  27. 0 319
      src/tests/corsen/lib/Coordinates.h
  28. 0 193
      src/tests/corsen/lib/Corsen.cpp
  29. 0 157
      src/tests/corsen/lib/Corsen.hpp
  30. 0 126
      src/tests/corsen/lib/DrainFileStream.h
  31. 0 141
      src/tests/corsen/lib/ElevationFileStream.h
  32. 0 77
      src/tests/corsen/lib/Exception.h
  33. 0 209
      src/tests/corsen/lib/FileStream.h
  34. 0 173
      src/tests/corsen/lib/Functions.cpp
  35. 0 86
      src/tests/corsen/lib/Functions.h
  36. 0 230
      src/tests/corsen/lib/Graph.cpp
  37. 0 200
      src/tests/corsen/lib/Graph.hpp
  38. 0 282
      src/tests/corsen/lib/Layer.h
  39. 0 121
      src/tests/corsen/lib/LayersFileStream.h
  40. 0 141
      src/tests/corsen/lib/LayersTextFileStream.h
  41. 0 149
      src/tests/corsen/lib/Node.h
  42. 0 179
      src/tests/corsen/lib/Outlet.h
  43. 0 242
      src/tests/corsen/lib/OutletFileStream.h
  44. 0 87
      src/tests/corsen/lib/Parameters.h
  45. 0 255
      src/tests/corsen/lib/ParametersFileStream.h
  46. 0 123
      src/tests/corsen/lib/Singleton.h
  47. 0 114
      src/tests/corsen/lib/SlopeFileStream.h
  48. 0 98
      src/tests/corsen/lib/SoilFileStream.h
  49. 0 295
      src/tests/corsen/lib/Vertex.h
  50. 0 350
      src/tests/corsen/lib/XmlReader.h
  51. 0 117
      src/tests/corsen/tests.cpp
  52. 0 19
      src/tests/dtss/CMakeLists.txt
  53. 0 119
      src/tests/dtss/graph_manager.hpp
  54. 0 195
      src/tests/dtss/models.hpp
  55. 0 120
      src/tests/dtss/tests.cpp
  56. 0 21
      src/tests/mixed/CMakeLists.txt
  57. 0 428
      src/tests/mixed/graph_manager.hpp
  58. 0 622
      src/tests/mixed/models.hpp
  59. 0 124
      src/tests/mixed/tests.cpp
  60. 0 19
      src/tests/multithreading/CMakeLists.txt
  61. 0 406
      src/tests/multithreading/graph_manager.hpp
  62. 0 139
      src/tests/multithreading/tests.cpp
  63. 0 18
      src/tests/pdevs/CMakeLists.txt
  64. 0 248
      src/tests/pdevs/graph_manager.hpp
  65. 0 357
      src/tests/pdevs/models.hpp
  66. 0 305
      src/tests/pdevs/tests.cpp

+ 0 - 18
src/tests/CMakeLists.txt

@@ -1,18 +0,0 @@
-INCLUDE_DIRECTORIES(
-  ${PARADEVS_BINARY_DIR}/src
-  ${PARADEVS_SOURCE_DIR}/src
-  ${Boost_INCLUDE_DIRS}
-  ${GLIBMM_INCLUDE_DIRS}
-  ${LIBXML_INCLUDE_DIRS})
-
-LINK_DIRECTORIES(
-  ${GLIBMM_LIBRARY_DIRS}
-  ${LIBXML_LIBRARY_DIR})
-
-ADD_SUBDIRECTORY(boost_graph)
-ADD_SUBDIRECTORY(common)
-ADD_SUBDIRECTORY(corsen)
-ADD_SUBDIRECTORY(dtss)
-ADD_SUBDIRECTORY(mixed)
-ADD_SUBDIRECTORY(multithreading)
-ADD_SUBDIRECTORY(pdevs)

+ 0 - 24
src/tests/boost_graph/CMakeLists.txt

@@ -1,24 +0,0 @@
-INCLUDE_DIRECTORIES(
-  ${PARADEVS_BINARY_DIR}/src
-  ${PARADEVS_SOURCE_DIR}/src
-  ${Boost_INCLUDE_DIRS}
-  ${GLIBMM_INCLUDE_DIRS}
-  ${LIBXML_INCLUDE_DIRS})
-
-LINK_DIRECTORIES(
-  ${GLIBMM_LIBRARY_DIRS}
-  ${LIBXML_LIBRARY_DIR})
-
-# graph tests
-ADD_EXECUTABLE(graph-tests ${COMMON_HPP} ${COMMON_SCHEDULER_HPP} ${PDEVS_HPP}
-  graph_builder.hpp graph_defs.hpp graph_manager.hpp graph_partitioning.hpp
-  tests.cpp models.hpp)
-SET_TARGET_PROPERTIES(graph-tests PROPERTIES ${PARADEVS_APP_PROPERTIES})
-
-TARGET_LINK_LIBRARIES(graph-tests partitioning
-  ${Boost_LIBRARIES}
-  ${GLIBMM_LIBRARIES}
-  ${LIBXML_LIBRARIES}
-  ${GTHREAD_LIBRARIES})
-
-ADD_SUBDIRECTORY(partitioning)

+ 0 - 466
src/tests/boost_graph/graph_builder.hpp

@@ -1,466 +0,0 @@
-/**
- * @file tests/boost_graph/graph_builder.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 __TESTS_BOOST_GRAPH_GRAPH_BUILDER_HPP
-#define __TESTS_BOOST_GRAPH_GRAPH_BUILDER_HPP 1
-
-#include <tests/boost_graph/graph_defs.hpp>
-
-namespace paradevs { namespace tests { namespace boost_graph {
-
-class FlatGraphBuilder
-{
-public:
-    FlatGraphBuilder()
-    { }
-
-    void build(OrientedGraphs& graphs, InputEdgeList& /* input_edges */,
-               OutputEdgeList& /* output_edges */,
-               Connections& /* parent_connections */)
-    {
-        OrientedGraph graph;
-
-        OrientedGraph::vertex_descriptor v0 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v1 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v2 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v3 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v4 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v5 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v6 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v7 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v8 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v9 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v10 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v11 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v12 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v13 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v14 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v15 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v16 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v17 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v18 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v19 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v20 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v21 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v22 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v23 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v24 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v25 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v26 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v27 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v28 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v29 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v30 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v31 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v32 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v33 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v34 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v35 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v36 = boost::add_vertex(graph);
-        OrientedGraph::vertex_descriptor v37 = boost::add_vertex(graph);
-
-        boost::add_edge(v1, v0, 1., graph);
-        boost::add_edge(v2, v0, 1., graph);
-        boost::add_edge(v3, v0, 1., graph);
-        boost::add_edge(v1, v2, 1., graph);
-        boost::add_edge(v4, v1, 1., graph);
-        boost::add_edge(v5, v1, 1., graph);
-        boost::add_edge(v6, v1, 1., graph);
-        boost::add_edge(v6, v2, 1., graph);
-        boost::add_edge(v2, v3, 1., graph);
-        boost::add_edge(v9, v3, 1., graph);
-        boost::add_edge(v10, v3 , 1., graph);
-        boost::add_edge(v4, v5, 1., graph);
-        boost::add_edge(v5, v6, 1., graph);
-        boost::add_edge(v7, v4, 1., graph);
-        boost::add_edge(v8, v4, 1., graph);
-        boost::add_edge(v7, v8, 1., graph);
-        boost::add_edge(v9, v10 , 1., graph);
-        boost::add_edge(v8, v11, 1., graph);
-        boost::add_edge(v11, v4, 1., graph);
-        boost::add_edge(v12, v13, 1., graph);
-        boost::add_edge(v12, v7, 1., graph);
-        boost::add_edge(v13, v7, 1., graph);
-        boost::add_edge(v14, v15, 1., graph);
-        boost::add_edge(v14, v12, 1., graph);
-        boost::add_edge(v15, v16, 1., graph);
-        boost::add_edge(v15, v12, 1., graph);
-        boost::add_edge(v16, v17, 1., graph);
-        boost::add_edge(v16, v12, 1., graph);
-        boost::add_edge(v17, v12, 1., graph);
-        boost::add_edge(v18, v19, 1., graph);
-        boost::add_edge(v18, v8, 1., graph);
-        boost::add_edge(v19, v20, 1., graph);
-        boost::add_edge(v19, v8, 1., graph);
-        boost::add_edge(v20, v8, 1., graph);
-        boost::add_edge(v21, v22, 1., graph);
-        boost::add_edge(v21, v19, 1., graph);
-        boost::add_edge(v22, v23, 1., graph);
-        boost::add_edge(v22, v19, 1., graph);
-        boost::add_edge(v23, v19, 1., graph);
-        boost::add_edge(v24, v25, 1., graph);
-        boost::add_edge(v24, v6, 1., graph);
-        boost::add_edge(v25, v6, 1., graph);
-        boost::add_edge(v26, v11, 1., graph);
-        boost::add_edge(v26, v27, 1., graph);
-        boost::add_edge(v26, v24, 1., graph);
-        boost::add_edge(v27, v24, 1., graph);
-        boost::add_edge(v28, v25, 1., graph);
-        boost::add_edge(v29, v27, 1., graph);
-        boost::add_edge(v29, v28, 1., graph);
-        boost::add_edge(v30, v27, 1., graph);
-        boost::add_edge(v30, v28, 1., graph);
-        boost::add_edge(v31, v32, 1., graph);
-        boost::add_edge(v31, v10, 1., graph);
-        boost::add_edge(v32, v33, 1., graph);
-        boost::add_edge(v32, v10, 1., graph);
-        boost::add_edge(v33, v10, 1., graph);
-        boost::add_edge(v34, v31, 1., graph);
-        boost::add_edge(v34, v35, 1., graph);
-        boost::add_edge(v35, v31, 1., graph);
-        boost::add_edge(v35, v32, 1., graph);
-        boost::add_edge(v36, v32, 1., graph);
-        boost::add_edge(v36, v37, 1., graph);
-        boost::add_edge(v36, v33, 1., graph);
-        boost::add_edge(v37, v33, 1., graph);
-
-        /*graph[v6] = VertexProperties(6, 1., NORMAL_PIXEL);
-        graph[v8] = VertexProperties(8, 1., NORMAL_PIXEL);
-        graph[v10] = VertexProperties(10, 1., NORMAL_PIXEL);
-        graph[v0] = VertexProperties(0, 1., NORMAL_PIXEL);
-        graph[v1] = VertexProperties(1, 1., NORMAL_PIXEL);
-        graph[v2] = VertexProperties(2, 1., NORMAL_PIXEL);
-        graph[v3] = VertexProperties(3, 1., NORMAL_PIXEL);
-        graph[v4] = VertexProperties(4, 1., NORMAL_PIXEL);
-        graph[v5] = VertexProperties(5, 1., NORMAL_PIXEL);
-        graph[v7] = VertexProperties(7, 1., TOP_PIXEL);
-        graph[v9] = VertexProperties(9, 1., TOP_PIXEL);*/
-
-        graph[v6] = VertexProperties(6, 2.5, NORMAL_PIXEL);
-        graph[v8] = VertexProperties(8, 2., NORMAL_PIXEL);
-        graph[v10] = VertexProperties(10, 2.5, NORMAL_PIXEL);
-        graph[v0] = VertexProperties(0, 4, NORMAL_PIXEL);
-        graph[v1] = VertexProperties(1, 3, NORMAL_PIXEL);
-        graph[v2] = VertexProperties(2, 3, NORMAL_PIXEL);
-        graph[v3] = VertexProperties(3, 3, NORMAL_PIXEL);
-        graph[v4] = VertexProperties(4, 2.5, NORMAL_PIXEL);
-        graph[v5] = VertexProperties(5, 2.5, NORMAL_PIXEL);
-        graph[v7] = VertexProperties(7, 2., NORMAL_PIXEL);
-        graph[v9] = VertexProperties(9, 2.5, TOP_PIXEL);
-        graph[v11] = VertexProperties(11, 2, NORMAL_PIXEL);
-        graph[v12] = VertexProperties(12, 1.5, NORMAL_PIXEL);
-        graph[v13] = VertexProperties(13, 1.5, NORMAL_PIXEL);
-        graph[v14] = VertexProperties(14, 1, TOP_PIXEL);
-        graph[v15] = VertexProperties(15, 1, NORMAL_PIXEL);
-        graph[v16] = VertexProperties(16, 1, NORMAL_PIXEL);
-        graph[v17] = VertexProperties(17, 1, NORMAL_PIXEL);
-        graph[v18] = VertexProperties(18, 1.5, TOP_PIXEL);
-        graph[v19] = VertexProperties(19, 1.5, NORMAL_PIXEL);
-        graph[v20] = VertexProperties(20, 1.5, NORMAL_PIXEL);
-        graph[v21] = VertexProperties(21, 1, TOP_PIXEL);
-        graph[v22] = VertexProperties(22, 1, NORMAL_PIXEL);
-        graph[v23] = VertexProperties(23, 1, NORMAL_PIXEL);
-        graph[v24] = VertexProperties(24, 2, NORMAL_PIXEL);
-        graph[v25] = VertexProperties(25, 2, NORMAL_PIXEL);
-        graph[v26] = VertexProperties(26, 1.5, TOP_PIXEL);
-        graph[v27] = VertexProperties(27, 1.5, NORMAL_PIXEL);
-        graph[v28] = VertexProperties(28, 1.5, NORMAL_PIXEL);
-        graph[v29] = VertexProperties(29, 1, TOP_PIXEL);
-        graph[v30] = VertexProperties(30, 1, TOP_PIXEL);
-        graph[v31] = VertexProperties(31, 2, NORMAL_PIXEL);
-        graph[v32] = VertexProperties(32, 2, NORMAL_PIXEL);
-        graph[v33] = VertexProperties(33, 2, NORMAL_PIXEL);
-        graph[v34] = VertexProperties(34, 1.5, TOP_PIXEL);
-        graph[v35] = VertexProperties(35, 1.5, NORMAL_PIXEL);
-        graph[v36] = VertexProperties(36, 1.5, TOP_PIXEL);
-        graph[v37] = VertexProperties(37, 1.5, NORMAL_PIXEL);
-
-
-        graphs.push_back(graph);
-    }
-};
-
-class HierarchicalGraphBuilder
-{
-public:
-    HierarchicalGraphBuilder()
-    { }
-
-    void build(OrientedGraphs& graphs, InputEdgeList& input_edges,
-               OutputEdgeList& output_edges, Connections& parent_connections)
-    {
-        // S1
-        {
-            OrientedGraph graph;
-
-            OrientedGraph::vertex_descriptor v1 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v4 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v5 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v7 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v8 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v11 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v12 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v13 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v14 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v15 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v16 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v17 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v18 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v19 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v20 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v21 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v22 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v23 = boost::add_vertex(graph);
-
-            boost::add_edge(v4, v1, 1., graph);
-            boost::add_edge(v5, v1, 1., graph);
-            boost::add_edge(v4, v5, 1., graph);
-            boost::add_edge(v7, v4, 1., graph);
-            boost::add_edge(v8, v4, 1., graph);
-            boost::add_edge(v7, v8, 1., graph);
-            boost::add_edge(v8, v11, 1., graph);
-            boost::add_edge(v11, v4, 1., graph);
-            boost::add_edge(v12, v13, 1., graph);
-            boost::add_edge(v12, v7, 1., graph);
-            boost::add_edge(v13, v7, 1., graph);
-            boost::add_edge(v14, v15, 1., graph);
-            boost::add_edge(v14, v12, 1., graph);
-            boost::add_edge(v15, v16, 1., graph);
-            boost::add_edge(v15, v12, 1., graph);
-            boost::add_edge(v16, v17, 1., graph);
-            boost::add_edge(v16, v12, 1., graph);
-            boost::add_edge(v17, v12, 1., graph);
-            boost::add_edge(v18, v19, 1., graph);
-            boost::add_edge(v18, v8, 1., graph);
-            boost::add_edge(v19, v20, 1., graph);
-            boost::add_edge(v19, v8, 1., graph);
-            boost::add_edge(v20, v8, 1., graph);
-            boost::add_edge(v21, v22, 1., graph);
-            boost::add_edge(v21, v19, 1., graph);
-            boost::add_edge(v22, v23, 1., graph);
-            boost::add_edge(v22, v19, 1., graph);
-            boost::add_edge(v23, v19, 1., graph);
-
-            graph[v8] = VertexProperties(8, 2., NORMAL_PIXEL);
-            graph[v1] = VertexProperties(1, 3, NORMAL_PIXEL);
-            graph[v4] = VertexProperties(4, 2.5, NORMAL_PIXEL);
-            graph[v5] = VertexProperties(5, 2.5, NORMAL_PIXEL);
-            graph[v7] = VertexProperties(7, 2., NORMAL_PIXEL);
-            graph[v11] = VertexProperties(11, 2, NORMAL_PIXEL);
-            graph[v12] = VertexProperties(12, 1.5, NORMAL_PIXEL);
-            graph[v13] = VertexProperties(13, 1.5, NORMAL_PIXEL);
-            graph[v14] = VertexProperties(14, 1, TOP_PIXEL);
-            graph[v15] = VertexProperties(15, 1, NORMAL_PIXEL);
-            graph[v16] = VertexProperties(16, 1, NORMAL_PIXEL);
-            graph[v17] = VertexProperties(17, 1, NORMAL_PIXEL);
-            graph[v18] = VertexProperties(18, 1.5, TOP_PIXEL);
-            graph[v19] = VertexProperties(19, 1.5, NORMAL_PIXEL);
-            graph[v20] = VertexProperties(20, 1.5, NORMAL_PIXEL);
-            graph[v21] = VertexProperties(21, 1, TOP_PIXEL);
-            graph[v22] = VertexProperties(22, 1, NORMAL_PIXEL);
-            graph[v23] = VertexProperties(23, 1, NORMAL_PIXEL);
-
-
-            /*OrientedGraph::vertex_descriptor v1 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v2 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v4 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v5 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v6 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v7 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v8 = boost::add_vertex(graph);
-
-            boost::add_edge(v1, v2, 1., graph);
-            boost::add_edge(v4, v1, 1., graph);
-            boost::add_edge(v5, v1, 1., graph);
-            boost::add_edge(v6, v1, 1., graph);
-            boost::add_edge(v6, v2, 1., graph);
-            boost::add_edge(v4, v5, 1., graph);
-            boost::add_edge(v5, v6, 1., graph);
-            boost::add_edge(v7, v4, 1., graph);
-            boost::add_edge(v8, v4, 1., graph);
-            boost::add_edge(v7, v8, 1., graph);
-
-            graph[v6] = VertexProperties(6, 1., NORMAL_PIXEL);
-            graph[v8] = VertexProperties(8, 1., NORMAL_PIXEL);
-            graph[v1] = VertexProperties(1, 1., NORMAL_PIXEL);
-            graph[v2] = VertexProperties(2, 1., NORMAL_PIXEL);
-            graph[v4] = VertexProperties(4, 1., NORMAL_PIXEL);
-            graph[v5] = VertexProperties(5, 1., NORMAL_PIXEL);
-            graph[v7] = VertexProperties(7, 1., TOP_PIXEL);*/
-
-            graphs.push_back(graph);
-        }
-        // S2
-        {
-            OrientedGraph graph;
-
-            OrientedGraph::vertex_descriptor v0 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v2 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v3 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v6 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v9 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v10 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v24 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v25 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v26 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v27 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v28 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v29 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v30 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v31 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v32 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v33 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v34 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v35 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v36 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v37 = boost::add_vertex(graph);
-
-            boost::add_edge(v2, v0, 1., graph);
-            boost::add_edge(v3, v0, 1., graph);
-            boost::add_edge(v6, v2, 1., graph);
-            boost::add_edge(v2, v3, 1., graph);
-            boost::add_edge(v9, v3, 1., graph);
-            boost::add_edge(v10, v3 , 1., graph);
-            boost::add_edge(v9, v10 , 1., graph);
-            boost::add_edge(v24, v25, 1., graph);
-            boost::add_edge(v24, v6, 1., graph);
-            boost::add_edge(v25, v6, 1., graph);
-            boost::add_edge(v26, v27, 1., graph);
-            boost::add_edge(v26, v24, 1., graph);
-            boost::add_edge(v27, v24, 1., graph);
-            boost::add_edge(v28, v25, 1., graph);
-            boost::add_edge(v29, v27, 1., graph);
-            boost::add_edge(v29, v28, 1., graph);
-            boost::add_edge(v30, v27, 1., graph);
-            boost::add_edge(v31, v32, 1., graph);
-            boost::add_edge(v31, v10, 1., graph);
-            boost::add_edge(v32, v33, 1., graph);
-            boost::add_edge(v32, v10, 1., graph);
-            boost::add_edge(v33, v10, 1., graph);
-            boost::add_edge(v34, v31, 1., graph);
-            boost::add_edge(v34, v35, 1., graph);
-            boost::add_edge(v35, v31, 1., graph);
-            boost::add_edge(v35, v32, 1., graph);
-            boost::add_edge(v36, v32, 1., graph);
-            boost::add_edge(v36, v37, 1., graph);
-            boost::add_edge(v36, v33, 1., graph);
-            boost::add_edge(v37, v33, 1., graph);
-
-            graph[v6] = VertexProperties(6, 2.5, NORMAL_PIXEL);
-            graph[v10] = VertexProperties(10, 2.5, NORMAL_PIXEL);
-            graph[v0] = VertexProperties(0, 4, NORMAL_PIXEL);
-            graph[v2] = VertexProperties(2, 3, NORMAL_PIXEL);
-            graph[v3] = VertexProperties(3, 3, NORMAL_PIXEL);
-            graph[v9] = VertexProperties(9, 2.5, TOP_PIXEL);
-            graph[v24] = VertexProperties(24, 2, NORMAL_PIXEL);
-            graph[v25] = VertexProperties(25, 2, NORMAL_PIXEL);
-            graph[v26] = VertexProperties(26, 1.5, TOP_PIXEL);
-            graph[v27] = VertexProperties(27, 1.5, NORMAL_PIXEL);
-            graph[v28] = VertexProperties(28, 1.5, NORMAL_PIXEL);
-            graph[v29] = VertexProperties(29, 1, TOP_PIXEL);
-            graph[v30] = VertexProperties(30, 1, TOP_PIXEL);
-            graph[v31] = VertexProperties(31, 2, NORMAL_PIXEL);
-            graph[v32] = VertexProperties(32, 2, NORMAL_PIXEL);
-            graph[v33] = VertexProperties(33, 2, NORMAL_PIXEL);
-            graph[v34] = VertexProperties(34, 1.5, TOP_PIXEL);
-            graph[v35] = VertexProperties(35, 1.5, NORMAL_PIXEL);
-            graph[v36] = VertexProperties(36, 1.5, TOP_PIXEL);
-            graph[v37] = VertexProperties(37, 1.5, NORMAL_PIXEL);
-
-            /*OrientedGraph::vertex_descriptor v0 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v3 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v9 = boost::add_vertex(graph);
-            OrientedGraph::vertex_descriptor v10 = boost::add_vertex(graph);
-
-            boost::add_edge(v3, v0, 1., graph);
-            boost::add_edge(v10, v3, 1., graph);
-            boost::add_edge(v9, v10, 1., graph);
-            boost::add_edge(v9, v3, 1., graph);
-
-            graph[v10] = VertexProperties(10, 1., NORMAL_PIXEL);
-            graph[v0] = VertexProperties(0, 1., NORMAL_PIXEL);
-            graph[v3] = VertexProperties(3, 1., NORMAL_PIXEL);
-            graph[v9] = VertexProperties(9, 1., TOP_PIXEL);*/
-
-            graphs.push_back(graph);
-        }
-        {
-
-            /*// input S1
-            input_edges.push_back(InputEdges());
-            // input S2
-            input_edges.push_back(InputEdges());
-            input_edges[1].push_back(Edge(1, 0));
-            input_edges[1].push_back(Edge(2, 0));
-            input_edges[1].push_back(Edge(2, 3));
-
-            // output S1
-            output_edges.push_back(OutputEdges());
-            output_edges[0].push_back(Edge(1, 0));
-            output_edges[0].push_back(Edge(2, 0));
-            output_edges[0].push_back(Edge(2, 3));
-            // output S2
-            output_edges.push_back(OutputEdges());
-
-            // parent
-            parent_connections.push_back(Connection(Port(1,1),Port(2,0)));
-            parent_connections.push_back(Connection(Port(1,2),Port(2,0)));
-            parent_connections.push_back(Connection(Port(1,2),Port(2,3)));*/
-
-
-            // input S1
-            input_edges.push_back(InputEdges());
-            input_edges[0].push_back(Edge(6, 1));
-            input_edges[0].push_back(Edge(26, 11));
-            // input S2
-            input_edges.push_back(InputEdges());
-            input_edges[1].push_back(Edge(1, 0));
-            input_edges[1].push_back(Edge(1, 2));
-            input_edges[1].push_back(Edge(5, 6));
-
-            // output S1
-            output_edges.push_back(OutputEdges());
-            output_edges[0].push_back(Edge(1, 0));
-            output_edges[0].push_back(Edge(1, 2));
-            output_edges[0].push_back(Edge(5, 6));
-            // output S2
-            output_edges.push_back(OutputEdges());
-            output_edges[1].push_back(Edge(6, 1));
-            output_edges[1].push_back(Edge(26, 11));
-
-            // parent
-            parent_connections.push_back(Connection(Port(1,1),Port(2,0)));
-            parent_connections.push_back(Connection(Port(1,1),Port(2,2)));
-            parent_connections.push_back(Connection(Port(1,5),Port(2,6)));
-            parent_connections.push_back(Connection(Port(2,6),Port(1,1)));
-            parent_connections.push_back(Connection(Port(2,26),Port(1,11)));
-        }
-    }
-};
-
-} } } // namespace paradevs tests boost_graph
-
-#endif

+ 0 - 78
src/tests/boost_graph/graph_defs.hpp

@@ -1,78 +0,0 @@
-/**
- * @file tests/boost_graph/graph_defs.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 __TESTS_BOOST_GRAPH_GRAPH_DEFS_HPP
-#define __TESTS_BOOST_GRAPH_GRAPH_DEFS_HPP 1
-
-#include <boost/graph/adjacency_list.hpp>
-
-namespace paradevs { namespace tests { namespace boost_graph {
-
-enum DynamicsType {
-    TOP_PIXEL = 0, NORMAL_PIXEL
-};
-
-struct VertexProperties
-{
-    int          _index;
-    double       _weight;
-    DynamicsType _type;
-
-    VertexProperties() : _index(0), _weight(0), _type(NORMAL_PIXEL)
-    { }
-    VertexProperties(int index, double weight, DynamicsType type) :
-        _index(index), _weight(weight), _type(type)
-    { }
-};
-
-struct EdgeProperties
-{
-    double       _weight;
-
-    EdgeProperties() : _weight(0)
-    { }
-    EdgeProperties(double weight) : _weight(weight)
-    { }
-};
-
-typedef boost::adjacency_list < boost::vecS, boost::vecS, boost::directedS,
-                                VertexProperties, EdgeProperties> OrientedGraph;
-typedef std::vector < OrientedGraph > OrientedGraphs;
-
-typedef std::pair < int, int > Edge;
-typedef std::vector < Edge > Edges;
-typedef Edges OutputEdges;
-typedef Edges InputEdges;
-typedef std::vector < OutputEdges > OutputEdgeList;
-typedef std::vector < InputEdges > InputEdgeList;
-
-typedef std::pair < int, int > Port;
-typedef std::pair < Port, Port > Connection;
-typedef std::vector < Connection > Connections;
-
-} } } // namespace paradevs tests boost_graph
-
-#endif

+ 0 - 758
src/tests/boost_graph/graph_manager.hpp

@@ -1,758 +0,0 @@
-/**
- * @file tests/boost_graph/graph_manager.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 __TESTS_BOOST_GRAPH_GRAPH_MANAGER_HPP
-#define __TESTS_BOOST_GRAPH_GRAPH_MANAGER_HPP 1
-
-#include <common/scheduler/HeapScheduler.hpp>
-#include <common/scheduler/VectorScheduler.hpp>
-
-#include <kernel/pdevs/Coordinator.hpp>
-#include <kernel/pdevs/GraphManager.hpp>
-#include <kernel/pdevs/Simulator.hpp>
-
-#include <kernel/pdevs/multithreading/Coordinator.hpp>
-
-#include <tests/boost_graph/models.hpp>
-#include <tests/boost_graph/graph_partitioning.hpp>
-
-namespace paradevs { namespace tests { namespace boost_graph {
-
-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;
-};
-
-struct GraphParameters
-{
-    OrientedGraph _graph;
-    InputEdges    _input_edges;
-    OutputEdges   _output_edges;
-
-    GraphParameters(const OrientedGraph& graph,
-                    const InputEdges& input_edges,
-                    const OutputEdges& output_edges) :
-        _graph(graph), _input_edges(input_edges), _output_edges(output_edges)
-    { }
-};
-
-template < class SchedulerHandle, class Parameters >
-class FlatGraphManager :
-        public paradevs::pdevs::GraphManager < common::DoubleTime,
-                                               SchedulerHandle,
-                                               Parameters >
-{
-public:
-    FlatGraphManager(common::Coordinator < common::DoubleTime,
-                                           SchedulerHandle >* coordinator,
-        const Parameters& parameters) :
-        paradevs::pdevs::GraphManager < common::DoubleTime, SchedulerHandle,
-                                        Parameters >(
-            coordinator, parameters)
-    { }
-
-    virtual ~FlatGraphManager()
-    {
-        for (typename TopSimulators::const_iterator it =
-                 _top_simulators.begin(); it != _top_simulators.end();
-             ++it) {
-            delete it->second;
-        }
-        for (typename NormalSimulators::const_iterator it =
-                 _normal_simulators.begin(); it != _normal_simulators.end();
-             ++it) {
-            delete it->second;
-        }
-    }
-
-    void build_flat_graph(const OrientedGraph& g, const InputEdges& inputs)
-    {
-        OrientedGraph::vertex_iterator vertexIt, vertexEnd;
-
-        boost::tie(vertexIt, vertexEnd) = boost::vertices(g);
-        for (; vertexIt != vertexEnd; ++vertexIt) {
-            std::ostringstream ss;
-
-            ss << "a" << g[*vertexIt]._index;
-            switch (g[*vertexIt]._type) {
-            case TOP_PIXEL:
-                _top_simulators[g[*vertexIt]._index] =
-                    new pdevs::Simulator <
-                        common::DoubleTime, TopPixel < SchedulerHandle >,
-                        SchedulerHandle,
-                        TopPixelParameters >(ss.str(), TopPixelParameters());
-                _top_simulators[g[*vertexIt]._index]->add_out_port("out");
-                FlatGraphManager < SchedulerHandle, Parameters >::add_child(
-                    _top_simulators[g[*vertexIt]._index]);
-                break;
-            case NORMAL_PIXEL:
-                unsigned int n = 0;
-                OrientedGraph::vertex_iterator vertexIt2, vertexEnd2;
-
-                boost::tie(vertexIt2, vertexEnd2) = boost::vertices(g);
-                for (; vertexIt2 != vertexEnd2; ++vertexIt2) {
-                    OrientedGraph::adjacency_iterator neighbourIt, neighbourEnd;
-
-                    boost::tie(neighbourIt, neighbourEnd) =
-                        boost::adjacent_vertices(*vertexIt2, g);
-                    for (; neighbourIt != neighbourEnd; ++neighbourIt) {
-                        if (g[*neighbourIt]._index == g[*vertexIt]._index) {
-                            ++n;
-                        }
-                    }
-                }
-
-                for (InputEdges::const_iterator it = inputs.begin();
-                     it != inputs.end(); ++it) {
-                    if (g[*vertexIt]._index == it->second) {
-                        ++n;
-                    }
-                }
-                _normal_simulators[g[*vertexIt]._index] =
-                    new pdevs::Simulator <
-                        common::DoubleTime, NormalPixel < SchedulerHandle >,
-                        SchedulerHandle, NormalPixelParameters >(
-                            ss.str(), NormalPixelParameters(n));
-                _normal_simulators[g[*vertexIt]._index]->add_in_port("in");
-                _normal_simulators[g[*vertexIt]._index]->add_out_port("out");
-                FlatGraphManager < SchedulerHandle, Parameters >::add_child(
-                    _normal_simulators[g[*vertexIt]._index]);
-                break;
-            };
-        }
-
-        boost::tie(vertexIt, vertexEnd) = boost::vertices(g);
-        for (; vertexIt != vertexEnd; ++vertexIt)
-        {
-            OrientedGraph::adjacency_iterator neighbourIt, neighbourEnd;
-
-            boost::tie(neighbourIt, neighbourEnd) =
-                boost::adjacent_vertices(*vertexIt, g);
-            for (; neighbourIt != neighbourEnd; ++neighbourIt) {
-                paradevs::common::Model < common::DoubleTime,
-                                          SchedulerHandle >* a = 0;
-                paradevs::common::Model < common::DoubleTime,
-                                          SchedulerHandle >* b = 0;
-
-                if (g[*vertexIt]._type == TOP_PIXEL) {
-                    a = _top_simulators[g[*vertexIt]._index];
-                } else {
-                    a = _normal_simulators[g[*vertexIt]._index];
-                }
-                if (g[*neighbourIt]._type == TOP_PIXEL) {
-                    b = _top_simulators[g[*neighbourIt]._index];
-                } else {
-                    b = _normal_simulators[g[*neighbourIt]._index];
-                }
-                FlatGraphManager < SchedulerHandle,
-                                   Parameters >::add_link(a, "out",
-                                                          b, "in");
-            }
-        }
-    }
-
-protected:
-    typedef std::map < int, pdevs::Simulator <
-                                common::DoubleTime,
-                                TopPixel < SchedulerHandle >,
-                                SchedulerHandle,
-                                TopPixelParameters >* > TopSimulators;
-    typedef std::map < int, pdevs::Simulator <
-                                common::DoubleTime,
-                                NormalPixel < SchedulerHandle >,
-                                SchedulerHandle,
-                                NormalPixelParameters >* > NormalSimulators;
-
-    TopSimulators    _top_simulators;
-    NormalSimulators _normal_simulators;
-};
-
-template < class SchedulerHandle >
-class BuiltFlatGraphManager :
-        public FlatGraphManager < SchedulerHandle, GraphParameters >
-{
-public:
-    BuiltFlatGraphManager(
-        common::Coordinator < common::DoubleTime,
-                              SchedulerHandle >* coordinator,
-        const GraphParameters& parameters) :
-        FlatGraphManager < SchedulerHandle, GraphParameters >(
-            coordinator, parameters)
-    {
-        BuiltFlatGraphManager < SchedulerHandle >::build_flat_graph(
-            parameters._graph, parameters._input_edges);
-        // input
-
-        // std::cout << "Input edges:" << std::endl;
-
-        for (Edges::const_iterator it = parameters._input_edges.begin();
-             it != parameters._input_edges.end(); ++it) {
-            std::ostringstream ss_in;
-
-            ss_in << "in_" << it->first;
-            if (not coordinator->exist_in_port(ss_in.str())) {
-                coordinator->add_in_port(ss_in.str());
-            }
-            BuiltFlatGraphManager < SchedulerHandle>::add_link(
-                coordinator, ss_in.str(),
-                BuiltFlatGraphManager <
-                    SchedulerHandle >::_normal_simulators[it->second], "in");
-
-            // std::cout << "link = " << coordinator->get_name()
-            //           << "::" << ss_in.str() << " -> "
-            //           << BuiltFlatGraphManager <
-            //               SchedulerHandle >::_normal_simulators[it->second]
-            //     ->get_name() << "::" << "in" << std::endl;
-
-        }
-        // output
-
-        // std::cout << "Output edges:" << std::endl;
-
-        for (Edges::const_iterator it = parameters._output_edges.begin();
-             it != parameters._output_edges.end(); ++it) {
-            std::ostringstream ss_out;
-
-            ss_out << "out_" << it->first;
-            if (not coordinator->exist_out_port(ss_out.str())) {
-                coordinator->add_out_port(ss_out.str());
-            }
-
-            if (BuiltFlatGraphManager <
-                    SchedulerHandle >::_normal_simulators.find(it->first) !=
-                BuiltFlatGraphManager <
-                    SchedulerHandle >::_normal_simulators.end()) {
-                if (not BuiltFlatGraphManager < SchedulerHandle>::exist_link(
-                        BuiltFlatGraphManager <
-                            SchedulerHandle >::_normal_simulators[it->first],
-                        "out", coordinator, ss_out.str())) {
-                    BuiltFlatGraphManager < SchedulerHandle>::add_link(
-                        BuiltFlatGraphManager <
-                            SchedulerHandle >::_normal_simulators[it->first],
-                        "out", coordinator, ss_out.str());
-
-                    // std::cout << "link = " << BuiltFlatGraphManager <
-                    //     SchedulerHandle >::_normal_simulators[it->first]
-                    //     ->get_name() << "::" << "out -> "
-                    //           << coordinator->get_name()
-                    //           << "::" << ss_out.str()
-                    //           << std::endl;
-                }
-            } else {
-                if (not BuiltFlatGraphManager < SchedulerHandle>::exist_link(
-                        BuiltFlatGraphManager <
-                            SchedulerHandle >::_top_simulators[it->first],
-                        "out", coordinator, ss_out.str())) {
-                    BuiltFlatGraphManager < SchedulerHandle>::add_link(
-                        BuiltFlatGraphManager <
-                            SchedulerHandle >::_top_simulators[it->first],
-                        "out", coordinator, ss_out.str());
-
-                    // std::cout << "link = " << BuiltFlatGraphManager <
-                    //     SchedulerHandle >::_top_simulators[it->first]
-                    //     ->get_name() << "::" << "out -> "
-                    //           << coordinator->get_name()
-                    //           << "::" << ss_out.str()
-                    //           << std::endl;
-
-                }
-            }
-        }
-    }
-
-    virtual ~BuiltFlatGraphManager()
-    { }
-};
-
-template < class SchedulerHandle >
-class ParallelBuiltFlatGraphManager :
-        public FlatGraphManager < SchedulerHandle, GraphParameters >
-{
-public:
-    ParallelBuiltFlatGraphManager(
-        common::Coordinator < common::DoubleTime,
-                              SchedulerHandle >* coordinator,
-        const GraphParameters& parameters) :
-        FlatGraphManager < SchedulerHandle, GraphParameters >(
-            coordinator, parameters)
-    {
-        ParallelBuiltFlatGraphManager < SchedulerHandle >::build_flat_graph(
-            parameters._graph, parameters._input_edges);
-        // input
-        for (Edges::const_iterator it = parameters._input_edges.begin();
-             it != parameters._input_edges.end(); ++it) {
-            std::ostringstream ss_in;
-
-            ss_in << "in_" << it->first;
-            if (not coordinator->exist_in_port(ss_in.str())) {
-                coordinator->add_in_port(ss_in.str());
-            }
-            ParallelBuiltFlatGraphManager < SchedulerHandle>::add_link(
-                coordinator, ss_in.str(),
-                ParallelBuiltFlatGraphManager <
-                    SchedulerHandle >::_normal_simulators[it->second], "in");
-        }
-        // output
-        for (Edges::const_iterator it = parameters._output_edges.begin();
-             it != parameters._output_edges.end(); ++it) {
-            std::ostringstream ss_out;
-
-            ss_out << "out_" << it->first;
-            if (not coordinator->exist_out_port(ss_out.str())) {
-                coordinator->add_out_port(ss_out.str());
-            }
-            if (not ParallelBuiltFlatGraphManager < SchedulerHandle >::exist_link(
-                ParallelBuiltFlatGraphManager <
-                    SchedulerHandle >::_normal_simulators[it->first], "out",
-                coordinator, ss_out.str())) {
-                ParallelBuiltFlatGraphManager < SchedulerHandle>::add_link(
-                    ParallelBuiltFlatGraphManager <
-                        SchedulerHandle >::_normal_simulators[it->first], "out",
-                    coordinator, ss_out.str());
-            }
-        }
-    }
-
-    void init()
-    { }
-
-    void start(common::DoubleTime::type /* t */)
-    { }
-
-    void transition(
-        const common::Models < common::DoubleTime,
-                               SchedulerHandle >& /* receivers */,
-        common::DoubleTime::type /* t */)
-    { }
-
-    virtual ~ParallelBuiltFlatGraphManager()
-    { }
-};
-
-template < class SchedulerHandle, class GraphBuilder >
-class InBuildFlatGraphManager :
-        public FlatGraphManager < SchedulerHandle,
-                                  paradevs::common::NoParameters >
-{
-public:
-    InBuildFlatGraphManager(
-        common::Coordinator < common::DoubleTime,
-                              SchedulerHandle >* coordinator,
-        const paradevs::common::NoParameters& parameters) :
-        FlatGraphManager < SchedulerHandle, paradevs::common::NoParameters >(
-            coordinator, parameters)
-    {
-        GraphBuilder   builder;
-        OrientedGraphs graphs;
-        InputEdgeList  input_edges;
-        OutputEdgeList output_edges;
-        Connections    parent_connections;
-
-        builder.build(graphs, input_edges, output_edges, parent_connections);
-        InBuildFlatGraphManager < SchedulerHandle,
-                                  GraphBuilder >::build_flat_graph(
-                                      graphs.front(), InputEdges());
-    }
-
-    virtual ~InBuildFlatGraphManager()
-    { }
-};
-
-struct PartitioningParameters
-{
-    int         cluster_number;
-    std::string partitioning_method_name;
-    int         contraction_coef;
-    bool        contraction_coef_flag;
-
-    PartitioningParameters(int cn,
-                           const std::string& pmn,
-                           int cc, bool ccf) :
-        cluster_number(cn), partitioning_method_name(pmn),
-        contraction_coef(cc), contraction_coef_flag(ccf)
-    { }
-};
-
-template < class SchedulerHandle, class GraphBuilder >
-class HeapHierarchicalGraphManager :
-        public paradevs::pdevs::GraphManager < common::DoubleTime,
-                                               SchedulerHandle,
-                                               PartitioningParameters >
-{
-public:
-    HeapHierarchicalGraphManager(
-        common::Coordinator < common::DoubleTime,
-                              SchedulerHandle >* coordinator,
-        const PartitioningParameters& parameters) :
-        paradevs::pdevs::GraphManager < common::DoubleTime, SchedulerHandle,
-                                        PartitioningParameters >(
-                                            coordinator, parameters)
-    {
-        GraphBuilder graph_builder(parameters.cluster_number,
-                                   parameters.partitioning_method_name,
-                                   parameters.contraction_coef,
-                                   parameters.contraction_coef_flag);
-        OrientedGraphs graphs;
-        InputEdgeList  input_edges;
-        OutputEdgeList output_edges;
-        Connections    parent_connections;
-
-        graph_builder.build(graphs, input_edges, output_edges,
-                            parent_connections);
-
-        // build coordinators (graphs)
-        for (unsigned int i = 0; i < graphs.size(); ++i) {
-            Coordinator* coordinator = 0;
-            std::ostringstream ss;
-
-            ss << "S" << i;
-            coordinator =
-                new Coordinator(ss.str(), paradevs::common::NoParameters(),
-                                GraphParameters(graphs[i], input_edges[i],
-                                                output_edges[i]));
-            _coordinators.push_back(coordinator);
-            HeapHierarchicalGraphManager < SchedulerHandle,
-                                           GraphBuilder >::add_child(
-                                               coordinator);
-
-        }
-
-        // std::cout << "Root:" << std::endl;
-
-        // builds internal connections (edges)
-        for (Connections::const_iterator it = parent_connections.begin();
-             it != parent_connections.end(); ++it) {
-            const Connection& connection = *it;
-            std::ostringstream ss_out;
-            std::ostringstream ss_in;
-
-            ss_out << "out_" << connection.first.second;
-            ss_in << "in_" << connection.first.second;
-
-            if (not HeapHierarchicalGraphManager <
-                    SchedulerHandle, GraphBuilder >::exist_link(
-                        _coordinators[connection.first.first - 1],
-                        ss_out.str(),
-                        _coordinators[connection.second.first - 1],
-                        ss_in.str())) {
-
-                // std::cout << "link = "
-                //           << _coordinators[connection.first.first - 1]
-                //     ->get_name()
-                //           << "::" << ss_out.str() << " -> "
-                //           << _coordinators[connection.second.first - 1]
-                //     ->get_name()
-                //           << "::" << ss_in.str() << std::endl;
-
-                HeapHierarchicalGraphManager <
-                    SchedulerHandle, GraphBuilder >::add_link(
-                        _coordinators[connection.first.first - 1],
-                        ss_out.str(),
-                        _coordinators[connection.second.first - 1],
-                        ss_in.str());
-            }
-        }
-    }
-
-    virtual ~HeapHierarchicalGraphManager()
-    {
-        for (typename Coordinators::const_iterator it = _coordinators.begin();
-             it != _coordinators.end(); ++it) {
-            delete *it;
-        }
-    }
-
-private:
-    typedef paradevs::pdevs::Coordinator <
-        common::DoubleTime,
-        SchedulerType,
-        SchedulerHandle,
-        BuiltFlatGraphManager < SchedulerHandle >,
-        common::NoParameters,
-        GraphParameters > Coordinator;
-    typedef std::vector < Coordinator* > Coordinators;
-
-    Coordinators _coordinators;
-};
-
-template < class SchedulerHandle, class GraphBuilder >
-class VectorHierarchicalGraphManager :
-        public paradevs::pdevs::GraphManager < common::DoubleTime,
-                                               SchedulerHandle,
-                                               PartitioningParameters >
-{
-public:
-    VectorHierarchicalGraphManager(
-        common::Coordinator < common::DoubleTime,
-                              SchedulerHandle >* coordinator,
-        const PartitioningParameters& parameters) :
-        paradevs::pdevs::GraphManager < common::DoubleTime, SchedulerHandle,
-                                        PartitioningParameters >(
-                                            coordinator, parameters)
-    {
-        GraphBuilder   graph_builder(parameters.cluster_number,
-                                     parameters.partitioning_method_name,
-                                     parameters.contraction_coef,
-                                     parameters.contraction_coef_flag);
-        OrientedGraphs graphs;
-        InputEdgeList  input_edges;
-        OutputEdgeList output_edges;
-        Connections    parent_connections;
-
-        graph_builder.build(graphs, input_edges, output_edges,
-                            parent_connections);
-
-        // build coordinators (graphs)
-        for (unsigned int i = 0; i < graphs.size(); ++i) {
-            Coordinator* coordinator = 0;
-            std::ostringstream ss;
-
-            ss << "S" << i;
-            coordinator =
-                new Coordinator(ss.str(), paradevs::common::NoParameters(),
-                                GraphParameters(graphs[i], input_edges[i],
-                                                output_edges[i]));
-            _coordinators.push_back(coordinator);
-            VectorHierarchicalGraphManager < SchedulerHandle,
-                                             GraphBuilder >::add_child(
-                                                 coordinator);
-
-        }
-
-        // builds internal connections (edges)
-        for (Connections::const_iterator it = parent_connections.begin();
-             it != parent_connections.end(); ++it) {
-            const Connection& connection = *it;
-            std::ostringstream ss_out;
-            std::ostringstream ss_in;
-
-            ss_out << "out_" << connection.first.second;
-            ss_in << "in_" << connection.first.second;
-
-            if (not VectorHierarchicalGraphManager <
-                    SchedulerHandle, GraphBuilder >::exist_link(
-                        _coordinators[connection.first.first - 1],
-                        ss_out.str(),
-                        _coordinators[connection.second.first - 1],
-                        ss_in.str())) {
-                VectorHierarchicalGraphManager <
-                    SchedulerHandle, GraphBuilder >::add_link(
-                        _coordinators[connection.first.first - 1],
-                        ss_out.str(),
-                        _coordinators[connection.second.first - 1],
-                        ss_in.str());
-            }
-        }
-    }
-
-    virtual ~VectorHierarchicalGraphManager()
-    {
-        for (typename Coordinators::const_iterator it = _coordinators.begin();
-             it != _coordinators.end(); ++it) {
-            delete *it;
-        }
-    }
-
-private:
-    typedef paradevs::pdevs::Coordinator <
-    common::DoubleTime,
-    paradevs::common::scheduler::VectorScheduler <
-        paradevs::common::DoubleTime >,
-    paradevs::common::scheduler::NoSchedulerHandle,
-    BuiltFlatGraphManager < paradevs::common::scheduler::NoSchedulerHandle >,
-    common::NoParameters,
-    GraphParameters > Coordinator;
-    typedef std::vector < Coordinator* > Coordinators;
-
-    Coordinators _coordinators;
-};
-
-template < class SchedulerHandle, class GraphBuilder >
-class ParallelHeapHierarchicalGraphManager :
-        public paradevs::pdevs::GraphManager < common::DoubleTime,
-                                               SchedulerHandle,
-                                               PartitioningParameters >
-{
-public:
-    ParallelHeapHierarchicalGraphManager(
-        common::Coordinator < common::DoubleTime,
-                              SchedulerHandle >* coordinator,
-        const PartitioningParameters& parameters) :
-        paradevs::pdevs::GraphManager < common::DoubleTime, SchedulerHandle,
-                                        PartitioningParameters >(
-                                            coordinator, parameters)
-    {
-        GraphBuilder   graph_builder(parameters.cluster_number,
-                                     parameters.partitioning_method_name,
-                                     parameters.contraction_coef,
-                                     parameters.contraction_coef_flag);
-        OrientedGraphs graphs;
-        InputEdgeList  input_edges;
-        OutputEdgeList output_edges;
-        Connections    parent_connections;
-
-        graph_builder.build(graphs, input_edges, output_edges,
-                            parent_connections);
-
-        // build coordinators (graphs)
-        for (unsigned int i = 0; i < graphs.size(); ++i) {
-            ParallelCoordinator* coordinator = 0;
-            std::ostringstream ss;
-
-            ss << "S" << i;
-            coordinator =
-                new ParallelCoordinator(ss.str(),
-                                        paradevs::common::NoParameters(),
-                                        GraphParameters(graphs[i],
-                                                        input_edges[i],
-                                                        output_edges[i]));
-            _coordinators.push_back(coordinator);
-            ParallelHeapHierarchicalGraphManager < SchedulerHandle,
-                                                   GraphBuilder >::add_child(
-                                                       coordinator);
-
-        }
-
-        // builds internal connections (edges)
-        for (Connections::const_iterator it = parent_connections.begin();
-             it != parent_connections.end(); ++it) {
-            const Connection& connection = *it;
-            std::ostringstream ss_out;
-            std::ostringstream ss_in;
-
-            ss_out << "out_" << connection.first.second;
-            ss_in << "in_" << connection.first.second;
-
-            if (not ParallelHeapHierarchicalGraphManager <
-                    SchedulerHandle, GraphBuilder >::exist_link(
-                        _coordinators[connection.first.first - 1],
-                        ss_out.str(),
-                        _coordinators[connection.second.first - 1],
-                        ss_in.str())) {
-                ParallelHeapHierarchicalGraphManager <
-                    SchedulerHandle, GraphBuilder >::add_link(
-                        _coordinators[connection.first.first - 1],
-                        ss_out.str(),
-                        _coordinators[connection.second.first - 1],
-                        ss_in.str());
-            }
-        }
-    }
-
-    virtual ~ParallelHeapHierarchicalGraphManager()
-    {
-        for (typename Coordinators::const_iterator it = _coordinators.begin();
-             it != _coordinators.end(); ++it) {
-            delete *it;
-        }
-    }
-
-    void init()
-    {
-        for (typename Coordinators::const_iterator it = _coordinators.begin();
-             it != _coordinators.end(); ++it) {
-            (*it)->set_sender(
-                dynamic_cast < paradevs::pdevs::multithreading::Coordinator <
-                    common::DoubleTime,
-                    SchedulerType,
-                    SchedulerHandle,
-                    ParallelHeapHierarchicalGraphManager <
-                        SchedulerHandle,
-                        PartitioningGraphBuilder >,
-                    paradevs::common::NoParameters,
-                    PartitioningParameters >*
-                >(ParallelHeapHierarchicalGraphManager < SchedulerHandle,
-                                                         GraphBuilder >::
-                  get_coordinator())->get_sender());
-        }
-    }
-
-    void start(common::DoubleTime::type t)
-    {
-        for (typename Coordinators::const_iterator it = _coordinators.begin();
-             it != _coordinators.end(); ++it) {
-            (*it)->get_sender().send(
-                paradevs::pdevs::multithreading::start_message <
-                    paradevs::common::DoubleTime >(t));
-        }
-    }
-
-    void transition(const common::Models < common::DoubleTime,
-                    SchedulerHandle >& receivers,
-                    paradevs::common::DoubleTime::type t)
-    {
-        typename Coordinators::const_iterator it = _coordinators.begin();
-        bool found = false;
-
-        while (not found) {
-            if (std::find(receivers.begin(), receivers.end(),
-                          *it) != receivers.end()) {
-                (*it)->get_sender().send(
-                    paradevs::pdevs::multithreading::transition_message <
-                        paradevs::common::DoubleTime >(t));
-                found = true;
-            } else {
-                ++it;
-            }
-        }
-    }
-
-private:
-    typedef paradevs::pdevs::multithreading::Coordinator <
-    common::DoubleTime,
-    SchedulerType,
-    SchedulerHandle,
-    ParallelBuiltFlatGraphManager
-    < SchedulerHandle >,
-    common::NoParameters,
-    GraphParameters > ParallelCoordinator;
-
-    typedef std::vector < ParallelCoordinator* > Coordinators;
-
-    Coordinators _coordinators;
-};
-
-} } } // namespace paradevs tests boost_graph
-
-#endif

+ 0 - 171
src/tests/boost_graph/graph_partitioning.hpp

@@ -1,171 +0,0 @@
-/**
- * @file tests/boost_graph/graph_partitioning.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 __TESTS_BOOST_GRAPH_GRAPH_PARTITIONING_HPP
-#define __TESTS_BOOST_GRAPH_GRAPH_PARTITIONING_HPP 1
-
-#include <tests/boost_graph/graph_defs.hpp>
-#include <tests/boost_graph/partitioning/graph_build.hpp>
-#include <tests/boost_graph/partitioning/gggp.hpp>
-
-#include <boost/graph/copy.hpp>
-
-namespace paradevs { namespace tests { namespace boost_graph {
-
-class PartitioningGraphBuilder
-{
-public:
-    PartitioningGraphBuilder(int cn, std::string pmn, int cc, bool ccf) :
-        cluster_number(cn), partitioning_method_name(pmn),
-        contraction_coef(cc), contraction_coef_flag(ccf)
-    { }
-
-    void build(OrientedGraphs& graphs,
-               InputEdgeList& input_edges,
-               OutputEdgeList& output_edges,
-               Connections& parent_connections)
-    {
-        UnorientedGraph* g = new UnorientedGraph();
-        OrientedGraph go;
-        UnorientedGraph graph_origin;
-
-        // internal examples
-        // {
-        //     build_graph(*g, go);
-        //     boost::copy_graph(*g, graph_origin);
-        // }
-
-        // corsen examples
-        {
-            build_corsen_graph(go);
-            make_unoriented_graph(go, *g);
-            boost::copy_graph(*g, graph_origin);
-        }
-
-        Edges edge_partie;
-        Connections connections;
-
-        output_edges = OutputEdgeList(cluster_number);
-
-        if (contraction_coef_flag) {
-            graphs = Multiniveau(num_vertices(*g) / contraction_coef,
-                                 g, &graph_origin, &go,
-                                 cluster_number, "HEM",
-                                 partitioning_method_name,
-                                 "cut_norm", "norm", edge_partie ,
-                                 output_edges, input_edges,
-                                 parent_connections);
-        } else {
-            graphs = Multiniveau(contraction_coef, g, &graph_origin, &go,
-                                 cluster_number, "HEM",
-                                 partitioning_method_name,
-                                 "cut_norm", "norm", edge_partie ,
-                                 output_edges, input_edges,
-                                 parent_connections);
-        }
-
-        // std::cout << "*********************************" << std::endl;
-        // std::cout << "Graphs:" << std::endl;
-        // for (unsigned int i = 0; i < graphs.size(); ++i) {
-        //     std::cout << "graph[" << i << "]:" << std::endl;
-        //     const OrientedGraph& og = graphs[i];
-        //     OrientedGraph::vertex_iterator it_og, end_og;
-
-        //     tie(it_og, end_og) = vertices(og);
-        //     for (; it_og != end_og; ++it_og) {
-        //         OrientedGraph::adjacency_iterator neighbour_it, neighbour_end;
-
-        //         std::cout << og[*it_og]._index << " -> { ";
-        //         tie(neighbour_it, neighbour_end) = adjacent_vertices(*it_og,
-        //                                                              og);
-        //         for (; neighbour_it != neighbour_end; ++neighbour_it) {
-        //             std::cout << og[*neighbour_it]._index << " ";
-        //         }
-        //         std::cout << "}" << std::endl;
-        //     }
-        // }
-        // {
-        //     unsigned int i = 0;
-
-        //     std::cout << "Input edges:" << std::endl;
-        //     for (InputEdgeList::const_iterator it = input_edges.begin();
-        //          it != input_edges.end(); ++it, ++i) {
-        //         std::cout << "S" << i << " = {";
-        //         for (InputEdges::const_iterator it2 = it->begin();
-        //              it2 != it->end(); ++it2) {
-        //             std::cout << " ( " << it2->first << " -> " << it2->second
-        //                       << " )";
-        //         }
-        //         std::cout << " }" << std::endl;;
-        //     }
-        // }
-        // {
-        //     unsigned int i = 0;
-
-        //     std::cout << "Output edges:" << std::endl;
-        //     for (OutputEdgeList::const_iterator it = output_edges.begin();
-        //          it != output_edges.end(); ++it, ++i) {
-        //         std::cout << "S" << i << " = {";
-        //         for (OutputEdges::const_iterator it2 = it->begin();
-        //              it2 != it->end(); ++it2) {
-        //             std::cout << " ( " << it2->first << " -> " << it2->second
-        //                       << " )";
-        //         }
-        //         std::cout << " }" << std::endl;;
-        //     }
-        // }
-
-        // std::cout << "*********************************" << std::endl;
-
-    }
-
-private:
-    int cluster_number;
-    std::string partitioning_method_name;
-    int contraction_coef;
-    bool contraction_coef_flag;
-};
-
-class CorsenFlatGraphBuilder
-{
-public:
-    CorsenFlatGraphBuilder()
-    { }
-
-    void build(OrientedGraphs& graphs, InputEdgeList& /* input_edges */,
-               OutputEdgeList& /* output_edges */,
-               Connections& /* parent_connections */)
-    {
-        OrientedGraph graph;
-
-        build_corsen_graph(graph);
-        graphs.push_back(graph);
-    }
-};
-
-} } } // namespace paradevs tests boost_graph
-
-#endif

+ 0 - 208
src/tests/boost_graph/models.hpp

@@ -1,208 +0,0 @@
-/**
- * @file tests/boost_graph/models.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 TESTS_BOOST_GRAPH_MODELS_HPP
-#define TESTS_BOOST_GRAPH_MODELS_HPP 1
-
-#include <common/time/DoubleTime.hpp>
-
-#include <kernel/pdevs/Dynamics.hpp>
-
-namespace paradevs { namespace tests { namespace boost_graph {
-
-struct TopPixelParameters
-{ };
-
-template < class SchedulerHandle>
-class TopPixel :
-    public paradevs::pdevs::Dynamics < common::DoubleTime, SchedulerHandle,
-                                       TopPixelParameters >
-{
-public:
-    TopPixel(const std::string& name,
-             const TopPixelParameters& parameters) :
-        paradevs::pdevs::Dynamics < common::DoubleTime, SchedulerHandle,
-                                    TopPixelParameters >(name, parameters)
-    { }
-
-    virtual ~TopPixel()
-    { }
-
-    virtual void dint(typename common::DoubleTime::type /* t */)
-    {
-
-        // std::cout << TopPixel < SchedulerHandle >::get_name() << " at "
-        //           << t << ": dint" << std::endl;
-
-    }
-
-    virtual typename common::DoubleTime::type start(
-        typename common::DoubleTime::type /* t */)
-    { return 0; }
-
-    virtual typename common::DoubleTime::type ta(
-        typename common::DoubleTime::type /* t */) const
-    { return 1; }
-
-    virtual common::Bag < common::DoubleTime, SchedulerHandle > lambda(
-        typename common::DoubleTime::type /* t */) const
-    {
-
-        // std::cout << TopPixel < SchedulerHandle >::get_name() << " at "
-        //           << t << ": lambda" << std::endl;
-
-        common::Bag < common::DoubleTime, SchedulerHandle > bag;
-
-        bag.push_back(common::ExternalEvent < common::DoubleTime,
-                                              SchedulerHandle >("out", 0.));
-        return bag;
-    }
-};
-
-struct NormalPixelParameters
-{
-    NormalPixelParameters(unsigned int n) : _neighbour_number(n)
-    { }
-
-    unsigned int _neighbour_number;
-};
-
-template < class SchedulerHandle>
-class NormalPixel :
-    public paradevs::pdevs::Dynamics < common::DoubleTime, SchedulerHandle,
-                                       NormalPixelParameters >
-{
-public:
-    NormalPixel(const std::string& name,
-             const NormalPixelParameters& parameters) :
-        paradevs::pdevs::Dynamics < common::DoubleTime, SchedulerHandle,
-                                    NormalPixelParameters >(name, parameters),
-        _neighbour_number(parameters._neighbour_number)
-    { }
-
-    virtual ~NormalPixel()
-    { }
-
-    virtual void dint(typename common::DoubleTime::type t)
-    {
-
-        // std::cout << NormalPixel < SchedulerHandle >::get_name() << " at "
-        //           << t << ": dint" << std::endl;
-
-        if (_phase == SEND) {
-            _phase = WAIT;
-            _received = 0;
-            _last_time = t;
-        }
-    }
-
-    virtual void dext(typename common::DoubleTime::type t,
-                      typename common::DoubleTime::type /* e */,
-                      const common::Bag < common::DoubleTime,
-                                          SchedulerHandle >& bag)
-    {
-
-        // std::cout << NormalPixel < SchedulerHandle >::get_name() << " at "
-        //           << t << ": dext -> "
-        //           << bag.to_string() << std::endl;
-
-        for (typename common::Bag < common::DoubleTime,
-                                    SchedulerHandle >::const_iterator it =
-                 bag.begin(); it != bag.end(); ++it) {
-            if (it->on_port("in")) {
-                if (_last_time == t) {
-                    std::cout << "oups !" << std::endl;
-                }
-                ++_received;
-                if (_received == _neighbour_number) {
-                    _phase = SEND;
-                }
-            }
-        }
-
-        // std::cout << NormalPixel < SchedulerHandle >::get_name() << " at "
-        //           << t << ": dext -> "
-        //           << _received << "/" << _neighbour_number
-        //           << std::endl;
-
-    }
-
-    virtual typename common::DoubleTime::type start(
-        typename common::DoubleTime::type /* t */)
-    {
-
-        // std::cout << NormalPixel < SchedulerHandle >::get_name()
-        //           << " = " <<_neighbour_number << std::endl;
-
-        _phase = WAIT;
-        _received = 0;
-        _last_time = common::DoubleTime::negative_infinity;
-        return common::DoubleTime::infinity;
-    }
-
-    virtual typename common::DoubleTime::type ta(
-        typename common::DoubleTime::type /* t */) const
-    {
-
-        // std::cout << NormalPixel < SchedulerHandle >::get_name() << " at "
-        //           << t << ": ta" << std::endl;
-
-        if (_phase == WAIT) {
-            return common::DoubleTime::infinity;
-        } else {
-            return 0;
-        }
-    }
-
-    virtual common::Bag < common::DoubleTime, SchedulerHandle > lambda(
-        typename common::DoubleTime::type /* t */) const
-    {
-
-        // std::cout << NormalPixel < SchedulerHandle >::get_name() << " at "
-        //           << t << ": lambda" << std::endl;
-
-        common::Bag < common::DoubleTime, SchedulerHandle > bag;
-
-        if (_phase == SEND) {
-            bag.push_back(common::ExternalEvent < common::DoubleTime,
-                                                  SchedulerHandle >("out", 0.));
-        }
-        return bag;
-    }
-
-private:
-    enum Phase { WAIT, SEND };
-
-    unsigned int _neighbour_number;
-
-    Phase                             _phase;
-    unsigned int                      _received;
-    typename common::DoubleTime::type _last_time;
-};
-
-} } } // namespace paradevs tests boost_graph
-
-#endif

+ 0 - 31
src/tests/boost_graph/partitioning/CMakeLists.txt

@@ -1,31 +0,0 @@
-INCLUDE_DIRECTORIES(
-  ${PARADEVS_BINARY_DIR}/src
-  ${PARADEVS_SOURCE_DIR}/src
-  ${Boost_INCLUDE_DIRS}
-  ${GLIBMM_INCLUDE_DIRS}
-  ${LIBXML_INCLUDE_DIRS})
-
-LINK_DIRECTORIES(
-  ${GLIBMM_LIBRARY_DIRS}
-  ${LIBXML_LIBRARY_DIR})
-
-SET(PARTITIONING_HPP utils.hpp gggp.hpp graph_build.hpp)
-
-SET(PARTITIONING_CPP utils.cpp gggp.cpp graph_build.cpp)
-
-ADD_LIBRARY(partitioning SHARED ${PARTITIONING_HPP};${PARTITIONING_CPP})
-
-TARGET_LINK_LIBRARIES(partitioning corsen
-  ${Boost_LIBRARIES}
-  ${GLIBMM_LIBRARIES}
-  ${LIBXML_LIBRARIES}
-  ${GTHREAD_LIBRARIES})
-
-ADD_EXECUTABLE(partitioning-tests main.cpp)
-SET_TARGET_PROPERTIES(partitioning-tests PROPERTIES ${PARADEVS_APP_PROPERTIES})
-
-TARGET_LINK_LIBRARIES(partitioning-tests partitioning
-  ${Boost_LIBRARIES}
-  ${GLIBMM_LIBRARIES}
-  ${LIBXML_LIBRARIES}
-  ${GTHREAD_LIBRARIES})

+ 0 - 71
src/tests/boost_graph/partitioning/defs.hpp

@@ -1,71 +0,0 @@
-/**
- * @file tests/boost_graph/partitioning/defs.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 TESTS_BOOST_GRAPH_PARTITIONING_DEFS_H
-#define TESTS_BOOST_GRAPH_PARTITIONING_DEFS_H 1
-
-#include <list>
-#include <vector>
-
-#include <boost/graph/adjacency_list.hpp>
-
-#include <tests/boost_graph/graph_defs.hpp>
-
-namespace paradevs { namespace tests { namespace boost_graph {
-
-typedef unsigned int uint;
-
-typedef std::vector < int > Entiers;
-
-typedef std::vector < Entiers* > EntiersEntiers;
-typedef std::vector < EntiersEntiers > EntiersEntiersEntiers;
-typedef std::list < int > List;
-typedef std::list < EntiersEntiers* > ListEntiersEntiers;
-
-typedef boost::adjacency_list < boost::vecS, boost::vecS, boost::undirectedS,
-                                VertexProperties,
-                                EdgeProperties> UnorientedGraph;
-
-typedef std::vector < UnorientedGraph* > Base_Graph;
-
-typedef boost::graph_traits < UnorientedGraph >::vertex_descriptor vertex_t;
-typedef boost::graph_traits < UnorientedGraph >::edge_descriptor edge_t;
-
-typedef OrientedGraph::vertex_descriptor vertex_to;
-typedef OrientedGraph::edge_descriptor edge_to;
-
-template < class G >
-struct VertexAndEdgeListGraphConcept
-{
-    void constraints() {
-        boost::function_requires < boost::VertexListGraphConcept < G > >();
-        boost::function_requires < boost::EdgeListGraphConcept < G > >();
-    }
-};
-
-} } } // namespace paradevs tests boost_graph
-
-#endif

+ 0 - 939
src/tests/boost_graph/partitioning/gggp.cpp

@@ -1,939 +0,0 @@
-/**
- * @file tests/boost_graph/partitioning/gggp.cpp
- * @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/>.
- */
-
-#include <tests/boost_graph/partitioning/gggp.hpp>
-
-#include <algorithm>
-#include <iostream>
-
-namespace paradevs { namespace tests { namespace boost_graph {
-
-extern UnorientedGraph::vertex_iterator vertexIt, vertexEnd;
-extern UnorientedGraph::adjacency_iterator neighbourIt, neighbourEnd;
-
-extern OrientedGraph::vertex_iterator vertexIto, vertexEndo;
-extern OrientedGraph::adjacency_iterator neighbourIto, neighbourEndo;
-
-void ggp(UnorientedGraph *g, Entiers *sommetsSource,
-               Entiers *sommetsDestination, EntiersEntiers &Partition)
-{
-    //std::cout<<""<<std::endl;
-    int val;
-    Entiers sommets_adj;
-    if(sommetsSource->size()==1){
-        val=0;
-        //std::cout<<"Entré dans le debug ! "<<std::endl;
-        Entiers tailles;
-        for(uint i=0;i<Partition.size();i++){
-            tailles.push_back(Partition.at(i)->size());
-        }
-        uint tmp=*max_element(tailles.begin(),tailles.end());
-        for(uint i=0; i<Partition.size();i++){
-            if(Partition.at(i)->size()==tmp)
-            {
-                ggp(g,Partition[i],sommetsDestination,Partition);
-                return;
-            }
-        }
-    }
-    else
-        val=rand_fini(0,sommetsSource->size()-1);//Tirage aléatoire de l'indice du premier sommet entre 0 et taille du tableau -1
-        //std::cout<<"val : "<<sommetsSource->at(val)<<std::endl;
-    double poids_max=0;
-    for(uint i=0;i<sommetsSource->size();i++){
-        poids_max+=(*g)[sommetsSource->at(i)]._weight;
-    }
-    poids_max/=2.;
-
-    double poids=(*g)[sommetsSource->at(val)]._weight;
-    sommetsDestination->push_back(sommetsSource->at(val));
-    sommetsSource->erase(sommetsSource->begin() + val);
-    int cpt = 0;
-
-   // std::cout<<"taille sommetsSource avant le while : "<<sommetsSource->size()<<std::endl;
-    while(poids<poids_max && sommetsSource->size()>1)
-    {
-        //std::cout<<"taille sommetsSource dans le while "<<sommetsSource->size()<<std::endl;
-        if(cpt<sommetsDestination->size() )
-            adjacence_ggp(sommetsDestination->at(cpt),sommets_adj,g);
-        else{
-            val=rand_fini(0,sommetsSource->size()-1);
-            sommetsDestination->push_back(sommetsSource->at(val));
-            sommetsSource->erase(sommetsSource->begin() + val);
-            adjacence_ggp(sommetsDestination->at(cpt),sommets_adj,g);
-        }
-        /*std::cout<<"adj :"<<std::endl;
-        for(uint a = 0; a<sommets_adj.size(); a++){
-            std::cout<<sommets_adj.at(a)<<std::endl;
-        }*/
-        if(sommets_adj.size()==0)
-        {
-            //std::cout<<"Je suis sorti car pas de voisin !!!! "<<std::endl;
-            for (uint i=0; i<sommetsSource->size();i++)
-            {
-                for (uint j=0; j<sommetsDestination->size();j++)
-                {
-                    remove_edge(sommetsSource->at(i),sommetsDestination->at(j),*g);
-                }
-            }
-            sort(sommetsDestination->begin(), sommetsDestination->end());
-            return;
-        }
-        else{
-            for(uint i =0; i<sommets_adj.size(); i++){
-                if(In_tab(*sommetsDestination,sommets_adj.at(i))!=1 && sommetsSource->size()!=1){
-                    sommetsDestination->push_back(sommets_adj.at(i));
-                    poids+=(*g)[sommets_adj.at(i)]._weight;
-                    suprim_val(*sommetsSource, sommets_adj[i]);
-                }
-                if(poids>poids_max || sommetsSource->size()==1)
-                    break;
-            }
-
-            /*std::cout<<"Sommets_source :"<<std::endl;
-            for(uint i =0; i<sommetsSource->size();i++){
-                std::cout<<sommetsSource->at(i)<<",";
-            }
-            std::cout<<std::endl;
-            std::cout<<"Sommets_destination :"<<std::endl;
-            for(uint i =0; i<sommetsDestination->size();i++){
-                std::cout<<sommetsDestination->at(i)<<",";
-            }
-            std::cout<<std::endl;*/
-
-            if(poids>poids_max  || sommetsSource->size()==1){
-                for (uint i=0; i<sommetsSource->size();i++)
-                {
-                    for (uint j=0; j<sommetsDestination->size();j++)
-                    {
-                        remove_edge(sommetsSource->at(i),sommetsDestination->at(j),*g);
-                    }
-                }
-                sort(sommetsDestination->begin(), sommetsDestination->end());
-                return;
-            }
-
-            sommets_adj.clear();
-            cpt++;
-        }
-
-    }
-
-    for (uint i=0; i<sommetsSource->size();i++)
-    {
-        for (uint j=0; j<sommetsDestination->size();j++)
-        {
-            remove_edge(sommetsSource->at(i),sommetsDestination->at(j),*g);
-        }
-    }
-    sort(sommetsDestination->begin(), sommetsDestination->end());
-}
-
-void Iter_2l(EntiersEntiers &part, int nbr_parties, UnorientedGraph *g,
-             const std::string &nom)
-{
-    if (nom =="gggp"){
-
-        for(int i = 0; i<floor(log(nbr_parties)/log(2)); i++)
-        {
-            for(int j = 0; j< pow(2,i);j++)
-            {
-                Entiers *Q = new Entiers();
-                gggp(g,part[j],Q,part);
-                part.push_back(Q);
-            }
-        }
-    }
-
-    else if (nom =="ggp"){
- for(int i = 0; i<floor(log(nbr_parties)/log(2)); i++)
-        {
-            //std::cout<<"Et un tours de plus !!!! "<<std::endl;
-            for(int j = 0; j< pow(2,i);j++)
-            {
-                Entiers *Q = new Entiers();
-                ggp(g,part[j],Q,part);
-                part.push_back(Q);
-            }
-
-        }
-    }
-
-    else {
-        //std::cout<<"je jsuis dans gggp_pond"<<std::endl;
-
-        for(int i = 0; i<floor(log(nbr_parties)/log(2)); i++)
-        {
-            //std::cout<<"Et un tours de plus !!!! "<<std::endl;
-            for(int j = 0; j< pow(2,i);j++)
-            {
-                Entiers *Q = new Entiers();
-                gggp_pond(g,part.at(j),Q,part);
-                //std::clog<<"sortie du gggp_pond"<<std::endl;
-                part.push_back(Q);
-            }
-            //std::cout<<"\n"<<std::endl;
-
-        }
-    }
-}
-
-void bissectionRec(UnorientedGraph *g, EntiersEntiers &Partition,
-                   int nbr_parties, const std::string &nom)
-{
-    if((nbr_parties&(nbr_parties-1))==0)
-    {
-        //std::cout<<"C'est de la forme 2l : "<<nbr_parties<<std::endl;
-        Iter_2l(Partition,nbr_parties,g,nom);
-    }
-    else
-    {
-        int puissance_2=0;
-
-        Entiers tailles;
-
-        while(pow(2,puissance_2)<nbr_parties)
-            puissance_2++;
-
-        Iter_2l(Partition,pow(2,puissance_2-1),g,nom);
-
-        for(unsigned int i = 0; i< Partition.size() -1 ; i++)
-        {
-            for(EntiersEntiers::iterator it1 = Partition.begin() + i ; it1!=Partition.end(); it1++)
-            {
-                if((*it1)->size() > Partition.at(i)->size())
-                    Partition.at(i)->swap(**it1);
-            }
-        }
-
-        for(int j = 0; j<nbr_parties-pow(2,puissance_2-1);j++)
-        {
-            Entiers *Q = new Entiers();
-            if(nom=="gggp")
-                gggp(g,Partition.at(j),Q,Partition);
-            else if (nom == "ggp")
-                ggp(g,Partition.at(j),Q,Partition);
-            else
-                gggp_pond(g,Partition.at(j),Q,Partition);
-            Partition.push_back(Q);
-        }
-    }
-}
-
-
-
-void gggp(UnorientedGraph *g, Entiers *sommetsSource,
-          Entiers *sommetsDestination, EntiersEntiers &Partition)
-{
-    int val;
-    Entiers sommets_adj;
-
-    if (sommetsSource->size() - 1 == 0) {
-        Entiers tailles;
-
-        val = 0;
-        for (uint i = 0;i < Partition.size(); i++) {
-            tailles.push_back(Partition.at(i)->size());
-        }
-
-        uint tmp = *max_element(tailles.begin(), tailles.end());
-
-        for (uint i = 0; i < Partition.size(); i++) {
-            if (Partition.at(i)->size() == tmp) {
-                gggp(g, Partition.at(i), sommetsDestination, Partition);
-            }
-            break;
-        }
-    } else {
-
-        // Tirage aléatoire de l'indice du premier sommet entre 0 et
-        // taille du tableau -1
-        val = rand_fini(0, sommetsSource->size() - 1);
-    }
-
-    float poids_max=sommetsSource->size()/2.;
-    float poids=1;
-    Entiers sommets_cut;
-
-    //clog<<"Etape 1 : "<<std::endl;
-    sommetsDestination->push_back(sommetsSource->at(val));
-    sommetsSource->erase(sommetsSource->begin() + val);
-
-    if (sommetsSource->size() < 2) {
-        return;
-    }
-
-    while (poids < poids_max) {
-//		for(uint i =0; i< sommetsDestination.size();i++){
-//			std::cout<<sommetsDestination.at(i)<<std::endl;
-//		}
-        Liste_Voisin(*sommetsDestination, sommets_adj, *g);
-        if (sommets_adj.size() == 0) {
-            for (uint i=0; i<sommetsSource->size();i++)
-            {
-                for (uint j=0; j<sommetsDestination->size();j++)
-                {
-                    remove_edge(sommetsSource->at(i),sommetsDestination->at(j),*g);
-                }
-            }
-            sort(sommetsDestination->begin(), sommetsDestination->end());
-            return;
-        } else {
-            /*clog<<"Liste voisin est : "<<std::endl;
-              for(int i=0;i<sommets_adj.size();i++)
-              {
-              std::cout<<sommets_adj[i]<<std::endl;
-              }*/
-            std::sort(sommets_adj.begin(), sommets_adj.end());
-            for (uint i = 0; i < sommets_adj.size(); i++) {
-                sommets_cut.push_back(Cout_coupe(*sommetsDestination,
-                                                 sommets_adj[i], *g));
-            }
-
-            int tmp = recherche_val(sommets_cut,
-                                    *min_element(sommets_cut.begin(),
-                                                 sommets_cut.end()));
-            sommetsDestination->push_back(sommets_adj[tmp]);
-            suprim_val(*sommetsSource, sommets_adj[tmp]);
-            suprim_val(sommets_adj, sommets_adj[tmp]);
-
-            sommets_cut.clear();
-            poids++;
-        }
-    }
-
-    for (uint i = 0; i < sommetsSource->size(); i++) {
-        for (uint j = 0; j < sommetsDestination->size(); j++) {
-            remove_edge(sommetsSource->at(i), sommetsDestination->at(j), *g);
-        }
-    }
-    sort(sommetsDestination->begin(), sommetsDestination->end());
-}
-
-void gggp_pond(UnorientedGraph *g, Entiers *sommetsSource,
-               Entiers *sommetsDestination, EntiersEntiers &Partition)
-{
-    int val;
-    Entiers sommets_adj;
-    if(sommetsSource->size()==1){
-        val=0;
-        Entiers tailles;
-        for(uint i=0;i<Partition.size();i++){
-            tailles.push_back(Partition.at(i)->size());
-        }
-        uint tmp=*max_element(tailles.begin(),tailles.end());
-        for(uint i=0; i<Partition.size();i++){
-            if(Partition.at(i)->size()==tmp)
-            {
-                gggp_pond(g,Partition[i],sommetsDestination,Partition);
-                return;
-            }
-        }
-    }
-    else
-        val=rand_fini(0,sommetsSource->size()-1);
-    double poids_max=0;
-    for(uint i=0;i<sommetsSource->size();i++){
-        poids_max+=(*g)[sommetsSource->at(i)]._weight;
-    }
-    poids_max/=2.;
-    double poids=(*g)[sommetsSource->at(val)]._weight;
-    std::vector<float> sommets_cut;
-    float cut = Degree(*g,sommetsSource->at(val));
-    sommetsDestination->push_back(sommetsSource->at(val));
-    sommetsSource->erase(sommetsSource->begin() + val);
-
-    while(poids<poids_max && sommetsSource->size()>1)
-    {
-        Liste_Voisin(*sommetsDestination,sommets_adj,*g);
-        if(sommets_adj.size()==0)
-        {
-            for (uint i=0; i<sommetsSource->size();i++)
-            {
-                for (uint j=0; j<sommetsDestination->size();j++)
-                {
-                    remove_edge(sommetsSource->at(i),sommetsDestination->at(j),*g);
-                }
-            }
-            sort(sommetsDestination->begin(), sommetsDestination->end());
-            return;
-        }
-        else{
-            sort(sommets_adj.begin(), sommets_adj.end());
-
-            for(uint i=0;i<sommets_adj.size();i++)
-            {
-                sommets_cut.push_back(modif_Cout_coupe(*sommetsDestination,sommets_adj.at(i),cut,g));
-            }
-
-            cut = *min_element(sommets_cut.begin(),sommets_cut.end());
-            sommetsDestination->push_back(sommets_adj[recherche_val2(sommets_cut,*min_element(sommets_cut.begin(),sommets_cut.end()))]);
-            poids+=(*g)[sommets_adj[recherche_val2(sommets_cut,*min_element(sommets_cut.begin(),sommets_cut.end()))]]._weight;
-            suprim_val(*sommetsSource, sommets_adj[recherche_val2(sommets_cut,*min_element(sommets_cut.begin(),sommets_cut.end()))]);
-            suprim_val(sommets_adj, sommets_adj[recherche_val2(sommets_cut,*min_element(sommets_cut.begin(),sommets_cut.end()))]);
-
-            sommets_cut.clear();
-
-        }
-    }
-
-    for (uint i=0; i<sommetsSource->size();i++)
-    {
-        for (uint j=0; j<sommetsDestination->size();j++)
-        {
-            remove_edge(sommetsSource->at(i),sommetsDestination->at(j),*g);
-        }
-    }
-    sort(sommetsDestination->begin(), sommetsDestination->end());
-
-}
-
-// void gggp_pond(UnorientedGraph *g, Entiers *sommetsSource,
-//                Entiers *sommetsDestination, EntiersEntiers &Partition)
-// {
-//     int val;
-//     Entiers sommets_adj;
-//     if(sommetsSource->size()==1){
-//         val=0;
-//         //std::cout<<"Entré dans le debug ! "<<std::endl;
-//         Entiers tailles;
-//         for(uint i=0;i<Partition.size();i++){
-//             tailles.push_back(Partition.at(i)->size());
-//         }
-//         uint tmp=*max_element(tailles.begin(),tailles.end());
-//         for(uint i=0; i<Partition.size();i++){
-//             if(Partition.at(i)->size()==tmp)
-//             {
-//                 gggp_pond(g,Partition[i],sommetsDestination,Partition);
-//             	return;
-//             }
-//         }
-//     }
-//     else
-//         val=rand_fini(0,sommetsSource->size()-1);//Tirage aléatoire de l'indice du premier sommet entre 0 et taille du tableau -1
-//     	//std::cout<<"val : "<<sommetsSource->at(val)<<std::endl;
-//     double poids_max=0;
-//     for(uint i=0;i<sommetsSource->size();i++){
-//         poids_max+=(*g)[sommetsSource->at(i)]._weight;
-//     }
-//     poids_max/=2.;
-//     double poids=(*g)[sommetsSource->at(val)]._weight;
-//     std::vector<float> sommets_cut;
-//     float  cut = Degree(*g,sommetsSource->at(val));
-
-//     sommetsDestination->push_back(sommetsSource->at(val));
-//     sommetsSource->erase(sommetsSource->begin() + val);
-
-//    // std::cout<<"taille sommetsSource avant le while : "<<sommetsSource->size()<<std::endl;
-//     while(poids<poids_max && sommetsSource->size()>1)
-//     {
-//     	//std::cout<<"taille sommetsSource dans le while "<<sommetsSource->size()<<std::endl;
-//         Liste_Voisin(*sommetsDestination,sommets_adj,*g);
-//         if(sommets_adj.size()==0)
-//         {
-//             //std::cout<<"Je suis sorti car pas de voisin !!!! "<<std::endl;
-//             for (uint i=0; i<sommetsSource->size();i++)
-//             {
-//                 for (uint j=0; j<sommetsDestination->size();j++)
-//                 {
-//                     remove_edge(sommetsSource->at(i),sommetsDestination->at(j),*g);
-//                 }
-//             }
-//             sort(sommetsDestination->begin(), sommetsDestination->end());
-//             return;
-//         }
-//         else{
-//             sort(sommets_adj.begin(), sommets_adj.end());
-
-//             /*std::cout<<"adj :"<<std::endl;
-//             for(uint a = 0; a<sommets_adj.size(); a++){
-//             	std::cout<<sommets_adj.at(a)<<std::endl;
-//             }
-//             std::cout<<std::endl;*/
-
-//             for(uint i=0;i<sommets_adj.size();i++)
-//             {
-//                 sommets_cut.push_back(modif_Cout_coupe(*sommetsDestination, sommets_adj.at(i), cut, g));
-//                 // sommets_cut.push_back(Cout_coupe_pond(*sommetsDestination,sommets_adj[i],*g));
-//             }
-//             /*std::cout<<"cut :"<<std::endl;
-//             for(uint a = 0; a<sommets_cut.size(); a++){
-//             	std::cout<<sommets_cut.at(a)<<std::endl;
-//             }
-//             std::cout<<std::endl;*/
-//             sommetsDestination->push_back(sommets_adj[recherche_val2(sommets_cut,*min_element(sommets_cut.begin(),sommets_cut.end()))]);
-//             //std::cout<<"Sommet deplacé : "<<sommets_adj[recherche_val2(sommets_cut,*min_element(sommets_cut.begin(),sommets_cut.end()))]<<std::endl;
-//             poids+=(*g)[sommets_adj[recherche_val2(sommets_cut,*min_element(sommets_cut.begin(),sommets_cut.end()))]]._weight;
-//             suprim_val(*sommetsSource, sommets_adj[recherche_val2(sommets_cut,*min_element(sommets_cut.begin(),sommets_cut.end()))]);
-//             suprim_val(sommets_adj, sommets_adj[recherche_val2(sommets_cut,*min_element(sommets_cut.begin(),sommets_cut.end()))]);
-
-//             sommets_cut.clear();
-
-//         }
-
-//         /*for(uint i =0; i<sommetsSource->size();i++){
-//         	std::cout<<sommetsSource->at(i)<<",";
-//         }
-//         std::cout<<std::endl;
-//         for(uint i =0; i<sommetsDestination->size();i++){
-//         	std::cout<<sommetsDestination->at(i)<<",";
-//         }
-//         std::cout<<std::endl;*/
-
-//     }
-
-//     for (uint i=0; i<sommetsSource->size();i++)
-//     {
-//         for (uint j=0; j<sommetsDestination->size();j++)
-//         {
-//             remove_edge(sommetsSource->at(i),sommetsDestination->at(j),*g);
-//         }
-//     }
-//     sort(sommetsDestination->begin(), sommetsDestination->end());
-
-//     //std::cout<<"fin du gggp_pond"<<std::endl;
-// }
-
-// void Iter_2l(EntiersEntiers &part, int nbr_parties, UnorientedGraph *g,
-//              const std::string &nom)
-// {
-//     if (nom!="gggp_pond"){
-//         //std::cout<<"je jsuis dans gggp"<<std::endl;
-
-//         for(int i = 0; i<floor(log(nbr_parties)/log(2)); i++)
-//         {
-//             //std::cout<<"Et un tours de plus !!!! "<<std::endl;
-//             for(int j = 0; j< pow(2,i);j++)
-//             {
-//                 Entiers *Q = new Entiers();
-//                 gggp(g,part[j],Q,part);
-//                 part.push_back(Q);
-//             }
-
-//         }
-//     } else {
-//         //std::cout<<"je jsuis dans gggp_pond"<<std::endl;
-
-//         for(int i = 0; i<floor(log(nbr_parties)/log(2)); i++)
-//         {
-//             //std::cout<<"Et un tours de plus !!!! "<<std::endl;
-//             for(int j = 0; j< pow(2,i);j++)
-//             {
-//                 Entiers *Q = new Entiers();
-//                 gggp_pond(g,part.at(j),Q,part);
-//                 //std::clog<<"sortie du gggp_pond"<<std::endl;
-//                 part.push_back(Q);
-//             }
-//             //std::cout<<"\n"<<std::endl;
-
-//         }
-//     }
-// }
-
-// void bissectionRec(UnorientedGraph *g, EntiersEntiers &Partition,
-//                    int nbr_parties, const std::string &nom)
-// {
-//     if((nbr_parties&(nbr_parties-1))==0)
-//     {
-//         //std::cout<<"C'est de la forme 2l : "<<nbr_parties<<std::endl;
-//         Iter_2l(Partition,nbr_parties,g,nom);
-//     }
-//     else
-//     {
-//         int puissance_2=0;
-
-//         Entiers tailles;
-
-//         while(pow(2,puissance_2)<nbr_parties)
-//             puissance_2++;
-
-//         Iter_2l(Partition,pow(2,puissance_2-1),g,nom);
-
-//         for(unsigned int i = 0; i< Partition.size() -1 ; i++)
-//         {
-//             for(EntiersEntiers::iterator it1 = Partition.begin() + i ; it1!=Partition.end(); it1++)
-//             {
-//                 if((*it1)->size() > Partition.at(i)->size())
-//                     Partition.at(i)->swap(**it1);
-//             }
-//         }
-
-//         for(int j = 0; j<nbr_parties-pow(2,puissance_2-1);j++)
-//         {
-//             Entiers *Q = new Entiers();
-//             if(nom!="gggp_pond")
-//                 gggp(g,Partition.at(j),Q,Partition);
-//             else
-//                 gggp_pond(g,Partition.at(j),Q,Partition);
-//             Partition.push_back(Q);
-//         }
-//     }
-//     // std::cout<<"Partition avant affinage "<<std::endl;
-//     // for(uint i = 0 ; i<Partition.size(); i++){
-//     // 	for(uint j = 0 ; j<Partition.at(i)->size(); j++){
-//     // 		std::cout<<Partition.at(i)->at(j)<<" ";
-//     // 	}
-//     // 	std::cout<<"\n"<<std::endl;
-//     // }
-// }
-
-/**
- * Fonction réalisant un partitionnement pseudo aléatoire suivant un voisinage.
- * @param *g : adresse d'un graphe de type boost graphe undirected
- * @param Partition : vecteur contenant des vecteurs d'entiers [tableau contenant les parties de la partition]
- * @param nbr_partie : entier correspondant au nombre de parties voulues pour la partition
- * @return
- */
-
-void Pseudo_random_partitioning(UnorientedGraph *g, EntiersEntiers &Partition,
-                                uint nbr_parties)
-{
-    /*
-     * Principe : distribution des sommets de la première partie en plusieurs autres parties
-     * Le partitionnement étant pseudo aléatoire il n'y a pas de contrainte stricte sur le nombre
-     * de sommets par partie
-     */
-
-
-    uint size = Partition.at(0)->size();
-    uint cpt_sommets=1;
-    int val;
-    uint cpt;
-
-    if(nbr_parties==size){
-        for(uint i = 0; i < nbr_parties;i++){
-            if(Partition.at(0)->size()!=1)
-            {
-                val=rand_fini(0,Partition.at(0)->size()-1);//tirage aléatoire d'un sommets
-            }
-            else
-                val=0;
-
-            int vertex = Partition.at(0)->at(val);
-            Entiers *part = new Entiers();
-            part->push_back(vertex);// ajout du sommet tiré
-            suprim_val(*Partition.at(0),vertex);//suppression du sommet dans la premiere partie
-
-        }
-    }
-    /*
-     * Boucle sur le nombre de partie à réaliser
-     */
-    for(uint i = 0; i < nbr_parties-1;i++){
-        if(Partition.at(0)->size()!=1)
-        {
-            val=rand_fini(0,Partition.at(0)->size()-1);//tirage aléatoire d'un sommets
-        }
-        else
-            val=0;
-        int vertex = Partition.at(0)->at(val);
-        /*
-         * Initialisation d'un pointeur sur un vecteur d'entier, dans notre cas
-         * la n+1 ième partie de la partition
-         */
-        Entiers *part = new Entiers();
-        part->push_back(vertex);// ajout du sommet tiré
-        suprim_val(*Partition.at(0),vertex);//suppression du sommet dans la premiere partie
-        cpt=1;
-
-        /*
-         * Pour chaque element de la nouvelle partie faire
-         */
-        for(uint j = 0; j<part->size();j++){
-            /*
-             * Détermination des voisins de chacun des sommets de cette nouvelle
-             * partie et ajoue de ce voisin si celui-ci est présent dans la première partie (Partition[0])
-             */
-            tie(neighbourIt, neighbourEnd) = adjacent_vertices(part->at(j),*g);
-            for (; neighbourIt != neighbourEnd; ++neighbourIt){
-                if(In_tab(*Partition.at(0),*neighbourIt)==1){
-                    // std::cout<<"le voisin déplacé est : "<<*neighbourIt<<std::endl;
-                    part->push_back(*neighbourIt);
-                    cpt_sommets++;
-                    suprim_val(*Partition.at(0),*neighbourIt);
-                    cpt++;
-                }
-                /*
-                 * Si le nombre moyen de sommets est atteind dans la partie on sort de la boucle des voisins
-                 * Même chose si l'on a rencontré le nombre total de sommets
-                 */
-                if(cpt==(size/nbr_parties)+1)
-                    break;
-                if(cpt_sommets==size)
-                    break;
-            }
-
-            /*
-             * Même chose
-             */
-            if(cpt==(size/nbr_parties)+1)
-                break;
-            if(cpt_sommets==size)
-                break;
-        }
-        Partition.push_back(part);// ajoue de la nouvelle partie à la partition
-        if(cpt_sommets==size)
-            break;
-    }
-}
-
-EntiersEntiers Random_partitioning(UnorientedGraph *g,
-                                uint nbr_parties)
-{
-	EntiersEntiers Partition;
-	Entiers random_order; //gestion d'un tableau contenant tout les sommets et ranger de façon aléatoire
-
-	for (uint i=0 ; i<num_vertices(*g) ; i++)
-		random_order.push_back(i);
-	for (uint j=0 ; j<num_vertices(*g)-1 ; j++) {
-		int rand_pos = rand()%(num_vertices(*g)-j)+j;
-		int tmp      = random_order.at(j);
-		random_order.at(j) = random_order.at(rand_pos);
-		random_order.at(rand_pos) = tmp;
-	}
-
-	uint size = num_vertices(*g)/nbr_parties;
-	for(uint j = 0 ; j < nbr_parties-1 ; j++){
-		Entiers *part = new Entiers();
-		for(uint i = j*size; i<(j+1)*size; i++){
-			part->push_back(random_order.at(i));
-		}
-		Partition.push_back(part);
-	}
-
-	Entiers *part = new Entiers();
-	for(uint i = (nbr_parties-1)*size; i < random_order.size(); i++){
-		part->push_back(random_order.at(i));
-	}
-	Partition.push_back(part);
-
-	for(uint i = 0 ; i < Partition.size() ; i++){
-		sort(Partition.at(i)->begin(),Partition.at(i)->end());
-	}
-
-	return Partition;
-}
-
-OrientedGraphs Multiniveau(uint niveau_contraction,
-                           UnorientedGraph *g,
-                           UnorientedGraph *graph_origin,
-                           OrientedGraph *go,
-                           int nbr_parties,
-                           std::string contraction,
-                           std::string type_methode,
-                           std::string choix_affinage,
-                           std::string type_cut,
-                           Edges& /* edge_partie */,
-                           OutputEdgeList& outputedgelist,
-                           InputEdgeList& inputedgelist,
-                           Connections& connections)
-{
-    EntiersEntiers Partition;
-    Entiers *part = new Entiers();
-    Base_Graph baseg;
-    baseg.push_back(g);
-    ListEntiersEntiers liste_corr;
-    uint cpt =0;
-
-    int val_cpt = num_vertices(*g);
-    bool stop = false;
-
-    if (niveau_contraction == val_cpt) {
-        stop = true;
-    }
-
-    while(stop != true)
-    {
-    	if(contraction == "HEM")
-    		stop = contraction_HEM(baseg.at(cpt),baseg,liste_corr,niveau_contraction,val_cpt);
-    	else
-    		stop = contraction_Random_Maching(baseg.at(cpt),baseg,liste_corr,niveau_contraction,val_cpt);
-        cpt++;
-        // std::cout<<"passage"<<std::endl;
-    }
-
-    // std::cout<<"Graphe contracté : "<<std::endl;
-    // for (uint i = 0; i< baseg.size(); i++) {
-    //     tie(vertexIt, vertexEnd) = vertices(*baseg[i]);
-    //     for (; vertexIt != vertexEnd; ++vertexIt) {
-    //         std::cout << (*baseg[i])[*vertexIt]._index
-    //                   << " est connecté avec ";
-    //         tie(neighbourIt, neighbourEnd) = adjacent_vertices(*vertexIt,
-    //         		*baseg[i]);
-    //         for (; neighbourIt != neighbourEnd; ++neighbourIt)
-    //             std::cout << (*baseg[i])[*neighbourIt]._index << " ";
-    //         std::cout << " et son poids est de "
-    //                   << (*baseg[i])[*vertexIt]._weight<<std::endl;
-    //     }
-    //     std::cout << std::endl;
-    // }
-    UnorientedGraph *gtmp = new UnorientedGraph();
-    *gtmp = *baseg.at(baseg.size() - 1);
-    // std::cout<<"Partitionnement "<<std::endl;
-    if(type_methode == "gggp_pond" || type_methode == "gggp" || type_methode == "ggp"){
-		for(uint i = 0;i < num_vertices(*baseg.at(baseg.size() - 1)); i++)
-		{
-			part->push_back(i);
-		}
-		Partition.push_back(part);
-		bissectionRec(baseg.at(baseg.size()-1),Partition,nbr_parties,type_methode);
-		double cut_norm = Cut_cluster(Partition,*gtmp,"norm");
-		// std::cout<<"Cout de coupe normalisé initial : "<<cut_norm<<std::
-                    // endl;
-		int cpt_part = 0;
-		while (cpt_part!=3){
-			EntiersEntiers new_Partition;
-			Entiers *new_part = new Entiers();
-			for(uint i = 0;i < num_vertices(*baseg.at(baseg.size() - 1)); i++)
-			{
-				new_part->push_back(i);
-			}
-			new_Partition.push_back(new_part);
-			bissectionRec(baseg.at(baseg.size()-1),new_Partition,nbr_parties,type_methode);
-			double new_cut_norm = Cut_cluster(new_Partition,*gtmp,"norm");
-			// std::cout<<"Nouveau cout de coupe normalisé : "<<new_cut_norm<<std::endl;
-
-			if(new_cut_norm<cut_norm){
-				// std::cout<<"Changement !!!"<<std::endl;
-				for(EntiersEntiers::iterator it = Partition.begin(); it != Partition.end(); it++)
-				{
-					delete *it;
-					*it = NULL;
-				}
-				Partition = new_Partition;
-				cut_norm = new_cut_norm;
-			}
-			else{
-				for(EntiersEntiers::iterator it = new_Partition.begin(); it != new_Partition.end(); it++)
-				{
-					delete *it;
-					*it = NULL;
-				}
-			}
-			cpt_part++;
-		}
-		// std::cout<<std::endl;
-		// std::cout<<"Cout de coupe normalisé conservé : "<<cut_norm<<std::endl;
-		delete gtmp;
-    }
-    else
-    	Partition = Random_partitioning(baseg.at(baseg.size()-1),nbr_parties);
-    // std::cout<<std::endl;
-
-    ListEntiersEntiers::iterator lit(liste_corr.end());
-    bool proj;
-    uint taille_list = liste_corr.size();
-    if(liste_corr.size()==0){
-    	taille_list = 1;
-    	proj = true;
-    }
-    else{
-    	lit--;
-    	proj = false;
-    }
-
-    for(uint y =0; y<taille_list;y++){
-    	if(proj != true){
-    		// std::cout<<"Projection "<<std::endl;
-    		projection(Partition,lit);
-    		// std::cout<<std::endl;
-    		double cut = Cut_cluster(Partition,*baseg.at(baseg.size()-2-y),type_cut);
-    		// std::cout<<"Cout de coupe avant affinage : "<<cut<<std::endl;
-    		// std::cout<<std::endl;
-    		// std::cout<<"Affinage "<<std::endl;
-    		if(choix_affinage=="charge")
-    			Affinage_equilibrage_charge(baseg.at(baseg.size()-2-y),Partition);
-    		else
-    			Affinage_recherche_locale(baseg.at(baseg.size()-2-y),Partition,cut,type_cut);
-
-    		lit--;
-    	}
-    	else{
-    		// std::cout<<"Pas de projection "<<std::endl;
-    		// std::cout<<std::endl;
-
-    		if(nbr_parties != num_vertices(*g)){
-    			// std::cout<<"Affinage "<<std::endl;
-        		double cut = Cut_cluster(Partition,*graph_origin,type_cut);
-        		// std::cout<<"Cout de coupe avant affinage : "<<cut<<std::
-                            // endl;
-    			if(choix_affinage=="charge")
-    				Affinage_equilibrage_charge(graph_origin,Partition);
-    			else{
-    				Affinage_recherche_locale(graph_origin,Partition,cut,type_cut);
-    				// std::cout<<"Cout de coupe après affinage : "<<cut<<std::endl;
-    			}
-    		}
-    		// else
-    			// std::cout<<"Pas d'affinage "<<std::endl;
-    	}
-
-    }
-
-    OrientedGraphs Graphes = Graph_Partition(Partition, go, graph_origin, outputedgelist,
-                                             inputedgelist, connections);
-
-    // std::cout<<std::endl;
-    // std::cout<<"Résultat de la partition "<<std::endl;
-    // for(uint k=0; k<Partition.size(); k++)
-    // {
-    // 	for(uint j=0; j<Partition.at(k)->size(); j++)
-    // 	{
-    // 		std::cout<<Partition.at(k)->at(j)<<" ";
-    // 	}
-    // 	std::cout<<"\n"<<std::endl;
-    // }
-
-	double cut = Cut_cluster(Partition,*graph_origin,"cut");
-	// std::cout<<"Cout de coupe engendré par le partitionnement: "<<cut<<std::endl;
-
-
-    for(EntiersEntiers::iterator it = Partition.begin(); it != Partition.end(); it++)
-    {
-        delete *it;
-        *it = NULL;
-    }
-
-    for(ListEntiersEntiers::iterator it = liste_corr.begin(); it != liste_corr.end(); it++)
-    {
-        for(EntiersEntiers::iterator it1 = (*it)->begin(); it1 != (*it)->end(); it1++)
-        {
-            delete *it1;
-            *it1 = NULL;
-        }
-        delete *it;
-        *it = NULL;
-    }
-
-    for(Base_Graph::iterator it = baseg.begin(); it != baseg.end(); it++)
-    {
-        delete *it;
-        *it = NULL;
-    }
-    return Graphes;
-}
-
-} } } // namespace paradevs tests boost_graph

+ 0 - 68
src/tests/boost_graph/partitioning/gggp.hpp

@@ -1,68 +0,0 @@
-/**
- * @file tests/boost_graph/partitioning/gggp.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 TESTS_BOOST_GRAPH_PARTITIONING_GGGP_H
-#define TESTS_BOOST_GRAPH_PARTITIONING_GGGP_H 1
-
-#include <tests/boost_graph/partitioning/utils.hpp>
-
-namespace paradevs { namespace tests { namespace boost_graph {
-
-void ggp(UnorientedGraph *g, Entiers *sommetsSource,
-         Entiers *sommetsDestination, EntiersEntiers &Partition);
-
-void gggp(UnorientedGraph *g, Entiers *sommetsSource,
-          Entiers *sommetsDestination, EntiersEntiers &Partition);
-
-void gggp_pond(UnorientedGraph *g, Entiers *sommetsSource,
-               Entiers *sommetsDestination, EntiersEntiers &Partition);
-
-void Iter_2l(EntiersEntiers &part, int nbr_parties, UnorientedGraph *g,
-             const std::string &nom);
-
-void bissectionRec(UnorientedGraph *g, EntiersEntiers &Partition,
-                   int nbr_parties, const std::string &nom);
-
-void Pseudo_random_partitioning(UnorientedGraph *g, EntiersEntiers &Partition,
-                                uint nbr_parties);
-
-EntiersEntiers Random_partitioning(UnorientedGraph *g,
-                                uint nbr_parties);
-
-OrientedGraphs Multiniveau(uint niveau_contraction, UnorientedGraph *g, UnorientedGraph *graph_origin,
-                           OrientedGraph *go, int nbr_parties,
-                           std::string contraction,
-                           std::string type_methode,
-                           std::string choix_affinage,
-                           std::string type_cut,
-                           Edges &edge_partie,
-                           OutputEdgeList &outputedgeslist,
-                           InputEdgeList &inputedgelist,
-                           Connections &connections);
-
-} } } // namespace paradevs tests boost_graph
-
-#endif

+ 0 - 434
src/tests/boost_graph/partitioning/graph_build.cpp

@@ -1,434 +0,0 @@
-/**
- * @file tests/boost_graph/partitioning/graph_build.cpp
- * @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/>.
- */
-
-#include <tests/boost_graph/partitioning/graph_build.hpp>
-
-#include <tests/corsen/lib/Corsen.hpp>
-
-namespace paradevs { namespace tests { namespace boost_graph {
-
-void build_graph(UnorientedGraph& ug, OrientedGraph& og)
-{
-
-    /*
-     * construction graphe Oriente
-     */
-    vertex_to v0 = boost::add_vertex(og);
-    vertex_to v1 = boost::add_vertex(og);
-    vertex_to v2 = boost::add_vertex(og);
-    vertex_to v3 = boost::add_vertex(og);
-    vertex_to v4 = boost::add_vertex(og);
-    vertex_to v5 = boost::add_vertex(og);
-    vertex_to v6 = boost::add_vertex(og);
-    vertex_to v7 = boost::add_vertex(og);
-    vertex_to v8 = boost::add_vertex(og);
-    vertex_to v9 = boost::add_vertex(og);
-    vertex_to v10 = boost::add_vertex(og);
-    vertex_to v11 = boost::add_vertex(og);
-    vertex_to v12 = boost::add_vertex(og);
-    vertex_to v13 = boost::add_vertex(og);
-    vertex_to v14 = boost::add_vertex(og);
-    vertex_to v15 = boost::add_vertex(og);
-    vertex_to v16 = boost::add_vertex(og);
-    vertex_to v17 = boost::add_vertex(og);
-    vertex_to v18 = boost::add_vertex(og);
-    vertex_to v19 = boost::add_vertex(og);
-    vertex_to v20 = boost::add_vertex(og);
-    vertex_to v21 = boost::add_vertex(og);
-    vertex_to v22 = boost::add_vertex(og);
-    vertex_to v23 = boost::add_vertex(og);
-    vertex_to v24 = boost::add_vertex(og);
-    vertex_to v25 = boost::add_vertex(og);
-    vertex_to v26 = boost::add_vertex(og);
-    vertex_to v27 = boost::add_vertex(og);
-    vertex_to v28 = boost::add_vertex(og);
-    vertex_to v29 = boost::add_vertex(og);
-    vertex_to v30 = boost::add_vertex(og);
-    vertex_to v31 = boost::add_vertex(og);
-    vertex_to v32 = boost::add_vertex(og);
-    vertex_to v33 = boost::add_vertex(og);
-    vertex_to v34 = boost::add_vertex(og);
-    vertex_to v35 = boost::add_vertex(og);
-    vertex_to v36 = boost::add_vertex(og);
-    vertex_to v37 = boost::add_vertex(og);
-
-
-
-    add_edge(v1, v0, EdgeProperties(1.), og);
-    add_edge(v2, v0, EdgeProperties(1.), og);
-    add_edge(v3, v0, EdgeProperties(1.), og);
-    add_edge(v1, v2, EdgeProperties(1.), og);
-    add_edge(v4, v1, EdgeProperties(1.), og);
-    add_edge(v5, v1, EdgeProperties(1.), og);
-    add_edge(v6, v1, EdgeProperties(1.), og);
-    add_edge(v6, v2, EdgeProperties(1.), og);
-    add_edge(v2, v3, EdgeProperties(1.), og);
-    add_edge(v9, v3, EdgeProperties(1.), og);
-    add_edge(v10, v3, EdgeProperties(1.), og);
-    add_edge(v4, v5, EdgeProperties(1.), og);
-    add_edge(v5, v6, EdgeProperties(1.), og);
-    add_edge(v7, v4, EdgeProperties(1.), og);
-    add_edge(v8, v4, EdgeProperties(1.), og);
-    add_edge(v7, v8, EdgeProperties(1.), og);
-    add_edge(v9, v10, EdgeProperties(1.), og);
-    add_edge(v8, v11, EdgeProperties(1.), og);
-    add_edge(v11, v4, EdgeProperties(1.), og);
-    add_edge(v12, v13, EdgeProperties(1.), og);
-    add_edge(v12, v7, EdgeProperties(1.), og);
-    add_edge(v13, v7, EdgeProperties(1.), og);
-    add_edge(v14, v15, EdgeProperties(1.), og);
-    add_edge(v14, v12, EdgeProperties(1.), og);
-    add_edge(v15, v16, EdgeProperties(1.), og);
-    add_edge(v15, v12, EdgeProperties(1.), og);
-    add_edge(v16, v17, EdgeProperties(1.), og);
-    add_edge(v16, v12, EdgeProperties(1.), og);
-    add_edge(v17, v12, EdgeProperties(1.), og);
-    add_edge(v18, v19, EdgeProperties(1.), og);
-    add_edge(v18, v8, EdgeProperties(1.), og);
-    add_edge(v19, v20, EdgeProperties(1.), og);
-    add_edge(v19, v8, EdgeProperties(1.), og);
-    add_edge(v20, v8, EdgeProperties(1.), og);
-    add_edge(v21, v22, EdgeProperties(1.), og);
-    add_edge(v21, v19, EdgeProperties(1.), og);
-    add_edge(v22, v23, EdgeProperties(1.), og);
-    add_edge(v22, v19, EdgeProperties(1.), og);
-    add_edge(v23, v19, EdgeProperties(1.), og);
-    add_edge(v24, v25, EdgeProperties(1.), og);
-    add_edge(v24, v6, EdgeProperties(1.), og);
-    add_edge(v25, v6, EdgeProperties(1.), og);
-    add_edge(v26, v11, EdgeProperties(1.), og);
-    add_edge(v26, v27, EdgeProperties(1.), og);
-    add_edge(v26, v24, EdgeProperties(1.), og);
-    add_edge(v27, v24, EdgeProperties(1.), og);
-    add_edge(v28, v25, EdgeProperties(1.), og);
-    add_edge(v29, v27, EdgeProperties(1.), og);
-    add_edge(v29, v28, EdgeProperties(1.), og);
-    add_edge(v30, v27, EdgeProperties(1.), og);
-    add_edge(v30, v28, EdgeProperties(1.), og);
-    add_edge(v31, v32, EdgeProperties(1.), og);
-    add_edge(v31, v10, EdgeProperties(1.), og);
-    add_edge(v32, v33, EdgeProperties(1.), og);
-    add_edge(v32, v10, EdgeProperties(1.), og);
-    add_edge(v33, v10, EdgeProperties(1.), og);
-    add_edge(v34, v31, EdgeProperties(1.), og);
-    add_edge(v34, v35, EdgeProperties(1.), og);
-    add_edge(v35, v31, EdgeProperties(1.), og);
-    add_edge(v35, v32, EdgeProperties(1.), og);
-    add_edge(v36, v32, EdgeProperties(1.), og);
-    add_edge(v36, v37, EdgeProperties(1.), og);
-    add_edge(v36, v33, EdgeProperties(1.), og);
-    add_edge(v37, v33, EdgeProperties(1.), og);
-
-
-    /*og[v6] = VertexProperties(6, 1.5, NORMAL_PIXEL);
-    og[v8] = VertexProperties(8, 1., NORMAL_PIXEL);
-    og[v10] = VertexProperties(10, 1.5, NORMAL_PIXEL);
-    og[v0] = VertexProperties(0, 3, NORMAL_PIXEL);
-    og[v1] = VertexProperties(1, 2, NORMAL_PIXEL);
-    og[v2] = VertexProperties(2, 2, NORMAL_PIXEL);
-    og[v3] = VertexProperties(3, 2, NORMAL_PIXEL);
-    og[v4] = VertexProperties(4, 1.5, NORMAL_PIXEL);
-    og[v5] = VertexProperties(5, 1.5, NORMAL_PIXEL);
-    og[v7] = VertexProperties(7, 1., TOP_PIXEL);
-    og[v9] = VertexProperties(9, 1.5, TOP_PIXEL);*/
-
-    og[v6] = VertexProperties(6, 2.5, NORMAL_PIXEL);
-    og[v8] = VertexProperties(8, 2., NORMAL_PIXEL);
-    og[v10] = VertexProperties(10, 2.5, NORMAL_PIXEL);
-    og[v0] = VertexProperties(0, 4, NORMAL_PIXEL);
-    og[v1] = VertexProperties(1, 3, NORMAL_PIXEL);
-    og[v2] = VertexProperties(2, 3, NORMAL_PIXEL);
-    og[v3] = VertexProperties(3, 3, NORMAL_PIXEL);
-    og[v4] = VertexProperties(4, 2.5, NORMAL_PIXEL);
-    og[v5] = VertexProperties(5, 2.5, NORMAL_PIXEL);
-    og[v7] = VertexProperties(7, 2., NORMAL_PIXEL);
-    og[v9] = VertexProperties(9, 2.5, TOP_PIXEL);
-    og[v11] = VertexProperties(11, 2, NORMAL_PIXEL);
-    og[v12] = VertexProperties(12, 1.5, NORMAL_PIXEL);
-    og[v13] = VertexProperties(13, 1.5, NORMAL_PIXEL);
-    og[v14] = VertexProperties(14, 1, TOP_PIXEL);
-    og[v15] = VertexProperties(15, 1, NORMAL_PIXEL);
-    og[v16] = VertexProperties(16, 1, NORMAL_PIXEL);
-    og[v17] = VertexProperties(17, 1, NORMAL_PIXEL);
-    og[v18] = VertexProperties(18, 1.5, TOP_PIXEL);
-    og[v19] = VertexProperties(19, 1.5, NORMAL_PIXEL);
-    og[v20] = VertexProperties(20, 1.5, NORMAL_PIXEL);
-    og[v21] = VertexProperties(21, 1, TOP_PIXEL);
-    og[v22] = VertexProperties(22, 1, NORMAL_PIXEL);
-    og[v23] = VertexProperties(23, 1, NORMAL_PIXEL);
-    og[v24] = VertexProperties(24, 2, NORMAL_PIXEL);
-    og[v25] = VertexProperties(25, 2, NORMAL_PIXEL);
-    og[v26] = VertexProperties(26, 1.5, TOP_PIXEL);
-    og[v27] = VertexProperties(27, 1.5, NORMAL_PIXEL);
-    og[v28] = VertexProperties(28, 1.5, NORMAL_PIXEL);
-    og[v29] = VertexProperties(29, 1, TOP_PIXEL);
-    og[v30] = VertexProperties(30, 1, TOP_PIXEL);
-    og[v31] = VertexProperties(31, 2, NORMAL_PIXEL);
-    og[v32] = VertexProperties(32, 2, NORMAL_PIXEL);
-    og[v33] = VertexProperties(33, 2, NORMAL_PIXEL);
-    og[v34] = VertexProperties(34, 1.5, TOP_PIXEL);
-    og[v35] = VertexProperties(35, 1.5, NORMAL_PIXEL);
-    og[v36] = VertexProperties(36, 1.5, TOP_PIXEL);
-    og[v37] = VertexProperties(37, 1.5, NORMAL_PIXEL);
-
-
-    /*
-     * construction graphe Non Oriente
-     */
-
-    vertex_t v01 = boost::add_vertex(ug);
-    vertex_t v1r1 = boost::add_vertex(ug);
-    vertex_t v2r1 = boost::add_vertex(ug);
-    vertex_t v3r1 = boost::add_vertex(ug);
-    vertex_t v41 = boost::add_vertex(ug);
-    vertex_t v51 = boost::add_vertex(ug);
-    vertex_t v61 = boost::add_vertex(ug);
-    vertex_t v71 = boost::add_vertex(ug);
-    vertex_t v81 = boost::add_vertex(ug);
-    vertex_t v91 = boost::add_vertex(ug);
-    vertex_t v101 = boost::add_vertex(ug);
-    vertex_t v111 = boost::add_vertex(ug);
-    vertex_t v121 = boost::add_vertex(ug);
-    vertex_t v131 = boost::add_vertex(ug);
-    vertex_t v141 = boost::add_vertex(ug);
-    vertex_t v151 = boost::add_vertex(ug);
-    vertex_t v161 = boost::add_vertex(ug);
-    vertex_t v171 = boost::add_vertex(ug);
-    vertex_t v181 = boost::add_vertex(ug);
-    vertex_t v191 = boost::add_vertex(ug);
-    vertex_t v201 = boost::add_vertex(ug);
-    vertex_t v211 = boost::add_vertex(ug);
-    vertex_t v221 = boost::add_vertex(ug);
-    vertex_t v231 = boost::add_vertex(ug);
-    vertex_t v241 = boost::add_vertex(ug);
-    vertex_t v251 = boost::add_vertex(ug);
-    vertex_t v261 = boost::add_vertex(ug);
-    vertex_t v271 = boost::add_vertex(ug);
-    vertex_t v281 = boost::add_vertex(ug);
-    vertex_t v291 = boost::add_vertex(ug);
-    vertex_t v301 = boost::add_vertex(ug);
-    vertex_t v311 = boost::add_vertex(ug);
-    vertex_t v321 = boost::add_vertex(ug);
-    vertex_t v331 = boost::add_vertex(ug);
-    vertex_t v341 = boost::add_vertex(ug);
-    vertex_t v351 = boost::add_vertex(ug);
-    vertex_t v361 = boost::add_vertex(ug);
-    vertex_t v371 = boost::add_vertex(ug);
-
-    boost::add_edge(v01, v1r1, EdgeProperties(1.), ug);
-    boost::add_edge(v01, v2r1, EdgeProperties(1.), ug);
-    boost::add_edge(v01, v3r1, EdgeProperties(1.), ug);
-    boost::add_edge(v1r1, v2r1, EdgeProperties(1.), ug);
-    boost::add_edge(v1r1, v41, EdgeProperties(1.), ug);
-    boost::add_edge(v1r1, v51, EdgeProperties(1.), ug);
-    boost::add_edge(v1r1, v61, EdgeProperties(1.), ug);
-    boost::add_edge(v2r1, v61, EdgeProperties(1.), ug);
-    boost::add_edge(v2r1, v3r1, EdgeProperties(1.), ug);
-    boost::add_edge(v3r1, v91, EdgeProperties(1.), ug);
-    boost::add_edge(v3r1, v101, EdgeProperties(1.), ug);
-    boost::add_edge(v41, v51, EdgeProperties(1.), ug);
-    boost::add_edge(v51, v61, EdgeProperties(1.), ug);
-    boost::add_edge(v41, v71, EdgeProperties(1.), ug);
-    boost::add_edge(v41, v81, EdgeProperties(1.), ug);
-    boost::add_edge(v71, v81, EdgeProperties(1.), ug);
-    boost::add_edge(v91, v101, EdgeProperties(1.), ug);
-    boost::add_edge(v41, v111, EdgeProperties(1.), ug);
-    boost::add_edge(v71, v121, EdgeProperties(1.), ug);
-    boost::add_edge(v71, v131, EdgeProperties(1.), ug);
-    boost::add_edge(v121, v131, EdgeProperties(1.), ug);
-    boost::add_edge(v121, v141, EdgeProperties(1.), ug);
-    boost::add_edge(v121, v151, EdgeProperties(1.), ug);
-    boost::add_edge(v121, v161, EdgeProperties(1.), ug);
-    boost::add_edge(v121, v171, EdgeProperties(1.), ug);
-    boost::add_edge(v141, v151, EdgeProperties(1.), ug);
-    boost::add_edge(v151, v161, EdgeProperties(1.), ug);
-    boost::add_edge(v161, v171, EdgeProperties(1.), ug);
-    boost::add_edge(v81, v111, EdgeProperties(1.), ug);
-    boost::add_edge(v81, v181, EdgeProperties(1.), ug);
-    boost::add_edge(v81, v191, EdgeProperties(1.), ug);
-    boost::add_edge(v81, v201, EdgeProperties(1.), ug);
-    boost::add_edge(v181, v191, EdgeProperties(1.), ug);
-    boost::add_edge(v191, v201, EdgeProperties(1.), ug);
-    boost::add_edge(v191, v211, EdgeProperties(1.), ug);
-    boost::add_edge(v191, v221, EdgeProperties(1.), ug);
-    boost::add_edge(v191, v231, EdgeProperties(1.), ug);
-    boost::add_edge(v211, v221, EdgeProperties(1.), ug);
-    boost::add_edge(v221, v231, EdgeProperties(1.), ug);
-    boost::add_edge(v111, v261, EdgeProperties(1.), ug);
-    boost::add_edge(v61, v241, EdgeProperties(1.), ug);
-    boost::add_edge(v61, v251, EdgeProperties(1.), ug);
-    boost::add_edge(v241, v251, EdgeProperties(1.), ug);
-    boost::add_edge(v241, v261, EdgeProperties(1.), ug);
-    boost::add_edge(v241, v271, EdgeProperties(1.), ug);
-    boost::add_edge(v261, v271, EdgeProperties(1.), ug);
-    boost::add_edge(v251, v281, EdgeProperties(1.), ug);
-    boost::add_edge(v271, v291, EdgeProperties(1.), ug);
-    boost::add_edge(v271, v301, EdgeProperties(1.), ug);
-    boost::add_edge(v281, v291, EdgeProperties(1.), ug);
-    boost::add_edge(v281, v301, EdgeProperties(1.), ug);
-    boost::add_edge(v101, v311, EdgeProperties(1.), ug);
-    boost::add_edge(v101, v321, EdgeProperties(1.), ug);
-    boost::add_edge(v101, v331, EdgeProperties(1.), ug);
-    boost::add_edge(v311, v321, EdgeProperties(1.), ug);
-    boost::add_edge(v321, v331, EdgeProperties(1.), ug);
-    boost::add_edge(v311, v341, EdgeProperties(1.), ug);
-    boost::add_edge(v311, v351, EdgeProperties(1.), ug);
-    boost::add_edge(v321, v351, EdgeProperties(1.), ug);
-    boost::add_edge(v321, v361, EdgeProperties(1.), ug);
-    boost::add_edge(v331, v361, EdgeProperties(1.), ug);
-    boost::add_edge(v331, v371, EdgeProperties(1.), ug);
-    boost::add_edge(v341, v351, EdgeProperties(1.), ug);
-    boost::add_edge(v361, v371, EdgeProperties(1.), ug);
-
-    /*ug[v61] = VertexProperties(60, 1.5, NORMAL_PIXEL);
-    ug[v81] = VertexProperties(80, 1, NORMAL_PIXEL);
-    ug[v101] = VertexProperties(100, 1.5, NORMAL_PIXEL);
-    ug[v01] = VertexProperties(0, 3, NORMAL_PIXEL);
-    ug[v1r1] = VertexProperties(10, 2, NORMAL_PIXEL);
-    ug[v2r1] = VertexProperties(20, 2, NORMAL_PIXEL);
-    ug[v3r1] = VertexProperties(30, 2, NORMAL_PIXEL);
-    ug[v41] = VertexProperties(40, 1.5, NORMAL_PIXEL);
-    ug[v51] = VertexProperties(50, 1.5, NORMAL_PIXEL);
-    ug[v71] = VertexProperties(70, 1, TOP_PIXEL);
-    ug[v91] = VertexProperties(90, 1.5, TOP_PIXEL);*/
-
-    ug[v6] = VertexProperties(6, 2.5, NORMAL_PIXEL);
-    ug[v8] = VertexProperties(8, 2., NORMAL_PIXEL);
-    ug[v10] = VertexProperties(10, 2.5, NORMAL_PIXEL);
-    ug[v0] = VertexProperties(0, 4, NORMAL_PIXEL);
-    ug[v1] = VertexProperties(1, 3, NORMAL_PIXEL);
-    ug[v2] = VertexProperties(2, 3, NORMAL_PIXEL);
-    ug[v3] = VertexProperties(3, 3, NORMAL_PIXEL);
-    ug[v4] = VertexProperties(4, 2.5, NORMAL_PIXEL);
-    ug[v5] = VertexProperties(5, 2.5, NORMAL_PIXEL);
-    ug[v7] = VertexProperties(7, 2., NORMAL_PIXEL);
-    ug[v9] = VertexProperties(9, 2.5, TOP_PIXEL);
-    ug[v11] = VertexProperties(11, 2, NORMAL_PIXEL);
-    ug[v12] = VertexProperties(12, 1.5, NORMAL_PIXEL);
-    ug[v13] = VertexProperties(13, 1.5, NORMAL_PIXEL);
-    ug[v14] = VertexProperties(14, 1, TOP_PIXEL);
-    ug[v15] = VertexProperties(15, 1, NORMAL_PIXEL);
-    ug[v16] = VertexProperties(16, 1, NORMAL_PIXEL);
-    ug[v17] = VertexProperties(17, 1, NORMAL_PIXEL);
-    ug[v18] = VertexProperties(18, 1.5, TOP_PIXEL);
-    ug[v19] = VertexProperties(19, 1.5, NORMAL_PIXEL);
-    ug[v20] = VertexProperties(20, 1.5, NORMAL_PIXEL);
-    ug[v21] = VertexProperties(21, 1, TOP_PIXEL);
-    ug[v22] = VertexProperties(22, 1, NORMAL_PIXEL);
-    ug[v23] = VertexProperties(23, 1, NORMAL_PIXEL);
-    ug[v24] = VertexProperties(24, 2, NORMAL_PIXEL);
-    ug[v25] = VertexProperties(25, 2, NORMAL_PIXEL);
-    ug[v26] = VertexProperties(26, 1.5, TOP_PIXEL);
-    ug[v27] = VertexProperties(27, 1.5, NORMAL_PIXEL);
-    ug[v28] = VertexProperties(28, 1.5, NORMAL_PIXEL);
-    ug[v29] = VertexProperties(29, 1, TOP_PIXEL);
-    ug[v30] = VertexProperties(30, 1, TOP_PIXEL);
-    ug[v31] = VertexProperties(31, 2, NORMAL_PIXEL);
-    ug[v32] = VertexProperties(32, 2, NORMAL_PIXEL);
-    ug[v33] = VertexProperties(33, 2, NORMAL_PIXEL);
-    ug[v34] = VertexProperties(34, 1.5, TOP_PIXEL);
-    ug[v35] = VertexProperties(35, 1.5, NORMAL_PIXEL);
-    ug[v36] = VertexProperties(36, 1.5, TOP_PIXEL);
-    ug[v37] = VertexProperties(37, 1.5, NORMAL_PIXEL);
-
-}
-
-void modify_file_paths(std::string& absolutePath,
-                       std::vector < std::string* >& files)
-{
-    for (std::vector < std::string* >::iterator it = files.begin();
-         it != files.end(); it++) {
-        (*it)->insert(0, absolutePath);
-    }
-}
-
-void build_corsen_graph(OrientedGraph& graph)
-{
-    std::string absolutePath(
-        "/home/eric/vle/vle-labs/paradevs/src/tests/corsen/data_s/");
-    std::string modeFile(".mode");
-    std::string parametersFile("par.txt");
-    std::string elevationFile("alt");
-    std::string outletFile("arbre");
-    std::string layersFile("couche");
-    std::string contextFile("contexte_yar_scenario.xml");
-    std::string slopeFile("pav");
-    std::vector < std::string* > files;
-    Corsen c;
-
-    files.push_back(&parametersFile);
-    files.push_back(&modeFile);
-    files.push_back(&elevationFile);
-    files.push_back(&outletFile);
-    files.push_back(&slopeFile);
-    files.push_back(&contextFile);
-    files.push_back(&layersFile);
-    modify_file_paths(absolutePath, files);
-
-    c.read(files, absolutePath);
-    c.buildGraph();
-
-    const DirectedGraph& g = c.getGraph().graph();
-    std::vector < vertex_t > og_vertex_list;
-    std::vector < vertex_t > dg_vertex_list;
-    std::vector < int > dg_in_vertex_list;
-    DirectedGraph::vertex_iterator it_dg, end_dg;
-
-    tie(it_dg, end_dg) = vertices(g);
-    for (uint i = 0; it_dg != end_dg; ++it_dg, ++i) {
-        og_vertex_list.push_back(add_vertex(graph));
-        dg_vertex_list.push_back(*it_dg);
-        dg_in_vertex_list.push_back(0);
-    }
-
-    tie(it_dg, end_dg) = vertices(g);
-    for (uint i = 0; it_dg != end_dg; ++it_dg, ++i) {
-        DirectedGraph::adjacency_iterator neighbour_it, neighbour_end;
-
-        tie(neighbour_it, neighbour_end) = adjacent_vertices(*it_dg, g);
-        for (; neighbour_it != neighbour_end; ++neighbour_it) {
-            uint index = 0;
-
-            while (dg_vertex_list[index] != *neighbour_it) {
-                ++index;
-            }
-            ++dg_in_vertex_list[index];
-            boost::add_edge(og_vertex_list[i], og_vertex_list[index],
-                            EdgeProperties(1.), graph);
-        }
-    }
-
-    tie(it_dg, end_dg) = vertices(g);
-    for (uint i = 0; it_dg != end_dg; ++it_dg, ++i) {
-        if (dg_in_vertex_list[i] == 0) {
-            graph[og_vertex_list[i]] = VertexProperties(i, 1., TOP_PIXEL);
-        } else {
-            graph[og_vertex_list[i]] = VertexProperties(i, 1., NORMAL_PIXEL);
-        }
-    }
-}
-
-} } } // namespace paradevs tests boost_graph

+ 0 - 39
src/tests/boost_graph/partitioning/graph_build.hpp

@@ -1,39 +0,0 @@
-/**
- * @file tests/boost_graph/partitioning/graph_build.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 TESTS_BOOST_GRAPH_PARTITIONING_GRAPH_BUILD_H
-#define TESTS_BOOST_GRAPH_PARTITIONING_GRAPH_BUILD_H
-
-#include <tests/boost_graph/partitioning/defs.hpp>
-
-namespace paradevs { namespace tests { namespace boost_graph {
-
-void build_graph(UnorientedGraph& g, OrientedGraph& graph);
-void build_corsen_graph(OrientedGraph& graph);
-
-} } } // namespace paradevs tests boost_graph
-
-#endif

+ 0 - 132
src/tests/boost_graph/partitioning/main.cpp

@@ -1,132 +0,0 @@
-/**
- * @file tests/boost_graph/partitioning/main.cpp
- * @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/>.
- */
-
-#include <tests/boost_graph/partitioning/gggp.hpp>
-#include <tests/boost_graph/partitioning/graph_build.hpp>
-
-#include <boost/timer.hpp>
-
-#include <iostream>
-
-using namespace paradevs::tests::boost_graph;
-
-UnorientedGraph::vertex_iterator vertexIt, vertexEnd;
-UnorientedGraph::adjacency_iterator neighbourIt, neighbourEnd;
-
-OrientedGraph::vertex_iterator vertexIto, vertexEndo;
-OrientedGraph::adjacency_iterator neighbourIto, neighbourEndo;
-
-int main()
-{
-    boost::timer t;
-
-    srand((unsigned)time(NULL));
-
-    UnorientedGraph* g = new UnorientedGraph();
-    OrientedGraph* go = new OrientedGraph();
-    UnorientedGraph* graph_origin = new UnorientedGraph();
-    OrientedGraph* gop = new OrientedGraph();
-
-    build_graph(*g, *go);
-    build_graph(*graph_origin, *gop);
-
-    delete gop;
-
-    int nbr_parties = 4;
-
-    /*EntiersEntiers Partition = Random_partitioning(g,nbr_parties);
-
-    for(uint i = 0; i < Partition.size(); i++){
-    	for(uint j = 0; j < Partition.at(i)->size(); j++){
-    		std::cout<<Partition.at(i)->at(j)<<std::endl;
-    	}
-    	std::cout<<std::endl;
-    }
-
-    std::cout<<Partition.size()<<std::endl;*/
-
-    Edges edge_partie;
-    OutputEdgeList outputedgeslist(nbr_parties);
-    InputEdgeList inputedgelist;
-    Connections connections;
-
-    std::cout<<num_vertices(*g)/4<<std::endl;
-
-    OrientedGraphs graphs = Multiniveau(num_vertices(*g)/2, g, graph_origin, go, nbr_parties,"rand", "gggp_pond",
-                                        "cut_norm", "norm", edge_partie ,
-                                        outputedgeslist, inputedgelist,
-                                        connections);
-
-    std::cout << std::endl;
-    std::cout << "Sous Graphes :" << std::endl;
-    for (uint i = 0; i< graphs.size(); i++) {
-        tie(vertexIto, vertexEndo) = vertices(graphs[i]);
-        for (; vertexIto != vertexEndo; ++vertexIto) {
-            std::cout << graphs[i][*vertexIto]._index
-                      << " est connecté avec ";
-            tie(neighbourIto, neighbourEndo) = adjacent_vertices(*vertexIto,
-                                                                 graphs[i]);
-            for (; neighbourIto != neighbourEndo; ++neighbourIto)
-                std::cout << graphs[i][*neighbourIto]._index << " ";
-            std::cout << " et son poids est de "
-                      << graphs[i][*vertexIto]._weight<<std::endl;
-        }
-        std::cout << std::endl;
-    }
-
-    std::clog << "OutputEdgeList :" << std::endl;
-    for (uint i = 0; i < outputedgeslist.size(); i++) {
-        for (uint j = 0; j < outputedgeslist.at(i).size(); j++){
-            std::cout << outputedgeslist.at(i).at(j).first << " "
-                      << outputedgeslist.at(i).at(j).second << std::endl;
-        }
-    }
-    std::cout << std::endl;
-
-    std::clog << "InputEdgeList :" << std::endl;
-    for (uint i = 0; i < inputedgelist.size(); i++) {
-        for (uint j = 0; j < inputedgelist.at(i).size(); j++){
-            std::cout << inputedgelist.at(i).at(j).first << " "
-                      << inputedgelist.at(i).at(j).second << std::endl;
-        }
-    }
-    std::cout << std::endl;
-
-    std::clog << "Connections :" << std::endl;
-    for (uint i = 0; i < connections.size(); i++) {
-        std::cout << "(" << connections.at(i).first.first << ","
-                  << connections.at(i).first.second << ") -> ("
-                  << connections.at(i).second.first << ","
-                  << connections.at(i).second.second << ")"
-                  << std::endl;
-    }
-
-	delete graph_origin;
-	delete go;
-
-    std::cout << "Duration : " << t.elapsed() << " seconds" << std::endl;
-
-}

+ 0 - 1588
src/tests/boost_graph/partitioning/utils.cpp

@@ -1,1588 +0,0 @@
-/**
- * @file tests/boost_graph/partitioning/utils.cpp
- * @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/>.
- */
-
-#include <tests/boost_graph/partitioning/utils.hpp>
-
-#include <algorithm>
-#include <iostream>
-
-namespace paradevs { namespace tests { namespace boost_graph {
-
-UnorientedGraph::vertex_iterator vertexIt, vertexEnd;
-UnorientedGraph::adjacency_iterator neighbourIt, neighbourEnd;
-
-OrientedGraph::vertex_iterator vertexIto, vertexEndo;
-OrientedGraph::adjacency_iterator neighbourIto, neighbourEndo;
-
-struct myclass
-{
-    bool operator() (Entiers *i, Entiers *j)
-    { return i->at(0) < j->at(0); }
-} myobject;
-
-struct myclass2
-{
-    bool operator() (Entiers *i, Entiers *j, UnorientedGraph *g)
-    { return Calcul_poids(i,g) < Calcul_poids(j,g); }
-} mon_tri;
-
-/**
- * Fonction de verification de la connexité d'un graphe
- * @param *g : adresse d'un graphe de type boost graphe undirected
- * @param Partition : vecteur contenant des vecteurs d'entiers [tableau contenant les parties de la partition]
- * @param part : vecteur d'entier (une partie de la partition)
- * @return un booleen
- */
-bool Est_connexe(UnorientedGraph *g, EntiersEntiers Partition, Entiers &part)
-{
-    /*
-     * Copie du graphe contenu par l'adresse *g
-     */
-    UnorientedGraph copie_g;
-    copie_g = *g;
-
-    /*
-     * Modification du graphe copié afin de générer des sous graphes liés aux différentes parties
-     */
-    for (uint i=0; i<Partition.size()-1;i++)
-    {
-        for (uint j=1+i; j<Partition.size();j++)
-        {
-            for (uint k=0; k<Partition.at(i)->size();k++)
-            {
-                for (uint y=0; y<Partition.at(j)->size();y++)
-                {
-                    remove_edge(Partition.at(i)->at(k),Partition.at(j)->at(y),copie_g); //suppression de certains arcs
-                }
-            }
-        }
-    }
-
-    /*
-     * Objectif : déterminer s'il existe un chemin reliant tous les noeuds d'une même partie
-     * Méthode : partir d'un sommet de départ tiré aléatoirement dans la partie "part" et parcourir l'ensemble de ces voisins.
-     * Si le voisin recontré n'est pas contenu dans le vecteur "sommets" il est ajouté. Le processus est répété pour chaque
-     * nouveau sommet ajouté au vecteur.
-     * Résultat : si le nombre de sommets contenu dans le vecteur "part" est égale au nombre de sommets du vecteur "sommets"
-     * alors le graphe est connexe
-     */
-
-    int val;
-    Entiers sommets;
-
-    if(part.size()==1)
-        val = 0;
-    else
-        val=rand_fini(0,part.size()-1); //tirage aléatoire d'un sommets
-
-    int vertex = part.at(val);
-    sommets.push_back(vertex); //ajout du sommets à la lsite des sommets parcouru
-
-    /*
-     * Recherche de voisins n'appartenant pas à la liste des sommets parcourus
-     */
-    for(uint i = 0;i<sommets.size();i++){
-        tie(neighbourIt, neighbourEnd) = adjacent_vertices(sommets.at(i),copie_g);
-        for (; neighbourIt != neighbourEnd; ++neighbourIt){
-            if(In_tab(sommets,*neighbourIt)!=1)
-                sommets.push_back(*neighbourIt);
-        }
-    }
-
-    /*
-     * Retour de la réponse vrai ou faux
-     */
-    if(part.size()!=sommets.size())
-        return false;
-    else
-        return true;
-
-}
-
-/**
- * Fonction de projection
- * @param Partition : vecteur contenant des vecteurs d'entiers [tableau contenant les parties de la partition]
- * @param lit : itérateur sur une liste contenant une vecteur de vecteur d'entier
- * @return
- */
-
-/*
- * Objectif : obtenir la correspondance entre les sommets d'un graphe Gn et celui de Gn-1
- * Méthode : modification des sommets contenus dans "Partition" à l'aide de la liste de correspondance *lit
- */
-
-void projection(EntiersEntiers &Partition,ListEntiersEntiers::iterator lit)
-{
-
-    /*
-     * Création d'un nouveau vecteur contenant les adresses d'autres vecteur d'entiers.
-     * Celui-ci est conçu pour recevoir les sommets contenus dans la liste de correspondance,
-     * correspondant à la projection des sommets du graphe Gn à celui de Gn-1
-     */
-    EntiersEntiers new_partition;
-    for(uint i = 0; i< Partition.size() ; i++)
-    {
-        Entiers *new_part = new Entiers();
-        for(uint j = 0 ; j<Partition.at(i)->size() ; j++)
-        {
-            for(uint k = 0; k<((*lit)->at(Partition.at(i)->at(j)))->size();k++){
-                new_part->push_back((*lit)->at(Partition.at(i)->at(j))->at(k));
-            }
-
-        }
-        new_partition.push_back(new_part);
-    }
-
-
-    /*
-     * Désalocation mémoire des pointeurs que contient "Partition"
-     */
-    for(EntiersEntiers::iterator it = Partition.begin(); it != Partition.end(); it++)
-    {
-        delete *it;
-        *it = NULL;
-    }
-
-    Partition = new_partition; // copie de new_partition dans Partition
-    for(uint i =0; i<Partition.size(); i++) {
-        // permet de trier chaque  sous vecteur de "Partition"
-        std::sort(Partition[i]->begin(),Partition[i]->end());
-    }
-
-    new_partition.clear();
-}
-
-/**
- * Fonction qui calcul le poids d'une partie
- * @param * part : adresse d'un vecteur d'entier, ici une partie de la partition
- * @param *g : adresse d'un graphe de type boost graphe undirected
- * @return un type double contenant le poids associé à la partie
- */
-double Calcul_poids(Entiers *partie, UnorientedGraph *g)
-{
-    double poids=0; // initialisation du poids à 0
-
-    /*
-     * Pour chaque sommet de la partie concerné on ajoute son poids au poids total
-     */
-    for(uint j = 0; j<partie->size();j++){
-        poids+=(*g)[partie->at(j)]._weight;
-    }
-
-    return poids;
-}
-
-/**
- * Fonction d'affinage suivant un critère de poids
- * @param *g : adresse d'un graphe de type boost graphe undirected
- * @param Partition : vecteur contenant des vecteurs d'entiers [tableau contenant les parties de la partition]
- * @return modification de la partition
- */
-void Affinage_equilibrage_charge(UnorientedGraph *g, EntiersEntiers &Partition)
-{
-    /*
-     * Calcule de la somme des poids du graphe et le poids moyen à atteindre
-     */
-    double poids_moyen = 0.;
-
-    for(uint i = 0; i < num_vertices(*g); i++) {
-        poids_moyen += (*g)[i]._weight;
-    }
-
-    // détermination du poids moyen à atteindre pour chaque partie
-    poids_moyen /= Partition.size();
-
-    std::vector < double > poids_parties;
-
-    /*
-     * Calcul du poids de chaque partie de la partition
-     */
-    for (uint i = 0; i < Partition.size(); i++) {
-        double tmp = Calcul_poids(Partition.at(i),g);
-
-        poids_parties.push_back(tmp);
-    }
-
-    std::clog << "Poids initial des parties : " << std::endl;
-
-    // for (uint i = 0; i < poids_parties.size(); i++){
-    //     std::cout << poids_parties.at(i) << " ";
-    // }
-    // std::cout << "\n" << std::endl;
-
-    /*
-     * Le critère d'amélioration consiste à faire tendre vers 0 la somme
-     * des écarts entre le poids des parties et le poids moyen
-     * le "critere" est la somme pour chaque partie de la différence
-     * en valeurs absolues du poids
-     * d'une partie moins le poids moyen divisé par le nombre de parties
-     */
-
-    double critere = 0.;
-
-    for (uint i = 0; i < poids_parties.size(); i++){
-        critere += abs(poids_parties.at(i) - poids_moyen);
-    }
-    critere /= Partition.size();
-
-    // on conserve le poids maximum
-    double p_max = *max_element(poids_parties.begin(), poids_parties.end());
-
-    // std::cout << "Valeurs du criètre de départ : " << critere << std::endl;
-
-    // création d'un second critère légérement plsu faible que le premier
-    double best_critere = critere - 1e-7;
-    uint nbr_passage = 1; // initialisation du nombre de passages à 1
-
-    /*
-     * Tant que le critère n'est pas amélioré etque le nombre de
-     * passage est inférieur au nombre de parties on réalise
-     * des modifications sur la partition
-     */
-    while (best_critere < critere or nbr_passage < Partition.size()) {
-        critere = best_critere; //critere devient best_critere
-
-        // recherche la partie associé au poids maximum
-        int cpt = recherche_val_double(poids_parties,p_max);
-        bool decision = false; //initialisatio d'un booleen a false
-        int nbr_pass_interne = 0;
-
-        /*
-         * tirage aléatoire des sommets de la partie de poids maximum
-         */
-        Entiers random_orders(Partition.at(cpt)->size());
-        for (uint i=0 ; i<Partition.at(cpt)->size() ; i++)
-            random_orders.at(i)=Partition.at(cpt)->at(i);
-
-        for (uint j=0 ; j<Partition.at(cpt)->size()-1 ; j++) {
-            int rand_pos = (rand() % Partition.at(cpt)->size()-j)+j;
-            int tmp = random_orders[j];
-            random_orders[j] = random_orders[rand_pos];
-            random_orders[rand_pos] = tmp;
-        }
-
-        /*
-         * Si le nombre de sommets d'une partie excéde les 400, on tire au hasar 400 sommets sans remise
-         * et on effectue les modifications (ceci permet d'eviter une explosion des temps de calcul)
-         */
-        int size;
-
-        if(Partition.at(cpt)->size()>400)
-            size = 400;
-        else
-            size = Partition.at(cpt)->size();
-
-        /*
-         * Seconde boucle Tant que sur les sommets d'une partie.
-         * Tant que le critere booleen est vrai et que le nombre de passe interne est inférieur au seuil size faire
-         */
-        while(decision!=true && nbr_pass_interne < size){
-            int vertex = random_orders.at(nbr_pass_interne); //tirage d'un sommets dans la parite de poids maximum
-            Entiers community = Neigh_community(g,Partition,vertex,cpt); // recherche des communautés voisines à ce sommet (s'il est au bord)
-            if(community.size()!=0) // s'il existe au moins une communauté voisine
-            {
-                std::vector<double> new_poids_parties; // initialisation d'un nouveau vecteur contenant des doubles
-                std::vector<double> tmp_critere; // initialisation d'un nouveau vecteur contenant des doubles
-
-                /*
-                 * Pour chacune des parties (communauté) voisine au sommet vertexs faire
-                 */
-                for(uint k = 0; k < community.size();k++)
-                {
-                    new_poids_parties = poids_parties; //copie du tableau de poids des parties dans new_poids_parties
-
-                    /*
-                     * Modification des poids des parties :
-                     * on ajoute le poids du sommets à la partie voisine
-                     * et on soustrait son poids à sa partie d'origine
-                     */
-                    new_poids_parties.at(community.at(k))+=(*g)[vertex]._weight;
-                    new_poids_parties.at(cpt)-=(*g)[vertex]._weight;
-
-                    /*
-                     * Calcul ldu nouveau critère associé à cette modification
-                     */
-                    double new_critere = 0.;
-
-                    for(uint i = 0; i<poids_parties.size();i++){
-                        new_critere += abs(new_poids_parties.at(i)-poids_moyen);
-                    }
-                    new_critere/=Partition.size();
-                    tmp_critere.push_back(new_critere); // enregistrement du résutlat dans le tableau tmp_critere
-                }
-                double val_min = *min_element(tmp_critere.begin(),tmp_critere.end()); // enregistrement de la valeur minimale du tableau tmp_critere
-                int val = recherche_val_double(tmp_critere,val_min); // recherche de la communauté correspondant à cette valeur
-
-                /*
-                 * Si la valeur associé est plus petite et que la partie selectionné n'est pas vérouillée faire
-                 */
-                if(val_min<critere && poids_parties.at(val)!=-1)
-                {
-                    /*
-                     * On change le sommet vertex de partie, il est déplacé vers la partie
-                     * qui permet la meilleure amélioration du critère
-                     */
-                    Partition.at(community.at(val))->push_back(vertex);
-                    suprim_val(*Partition.at(cpt),vertex);
-                    std::sort(Partition.at(community.at(val))->begin(), Partition.at(community.at(val))->end());
-
-                    /*
-                     * Vérification de la sauvegarde de la connexsité,
-                     * si se n'est pas le cas retour à l'état précédent
-                     */
-                    if(Est_connexe(g,Partition,*Partition.at(cpt))!=1)
-                    {
-                        suprim_val(*Partition.at(community.at(val)),vertex);
-                        Partition.at(cpt)->push_back(vertex);
-                        std::sort(Partition.at(cpt)->begin(), Partition.at(cpt)->end());
-                        // std::cout<<" C'EST MORT RETOUR EN ARRIERE ! "<<std::endl
-                            ;
-                    }
-                    else
-                    {
-                        poids_parties = new_poids_parties;
-                        decision = true;
-                        // std::cout<<" Modification reussi ! "<<std::endl;
-                    }
-                }
-            }
-            nbr_pass_interne++;
-        }
-        /*
-         * Si aucune modification n'a été réalisé pour cett partie de poids maximum
-         */
-        if(decision==false)
-        {
-            nbr_passage++; // augmentation du nombre de passage
-            poids_parties.at(cpt)=-1; // vérrouillage de la partie
-            std::clog<<"nouveau passag ! "<<std::endl;
-        }
-        else
-        {
-            best_critere = 0.;
-
-            for(uint i = 0; i<poids_parties.size();i++){
-                best_critere += abs(poids_parties.at(i)-poids_moyen);
-            }
-            best_critere/=Partition.size();
-            nbr_passage = 0;
-        }
-
-        // std::clog<<"Poids des parties modifié : "<<std::endl;
-        // for(uint i = 0; i<poids_parties.size(); i++){
-        //     std::cout<<poids_parties.at(i)<<" ";
-        // }
-        // std::cout<<"\n"<<std::endl;
-        p_max = *max_element(poids_parties.begin(),poids_parties.end());
-        // std::cout<<"Valeurs du criètre : "<<critere<<std::endl;
-        // std::cout<<"Valeurs du best_criètre : "<<best_critere<<std::endl;
-        // std::cout<<"Nombre de passage : "<<nbr_passage<<std::endl;
-        // std::cout<<"\n"<<std::endl;
-
-    }
-}
-
-Entiers Neigh_community(UnorientedGraph *g, EntiersEntiers &Partition, int vertex, int comm_in)
-{
-    Entiers community;
-    int comm;
-    tie(neighbourIt, neighbourEnd) = adjacent_vertices(vertex,*g);
-    for (; neighbourIt != neighbourEnd; ++neighbourIt){
-        comm = In_community_dichotomie(Partition,*neighbourIt);
-        if(In_tab(community,comm)!=1 && comm!=comm_in)
-            community.push_back(comm);
-    }
-    return community;
-}
-
-void Affinage_recherche_locale(UnorientedGraph *g, EntiersEntiers &Partition, double &cut, std::string name)
-{
-
-    Entiers random_orders(num_vertices(*g)); //gestion d'un tableau contenant tout les sommets et ranger de façon aléatoire
-
-    for (uint i=0 ; i<num_vertices(*g) ; i++)
-        random_orders.at(i)=i;
-
-    for (uint j=0 ; j<num_vertices(*g)-1 ; j++) {
-        int rand_pos = (rand() % num_vertices(*g)-j)+j;
-        int tmp = random_orders[j];
-        random_orders[j] = random_orders[rand_pos];
-        random_orders[rand_pos] = tmp;
-    }
-    uint size = random_orders.size();
-
-    if(num_vertices(*g)>500)
-        size=500;
-
-    std::vector<std::vector<double> > tabe_cut;
-
-    //std::cout<<"Passage : "<<Partition.size()<<std::endl;
-    for(uint k = 0; k < Partition.size();k++){
-        std::vector<double> tmp;
-        double vol = 0.;
-        double cut = Modif_Cut_one_cluster(*Partition.at(k), *g, vol);
-        tmp.push_back(cut);
-        tmp.push_back(vol);
-        tabe_cut.push_back(tmp);
-    }
-
-    for(uint i = 0; i < size; i++){
-        if(random_orders.at(i)!=-1){
-            int vertex = random_orders.at(i);
-            //std::cout<<vertex<<std::endl;
-            int comm = In_community_dichotomie(Partition, vertex);
-            Entiers community = Neigh_community(g,Partition,vertex,comm);
-            std::vector<double> tmp_cut;
-
-            if(community.size()!=0 && Partition.at(comm)->size()!=1){
-                tmp_cut = modif_cut_tmp(g,Partition,tabe_cut,vertex,comm,community,cut,name);
-                /*for(uint z = 0; z<tmp_cut.size(); z++){
-                    std::cout<<tmp_cut.at(z)<<std::endl;
-                }
-                std::cout<<"\n"<<std::endl;*/
-                double cut_min = *min_element(tmp_cut.begin(),tmp_cut.end());
-                //std::cout<<"cout de coupe minimum de la liste : "<<cut_min<<std::endl;
-                if(cut_min<cut){
-                    // std::clog<<"Changement ! "<<std::endl;
-                    int tmp = recherche_val_double(tmp_cut,cut_min);
-                    cut=cut_min;
-                    Partition.at(community.at(tmp))->push_back(vertex);
-                    suprim_val(*Partition.at(comm),vertex);
-                    std::sort(Partition.at(community.at(tmp))->begin(), Partition.at(community.at(tmp))->end());
-                    tabe_cut.clear();
-                    for(uint k = 0; k < Partition.size();k++){
-                        std::vector<double> tmp;
-                        double vol = 0.;
-                        double cut = Modif_Cut_one_cluster(*Partition.at(k), *g, vol);
-                        tmp.push_back(cut);
-                        tmp.push_back(vol);
-                        tabe_cut.push_back(tmp);
-                    }
-
-                }
-            }
-
-            //Modif_fonction_Gain_Cut(Partition,g,community,vertex,cut,name);
-
-
-            /*if(Est_connexe(g,Partition,*Partition.at(comm))!=1)
-              {
-              suprim_val(*Partition.at(community.at(tmp)),vertex);
-              Partition.at(comm)->push_back(vertex);
-              std::sort(*Partition.at(comm));
-              std::cout<<" C'EST MORT RETOUR EN ARRIERE ! "<<std::endl;
-              }*/
-
-        }
-    }
-}
-
-double Modif_Cut_one_cluster(Entiers &cluster, UnorientedGraph &g, double &vol)
-{
-	edge_t e1;
-	bool found;
-	double cpt=0.;
-	for(uint i=0;i<cluster.size();i++){
-		tie(neighbourIt, neighbourEnd) = adjacent_vertices(cluster.at(i), g);
-		for (; neighbourIt != neighbourEnd; ++neighbourIt){
-			tie(e1,found)=edge(vertex(cluster[i],g),vertex(*neighbourIt,g),g);
-			if(In_tab(cluster,*neighbourIt)!=1){
-				cpt+=g[e1]._weight;
-			}
-		}
-	}
-	vol = Cluster_Degree(g,cluster);
-	return cpt/2.;
-
-}
-
-std::vector<double> modif_cut_tmp(UnorientedGraph *g, EntiersEntiers &Partition, std::vector<std::vector<double> > tabe_cut, int vertexs, int comm_in, Entiers community, double cut,std::string name){
-	edge_t e1;
-	bool found;
-	//std::cout<<"le sommet tiré est : "<<vertexs<<std::endl;
-
-	if(name!="norm")
-	{
-		std::vector<double> modif_cut(community.size());
-		double cpt_comm_in;
-		double cpt_comm_out;
-		for(uint i =0; i<community.size(); i++){
-			double tmp_cut = cut;
-			cpt_comm_in=0;
-			cpt_comm_out=0;
-
-			tie(neighbourIt, neighbourEnd) = adjacent_vertices(vertexs,*g);
-			for (; neighbourIt != neighbourEnd; ++neighbourIt){
-				tie(e1,found)=edge(vertex(vertexs,*g),vertex(*neighbourIt,*g),*g);
-				if(In_tab(*Partition.at(comm_in),*neighbourIt)==1)
-					cpt_comm_in+=(*g)[e1]._weight;
-				else if(In_tab(*Partition.at(community.at(i)),*neighbourIt)==1)
-					cpt_comm_out+=(*g)[e1]._weight;
-			}
-
-			tmp_cut+=cpt_comm_in;
-			tmp_cut-=cpt_comm_out;
-
-			modif_cut.at(i)=tmp_cut;
-		}
-		return modif_cut;
-	}
-	else{
-		std::vector<double> modif_cut(community.size());
-		double cpt_comm_in;
-		double cpt_comm_out;
-		double tmp_cut;
-
-		for(uint i =0; i<community.size(); i++){
-			std::vector<std::vector<double> > tab_cut = tabe_cut;
-
-			tmp_cut =0.;
-			cpt_comm_in=0.;
-			cpt_comm_out=0.;
-
-			tie(neighbourIt, neighbourEnd) = adjacent_vertices(vertexs,*g);
-			for (; neighbourIt != neighbourEnd; ++neighbourIt){
-				tie(e1,found)=edge(vertex(vertexs,*g),vertex(*neighbourIt,*g),*g);
-				if(In_tab(*Partition.at(comm_in),*neighbourIt)==1)
-					cpt_comm_in+=(*g)[e1]._weight;
-				else if(In_tab(*Partition.at(community.at(i)),*neighbourIt)==1)
-					cpt_comm_out+=(*g)[e1]._weight;
-			}
-
-			cpt_comm_in/=2.;
-			cpt_comm_out/=2.;
-
-			tab_cut.at(comm_in).at(0)+=cpt_comm_in;
-			tab_cut.at(comm_in).at(0)-=cpt_comm_out;
-			tab_cut.at(comm_in).at(1)-= Degree(*g ,vertexs);
-
-			tab_cut.at(community.at(i)).at(0)+=cpt_comm_in;
-			tab_cut.at(community.at(i)).at(0)-=cpt_comm_out;
-			tab_cut.at(community.at(i)).at(1)+= Degree(*g ,vertexs);
-
-			for(uint j = 0; j < tab_cut.size();j++){
-				tmp_cut+=((tab_cut.at(j).at(0))/(tab_cut.at(j).at(1)));
-			}
-
-			modif_cut.at(i)=tmp_cut;
-		}
-		return modif_cut;
-	}
-}
-void Modif_fonction_Gain_Cut(EntiersEntiers &Partition,UnorientedGraph *g, Entiers &community, int val, double &cut,std::string name)
-{
-	/*std::cout<<"Nombre de communauté voisine : "<<community.size()<<std::endl;
-	std::cout<<"\n"<<std::endl;*/
-	for(uint i = 0; i<community.size();i++){
-		EntiersEntiers new_partition;
-		for(uint k = 0; k < Partition.size();k++){
-			Entiers * tmp = new Entiers();
-			for(uint j = 0;j<Partition.at(k)->size();j++){
-				tmp->push_back(Partition.at(k)->at(j));
-			}
-			new_partition.push_back(tmp);
-		}
-
-		/*std::cout<<"Avant Modification partition"<<std::endl;
-		std::cout<<"************"<<std::endl;
-		for(uint t = 0; t< new_partition.size() ; t++)
-				{
-					for(uint j = 0 ; j<new_partition.at(t)->size() ; j++)
-					{
-						std::cout<<new_partition.at(t)->at(j)<<std::endl;
-					}
-					std::cout<<"\n"<<std::endl;
-				}
-		std::cout<<"************"<<std::endl;*/
-
-
-		new_partition.at(community.at(i))->push_back(val);
-		suprim_val(*new_partition.at(In_community_dichotomie(Partition,val)),val);
-		std::sort(new_partition.at(community.at(i))->begin(),
-                    new_partition.at(community.at(i))->end());
-
-		/*std::cout<<"Modification partition"<<std::endl;
-		std::cout<<"************"<<std::endl;
-		for(uint t= 0; t< new_partition.size() ; t++)
-		{
-			for(uint j = 0 ; j<new_partition.at(t)->size() ; j++)
-			{
-				std::cout<<new_partition.at(t)->at(j)<<std::endl;
-			}
-			std::cout<<"\n"<<std::endl;
-		}
-		std::cout<<"************"<<std::endl;*/
-
-		double coupe = Cut_cluster(new_partition,*g,name);
-
-		//std::cout<<"cout de coupe : "<<coupe<<std::endl;
-		if(coupe<cut)
-		{
-			for(EntiersEntiers::iterator it = Partition.begin(); it != Partition.end(); it++)
-			{
-				delete *it;
-				*it = NULL;
-			}
-			Partition = new_partition;
-			cut = coupe;
-		}
-		else
-		{
-			for(EntiersEntiers::iterator it = new_partition.begin(); it != new_partition.end(); it++)
-			{
-				delete *it;
-				*it = NULL;
-			}
-		}
-	}
-}
-
-bool contraction_HEM(UnorientedGraph *g, Base_Graph &baseg, ListEntiersEntiers &liste_corr, int val_reduc, int &val_cpt){
-	UnorientedGraph *gtmp = new UnorientedGraph();
-	*gtmp=*g;
-	Entiers Random_list_vertices; // Initialisation du tableau de sommets rangés aléatoirements
-	EntiersEntiers *tableau_de_correspondance = new EntiersEntiers();
-	edge_t e1,e2; // Iterateurs sur les arcs
-	bool found;
-	uint nbr_vertex = num_vertices(*gtmp);
-	Entiers sommets_a_detruire; // Initialisation d'un tableau pret à recevoir les "sommets à détruire"
-	/*
-	 * Création d'un vecteur contenant l'ensemble des sommets du graphe. Ces sommets sont rangés
-	 * aléatoirement afin de simuler un tirage aléatoire
-	 */
-	for (uint i=0 ; i<nbr_vertex ; i++)
-		Random_list_vertices.push_back(i);
-	for (uint j=0 ; j<nbr_vertex-1 ; j++) {
-		int rand_pos = rand()%(nbr_vertex-j)+j;
-		int tmp      = Random_list_vertices[j];
-		Random_list_vertices[j] = Random_list_vertices[rand_pos];
-		Random_list_vertices[rand_pos] = tmp;
-	}
-
-	/*
-	 * Pour chaque sommet non verrouiller faire ....
-	 */
-	for(uint i=0; i<nbr_vertex; i++){
-		int vertexs = Random_list_vertices[i];
-		//std::cout<<"Le sommet tiré est : "<<vertexs<<std::endl;
-		if(vertexs!=-1){
-			Entiers liste_voisin = Liste_adjacence(*gtmp,vertexs,Random_list_vertices); // Recherche des sommets adjacents au sommets  tiré
-			if(liste_voisin.size()!=0){
-				/*
-				 * S'il en existe au mois un sommet adjacent au sommet tiré qui n'est pas verrouillé, on
-				 * choisi celui dont l'arc les reliants est le plus fort. Dans le cas où les arcs ont tous
-				 * le même poids, on selectionne le sommet d'identifiant le plus petit
-				 */
-				double poids_a = 0.;
-				int best_vertexs = -1;
-				for(uint j=0;j<liste_voisin.size();j++){
-					tie(e1,found)=edge(vertex(vertexs,*gtmp),vertex(liste_voisin[j],*gtmp),*gtmp);
-					if((*gtmp)[e1]._weight>poids_a){
-						best_vertexs = liste_voisin[j];
-						poids_a = (*gtmp)[e1]._weight;
-					}
-				}
-
-
-				Entiers * couple = new Entiers(); // Initialisation du vecteur contenant le couple de sommet fusionné
-				int vertex_delete = std::max(vertexs, best_vertexs); // Sommet d'indentifiant le plus grand (qui sera détruit)
-				//std::cout<<"sommet détruit : "<<vertex_delete<<std::endl;
-				int vertex_save = std::min(vertexs,best_vertexs); // Sommet d'identifiant le plus petit (qui sera conservé)
-				//std::cout<<"sommet sauvé : "<<vertex_save<<std::endl;
-
-				sommets_a_detruire.push_back(vertex_delete); // On ajoute le sommet détruit au tableau des sommets à détruire
-				/*
-				 * On ajoute au tableau "couple" le couple de sommet à fusionner
-				 */
-				couple->push_back(vertex_save);
-				couple->push_back(vertex_delete);
-				tableau_de_correspondance->push_back(couple); // Ajout du "couple" à la liste de correspondance
-
-				remove_edge(vertex_save,vertex_delete,*gtmp); // Suppression de l'arc reliant le couple de sommets
-
-				Entiers neigh_vertex_save; // Initialisation du vecteur contenant les sommets adjacents au "sommet sauvegardé"
-				Entiers neigh_vertex_delete; // Initialisation du vecteur contenant les somemts adjacents au "sommet à détruire"
-				tie(neighbourIt, neighbourEnd) = adjacent_vertices(vertex_save,*gtmp);
-
-				/*
-				 * Remplissage de ces deux tableaux à l'aide de la fonction adjacent_vertices de boost graph
-				 * [La création de ces tableaux est nécéssaire du fait que certains arcs sont détruit au cours
-				 * du processus]
-				 */
-				for (; neighbourIt != neighbourEnd; ++neighbourIt){
-					neigh_vertex_save.push_back(*neighbourIt);
-				}
-
-				tie(neighbourIt, neighbourEnd) = adjacent_vertices(vertex_delete,*gtmp);
-				for (; neighbourIt != neighbourEnd; ++neighbourIt){
-					neigh_vertex_delete.push_back(*neighbourIt);
-				}
-
-				/*
-				 * Recherche de sommets communs entre le "sommet sauvegardé" et le "sommet à détruire"
-				 * S'il existe un tel sommet "v" alors on ajoute le poids de l'arcs (vertex_delet,v)
-				 * à celui de l'arcs (vertex_save,v) et on détruit l'arcs reliant "v" au "sommet à détruire"
-				 */
-				for(uint j=0;j<neigh_vertex_delete.size();j++){
-					if(In_tab(neigh_vertex_save,neigh_vertex_delete[j])==1){
-						tie(e2,found)=edge(vertex(vertex_save,*gtmp),vertex(neigh_vertex_delete[j],*gtmp),*gtmp);
-						tie(e1,found)=edge(vertex(vertex_delete,*gtmp),vertex(neigh_vertex_delete[j],*gtmp),*gtmp);
-						(*gtmp)[e2]._weight+=(*gtmp)[e1]._weight;
-						remove_edge(vertex_delete,neigh_vertex_delete[j],*gtmp);
-					}
-					else
-					{
-						tie(e1,found)=edge(vertex(vertex_delete,*gtmp),vertex(neigh_vertex_delete[j],*gtmp),*gtmp);
-						add_edge(vertex_save,neigh_vertex_delete[j],EdgeProperties((*gtmp)[e1]._weight),*gtmp);
-						remove_edge(vertex_delete,neigh_vertex_delete[j],*gtmp);
-					}
-				}
-
-				(*gtmp)[vertex_save]._weight+=(*gtmp)[vertex_delete]._weight; // ajout du poids du sommet détruit au sommet conservé
-				/*
-				 * Vérouillage du "sommet sauvegardé" et du "sommet à détruire"
-				 */
-				Random_list_vertices[i]=-1;
-				Random_list_vertices[recherche_val(Random_list_vertices,best_vertexs)]=-1;
-				val_cpt--;
-				// std::cout<<val_cpt<<std::endl;
-			}
-			else{
-				/*
-				 * Et si le sommet tiré ne possède pas de sommet adjacent non verrouillé
-				 * alors on l'ajoute à la liste de correspondance des sommets et on
-				 * le verrouille
-				 */
-				Entiers *couple = new Entiers();
-				couple->push_back(Random_list_vertices.at(i));
-				tableau_de_correspondance->push_back(couple);
-				Random_list_vertices[i]=-1;
-			}
-
-
-
-			/*std::cout<<"Graphe contracté : "<<std::endl;
-			tie(vertexIt, vertexEnd) = vertices(*gtmp);
-			for (; vertexIt != vertexEnd; ++vertexIt) {
-				std::cout << (*gtmp)[*vertexIt]._index
-						<< " est connecté avec ";
-				tie(neighbourIt, neighbourEnd) = adjacent_vertices(*vertexIt,
-						*gtmp);
-				for (; neighbourIt != neighbourEnd; ++neighbourIt)
-					std::cout << (*gtmp)[*neighbourIt]._index << " ";
-				std::cout << " et son poids est de "
-						<< (*gtmp)[*vertexIt]._weight<<std::endl;
-			}
-			std::cout << std::endl;*/
-		}
-		if(val_cpt == val_reduc){
-			for(uint j=i+1; j <nbr_vertex; j++){
-				if(Random_list_vertices[j] !=-1){
-				Entiers *couple = new Entiers();
-				couple->push_back(Random_list_vertices.at(j));
-				tableau_de_correspondance->push_back(couple);}
-			}
-			break;
-		}
-	}
-
-	std::sort(sommets_a_detruire.begin(), sommets_a_detruire.end()); // Trie dans l'ordre croissant des "sommets à détruire"
-	// std::cout<<"\n"<<std::endl;
-	/*
-	 * Suppression des sommets de la liste "sommets à détruire". Cette suppression est
-	 * effectuée dans l'ordre décroissant afin à maintenir à jour la renumérotation
-	 * des sommets
-	 */
-	for(int j=(sommets_a_detruire.size()-1);j>-1;j--){
-		//std::cout<<"Noeuds a supprimer : "<<sommets_a_detruire.at(j)<<std::endl;
-		remove_vertex(sommets_a_detruire[j],*gtmp);
-	}
-
-	// std::clog<<"Affichage avant tri "<<std::endl;
-	// for(uint k = 0;k<tableau_de_correspondance->size();k++){
-	// 	for(uint v = 0; v<tableau_de_correspondance->at(k)->size();v++){
-	// 		std::cout<<tableau_de_correspondance->at(k)->at(v)<<" ";
-	// 	}
-	// 	std::cout<<"\n"<<std::endl;
-	// }
-	std::sort(tableau_de_correspondance->begin(),tableau_de_correspondance->end(),myobject); // Trie dans l'ordre croissant des couples de sommets de la liste de correspondance
-
-	// std::clog<<"Tableau de correspondance "<<std::endl;
-	// for(uint k = 0;k<tableau_de_correspondance->size();k++){
-	// 	for(uint v = 0; v<tableau_de_correspondance->at(k)->size();v++){
-	// 		std::cout<<tableau_de_correspondance->at(k)->at(v)<<" ";
-	// 	}
-	// 	std::cout<<"\n"<<std::endl;
-	// }
-
-	liste_corr.push_back(tableau_de_correspondance);
-	// std::cout<<"\n"<<std::endl;
-	baseg.push_back(gtmp); // Ajout du graphe modifié à la "base des graphe"
-
-	if(val_cpt == val_reduc)
-		return true;
-	else
-		return false;
-
-}
-
-bool contraction_Random_Maching(UnorientedGraph *g, Base_Graph &baseg, ListEntiersEntiers &liste_corr, int val_reduc, int &val_cpt){
-	UnorientedGraph *gtmp = new UnorientedGraph();
-	*gtmp=*g;
-	Entiers Random_list_vertices; // Initialisation du tableau de sommets rangés aléatoirements
-	EntiersEntiers *tableau_de_correspondance = new EntiersEntiers();
-	edge_t e1,e2; // Iterateurs sur les arcs
-	bool found;
-	uint nbr_vertex = num_vertices(*gtmp);
-	Entiers sommets_a_detruire; // Initialisation d'un tableau pret à recevoir les "sommets à détruire"
-	/*
-	 * Création d'un vecteur contenant l'ensemble des sommets du graphe. Ces sommets sont rangés
-	 * aléatoirement afin de simuler un tirage aléatoire
-	 */
-	for (uint i=0 ; i<nbr_vertex ; i++)
-		Random_list_vertices.push_back(i);
-	for (uint j=0 ; j<nbr_vertex-1 ; j++) {
-		int rand_pos = rand()%(nbr_vertex-j)+j;
-		int tmp      = Random_list_vertices[j];
-		Random_list_vertices[j] = Random_list_vertices[rand_pos];
-		Random_list_vertices[rand_pos] = tmp;
-	}
-
-	/*
-	 * Pour chaque sommet non verrouiller faire ....
-	 */
-	for(uint i=0; i<nbr_vertex; i++){
-		int vertexs = Random_list_vertices[i];
-		if(vertexs!=-1){
-			Entiers liste_voisin = Liste_adjacence(*gtmp,vertexs,Random_list_vertices); // Recherche des sommets adjacents au sommets  tiré
-			if(liste_voisin.size()!=0){
-				/*
-				 * S'il en existe au mois un sommet adjacent au sommet tiré qui n'est pas verrouillé, on
-				 * choisi celui dont l'arc les reliants est le plus fort. Dans le cas où les arcs ont tous
-				 * le même poids, on selectionne le sommet d'identifiant le plus petit
-				 */
-				int tmp;
-				if(liste_voisin.size()==1)
-					tmp = 0;
-				else
-					tmp = rand_fini(0,liste_voisin.size()-1);
-
-				int best_vertexs = liste_voisin.at(tmp);
-
-				Entiers * couple = new Entiers(); // Initialisation du vecteur contenant le couple de sommet fusionné
-				int vertex_delete = std::max(vertexs, best_vertexs); // Sommet d'indentifiant le plus grand (qui sera détruit)
-				//std::cout<<"sommet détruit : "<<vertex_delete<<std::endl;
-				int vertex_save = std::min(vertexs,best_vertexs); // Sommet d'identifiant le plus petit (qui sera conservé)
-				//std::cout<<"sommet sauvé : "<<vertex_save<<std::endl;
-
-				sommets_a_detruire.push_back(vertex_delete); // On ajoute le sommet détruit au tableau des sommets à détruire
-				/*
-				 * On ajoute au tableau "couple" le couple de sommet à fusionner
-				 */
-				couple->push_back(vertex_save);
-				couple->push_back(vertex_delete);
-				tableau_de_correspondance->push_back(couple); // Ajout du "couple" à la liste de correspondance
-
-				remove_edge(vertex_save,vertex_delete,*gtmp); // Suppression de l'arc reliant le couple de sommets
-
-				Entiers neigh_vertex_save; // Initialisation du vecteur contenant les somemts adjacents au "sommet sauvegardé"
-				Entiers neigh_vertex_delete; // Initialisation du vecteur contenant les somemts adjacents au "sommet à détruire"
-				tie(neighbourIt, neighbourEnd) = adjacent_vertices(vertex_save,*gtmp);
-
-				/*
-				 * Remplissage de ces deux tableaux à l'aide de la fonction adjacent_vertices de boost graph
-				 * [La création de ces tableaux est nécéssaire du fait que certains arcs sont détruit au cours
-				 * du processus]
-				 */
-				for (; neighbourIt != neighbourEnd; ++neighbourIt){
-					neigh_vertex_save.push_back(*neighbourIt);
-				}
-
-				tie(neighbourIt, neighbourEnd) = adjacent_vertices(vertex_delete,*gtmp);
-				for (; neighbourIt != neighbourEnd; ++neighbourIt){
-					neigh_vertex_delete.push_back(*neighbourIt);
-				}
-
-				/*
-				 * Recherche de sommets communs entre le "sommet sauvegardé" et le "sommet à détruire"
-				 * S'il existe un tel sommet "v" alors on ajoute le poids de l'arcs (vertex_delet,v)
-				 * à celui de l'arcs (vertex_save,v) et on détruit l'arcs reliant "v" au "sommet à détruire"
-				 */
-				for(uint j=0;j<neigh_vertex_delete.size();j++){
-					if(In_tab(neigh_vertex_save,neigh_vertex_delete[j])==1){
-						tie(e2,found)=edge(vertex(vertex_save,*gtmp),vertex(neigh_vertex_delete[j],*gtmp),*gtmp);
-						tie(e1,found)=edge(vertex(vertex_delete,*gtmp),vertex(neigh_vertex_delete[j],*gtmp),*gtmp);
-						(*gtmp)[e2]._weight+=(*gtmp)[e1]._weight;
-						remove_edge(vertex_delete,neigh_vertex_delete[j],*gtmp);
-					}
-					else
-					{
-						tie(e1,found)=edge(vertex(vertex_delete,*gtmp),vertex(neigh_vertex_delete[j],*gtmp),*gtmp);
-						add_edge(vertex_save,neigh_vertex_delete[j],EdgeProperties((*gtmp)[e1]._weight),*gtmp);
-						remove_edge(vertex_delete,neigh_vertex_delete[j],*gtmp);
-					}
-				}
-
-				(*gtmp)[vertex_save]._weight+=(*gtmp)[vertex_delete]._weight; // ajout du poids du sommet détruit au sommet conservé
-				/*
-				 * Vérouillage du "sommet sauvegardé" et du "sommet à détruire"
-				 */
-				Random_list_vertices[i]=-1;
-				Random_list_vertices[recherche_val(Random_list_vertices,best_vertexs)]=-1;
-				val_cpt--;
-				// std::cout<<val_cpt<<std::endl;
-			}
-			else{
-				/*
-				 * Et si le sommet tiré ne possède pas de sommet adjacent non verrouillé
-				 * alors on l'ajoute à la liste de correspondance des sommets et on
-				 * le verrouille
-				 */
-				Entiers *couple = new Entiers();
-				couple->push_back(Random_list_vertices.at(i));
-				tableau_de_correspondance->push_back(couple);
-				Random_list_vertices[i]=-1;
-			}
-		}
-		if(val_cpt == val_reduc){
-			for(uint j=i+1; j <nbr_vertex; j++){
-				if(Random_list_vertices[j] !=-1){
-				Entiers *couple = new Entiers();
-				couple->push_back(Random_list_vertices.at(j));
-				tableau_de_correspondance->push_back(couple);}
-			}
-			break;
-		}
-	}
-
-	std::sort(sommets_a_detruire.begin(), sommets_a_detruire.end()); // Trie dans l'ordre croissant des "sommets à détruire"
-	//std::cout<<"\n"<<std::endl;
-	/*
-	 * Suppression des sommets de la liste "sommets à détruire". Cette suppression est
-	 * effectuée dans l'ordre décroissant afin à maintenir à jour la renumérotation
-	 * des sommets
-	 */
-	for(int j=(sommets_a_detruire.size()-1);j>-1;j--){
-		//std::cout<<"Noeuds a supprimer : "<<sommets_a_detruire.at(j)<<std::endl;
-		remove_vertex(sommets_a_detruire[j],*gtmp);
-	}
-
-	/**std::clog<<"Affichage avant tri "<<std::endl;
-	for(uint k = 0;k<tableau_de_correspondance->size();k++){
-		for(uint v = 0; v<tableau_de_correspondance->at(k)->size();v++){
-			std::cout<<tableau_de_correspondance->at(k)->at(v)<<" ";
-		}
-		std::cout<<"\n"<<std::endl;
-	}*/
-	std::sort(tableau_de_correspondance->begin(),tableau_de_correspondance->end(),myobject); // Trie dans l'ordre croissant des couples de sommets de la liste de correspondance
-
-	// std::clog<<"Tableau de correspondance "<<std::endl;
-	// for(uint k = 0;k<tableau_de_correspondance->size();k++){
-	// 	for(uint v = 0; v<tableau_de_correspondance->at(k)->size();v++){
-	// 		std::cout<<tableau_de_correspondance->at(k)->at(v)<<" ";
-	// 	}
-	// 	std::cout<<"\n"<<std::endl;
-	// }
-
-	liste_corr.push_back(tableau_de_correspondance);
-	// std::cout<<"\n"<<std::endl;
-	baseg.push_back(gtmp); // Ajout du graphe modifié à la "base des graphe"
-
-
-	if(val_cpt == val_reduc)
-		return true;
-	else
-		return false;
-
-}
-
-Entiers Liste_adjacence(UnorientedGraph &g, int vertexs,const Entiers &random_vertices){ // a revoir !!!!
-	Entiers liste_voisin;
-	tie(neighbourIt, neighbourEnd) = adjacent_vertices(vertexs, g);
-	for (; neighbourIt != neighbourEnd; ++neighbourIt){
-		if(In_tab(random_vertices,*neighbourIt)==1)
-			liste_voisin.push_back(*neighbourIt);
-	}
-	return liste_voisin;
-}
-
-int rand_fini(int a, int b){
-	return rand()%(b-a)+a;
-}
-
-/**
- * Fonction de recherche d'une valeur dans un tableau.
- * @param tab
- * @param val
- * @return
- */
-int recherche_val2(const std::vector<float> &tab,float val){
-	int cpt=0;
-	while(tab[cpt]!=val)
-		cpt++;
-	return cpt;
-}
-
-int recherche_val_double(const std::vector<double> &tab,double val){
-	int cpt=0;
-	while(tab[cpt]!=val)
-		cpt++;
-	return cpt;
-}
-
-int recherche_val(const Entiers &tab,int val){
-	int cpt=0;
-	while(tab[cpt]!=val)
-		cpt++;
-	return cpt;
-}
-/**
- * @param tab
- * @param i
- * @return
- */
-int dichotomie(const Entiers &tab, int i){
-
-	/* déclaration des variables locales à la fonction */
-	int id;  //indice de début
-	int ifin;  //indice de fin
-	int im;  //indice de "milieu"
-
-	/* initialisation de ces variables avant la boucle de recherche */
-	id = 0;  //intervalle de recherche compris entre 0...
-	ifin = tab.size();  //...et nbVal
-
-	/* boucle de recherche */
-	while ((ifin - id) > 1){
-		im = (id + ifin)/2;  //on détermine l'indice de milieu
-		if(tab[im] > i) ifin = im;  //si la valeur qui est à la case "im" est supérieure à la valeur recherchée, l'indice de fin "ifin" << devient >> l'indice de milieu, ainsi l'intervalle de recherche est restreint lors du prochain tour de boucle
-		else id = im;  //sinon l'indice de début << devient >> l'indice de milieu et l'intervalle est de la même façon restreint
-	}
-
-	/* test conditionnant la valeur que la fonction va renvoyer */
-	if (tab[id] == i) return id;  //si on a trouvé la bonne valeur, on retourne l'indice
-	else return -1;  //sinon on retourne -1
-
-}
-
-/**
- * Fonction permettant de supprimer une case d'un tableau.
- * @param tab une référence sur un tableau d'entiers
- * @param i un indice dans tab
- */
-void suprim_val(Entiers &tab,int i) {
-	tab.erase(tab.begin() + dichotomie(tab,i));
-}
-
-/**
- * Détermine si une valeur se trouve dans un tableau.
- * @param tab une référence sur un tableau d'entiers
- * @param val une valeur
- * @return true si la valeur a été trouvée, false sinon
- */
-bool In_tab(const Entiers &tab, int val)
-{
-	for (uint i=0; i < tab.size(); i++)
-		if(tab[i]==val)
-			return true;
-	return false;
-}
-
-bool In_tab_dichotomie(const Entiers &tab, int val)
-{
-	if(dichotomie(tab,val)!=-1)
-		return true;
-	else
-		return false;
-}
-
-
-void Liste_Voisin(const Entiers &P,Entiers &tab,const UnorientedGraph &g)
-{
-	tie(neighbourIt, neighbourEnd) = adjacent_vertices(P.at(P.size()-1), g);
-	for (; neighbourIt != neighbourEnd; ++neighbourIt)
-	{
-		if((In_tab(tab,*neighbourIt) == false ) && (In_tab(P,*neighbourIt) == false ))
-			tab.push_back(*neighbourIt);
-	}
-}
-
-int Cout_coupe(Entiers P,int val, UnorientedGraph &g)
-{
-	int cpt=0;
-	P.push_back(val);
-	for(uint i=0;i<P.size();i++){
-		tie(neighbourIt, neighbourEnd) = adjacent_vertices(P[i], g);
-		for (; neighbourIt != neighbourEnd; ++neighbourIt){
-			if(In_tab(P,*neighbourIt)!=1){
-				cpt++;
-			}
-		}
-	}
-	return cpt;
-}
-
-double Cut_one_cluster(const Entiers &cluster, UnorientedGraph &g, std::string name)
-{
-	if(name=="norm"){
-		edge_t e1;
-		bool found;
-		double cpt=0.;
-		for(uint i=0;i<cluster.size();i++){
-			tie(neighbourIt, neighbourEnd) = adjacent_vertices(cluster[i], g);
-			for (; neighbourIt != neighbourEnd; ++neighbourIt){
-				tie(e1,found)=edge(vertex(cluster[i],g),vertex(*neighbourIt,g),g);
-				if(In_tab(cluster,*neighbourIt)!=1){
-					cpt+=g[e1]._weight;
-				}
-			}
-		}
-		double vol = Cluster_Degree(g,cluster);
-		return (cpt/2.)/vol;
-	}
-	else{
-		edge_t e1;
-		bool found;
-		double cpt=0.;
-		for(uint i=0;i<cluster.size();i++){
-			tie(neighbourIt, neighbourEnd) = adjacent_vertices(cluster.at(i), g);
-			for (; neighbourIt != neighbourEnd; ++neighbourIt){
-				tie(e1,found)=edge(vertex(cluster.at(i),g),vertex(*neighbourIt,g),g);
-				if(In_tab(cluster,*neighbourIt)!=1){
-					cpt+=g[e1]._weight;
-				}
-			}
-		}
-		return cpt/2.;
-	}
-}
-
-double Cut_cluster(const EntiersEntiers &tab_cluster,UnorientedGraph &g,std::string name)
-{
-	double cpt=0.;
-	for(uint i=0;i<tab_cluster.size();i++){
-		cpt+=Cut_one_cluster(*tab_cluster[i],g,name);
-	}
-	return cpt;
-}
-
-double Cout_coupe_pond(Entiers P, int val, UnorientedGraph &g)
-{
-    edge_t e1;
-    bool found;
-    double cpt=0;
-
-    P.push_back(val);
-    for(uint i=0;i<P.size();i++){
-        tie(neighbourIt, neighbourEnd) = adjacent_vertices(P[i], g);
-        for (; neighbourIt != neighbourEnd; ++neighbourIt){
-            tie(e1,found)=edge(vertex(P[i],g),vertex(*neighbourIt,g),g);
-            if(In_tab(P,*neighbourIt)!=1){
-                cpt+=g[e1]._weight;
-            }
-        }
-    }
-    return cpt;
-}
-
-
-int In_community_dichotomie(const EntiersEntiers &part, int val)
-{
-    for (uint i = 0; i < part.size() ; i++) {
-        if (In_tab_dichotomie(*part[i], val)) {
-            return i;
-        }
-    }
-    return -1;
-}
-
-double Degree(UnorientedGraph& g, int node)
-{
-    edge_t e1;
-    bool found;
-    double val = 0.;
-
-    tie(neighbourIt, neighbourEnd) = adjacent_vertices(node, g);
-    for (; neighbourIt != neighbourEnd; ++neighbourIt) {
-        tie(e1, found) = edge(vertex(node, g), vertex(*neighbourIt, g), g);
-        val += g[e1]._weight;
-    }
-    return val;
-}
-
-double Cluster_Degree(UnorientedGraph &g , const Entiers &cluster)
-{
-    double val = 0.;
-
-    for(uint i = 0; i < cluster.size(); i++){
-        val += Degree(g, cluster.at(i));
-    }
-    return val;
-}
-
-void List_edge_partie(Entiers *Partie, OrientedGraph *go, Edges &edge_partie,
-                      OutputEdges &outputedgespartie){
-    edge_to e1;
-    //bool found;
-
-    for(uint i = 0; i < Partie->size(); i++) {
-        tie(neighbourIto, neighbourEndo) = adjacent_vertices(Partie->at(i),
-                                                             *go);
-        for (; neighbourIto != neighbourEndo; ++neighbourIto) {
-            if(In_tab_dichotomie(*Partie,*neighbourIto)) {
-                Edge new_edge;
-
-                new_edge.first = Partie->at(i);
-                new_edge.second = *neighbourIto;
-                edge_partie.push_back(new_edge);
-            } else {
-                Edge new_edge;
-
-                new_edge.first = Partie->at(i);
-                new_edge.second = *neighbourIto;
-                outputedgespartie.push_back(new_edge);
-            }
-        }
-    }
-}
-
-void Global_Neigh_community(UnorientedGraph *g,
-                            const EntiersEntiers &Partition,
-                            Entiers *community, int vertex, int comm_in)
-{
-    int comm;
-
-    tie(neighbourIt, neighbourEnd) = adjacent_vertices(vertex, *g);
-    for (; neighbourIt != neighbourEnd; ++neighbourIt){
-        comm = In_community_dichotomie(Partition, *neighbourIt);
-        if (In_tab(*community,comm) != 1 and comm != comm_in)
-            community->push_back(comm);
-    }
-}
-
-OrientedGraphs Graph_Partition(const EntiersEntiers& Partition,
-                               OrientedGraph *go,
-                               UnorientedGraph *g,
-                               OutputEdgeList &outputedgelist,
-                               InputEdgeList &inputedgelist,
-                               Connections &connections)
-{
-    OrientedGraphs graph_partie;
-    EntiersEntiers neigh_community;
-
-    for (uint i = 0; i < Partition.size();i++){
-        Edges edge_partie;
-        List_edge_partie(Partition.at(i),go,edge_partie,outputedgelist.at(i));
-        OrientedGraph graph;
-        std::vector<vertex_to> tab_vertex_to;
-        Entiers *community = new Entiers();
-
-        for (uint j = 0; j < Partition.at(i)->size(); j++) {
-            Global_Neigh_community(g, Partition, community,
-                                   Partition.at(i)->at(j),i);
-            vertex_to v = add_vertex(graph);
-
-            tab_vertex_to.push_back(v);
-            graph[v] = VertexProperties((*go)[Partition.at(i)->at(j)]._index,
-                                        (*go)[Partition.at(i)->at(j)]._weight,
-                                        (*go)[Partition.at(i)->at(j)]._type);
-        }
-        neigh_community.push_back(community);
-
-        for(uint k = 0; k < edge_partie.size(); k++) {
-            add_edge(tab_vertex_to.at(recherche_val(*Partition.at(i),
-                                                    edge_partie.at(k).first)),
-                     tab_vertex_to.at(recherche_val(*Partition.at(i),
-                                                    edge_partie.at(k).second)),
-                     graph);
-        }
-        graph_partie.push_back(graph);
-    }
-
-    for (uint i = 0; i < neigh_community.size(); i++) {
-        InputEdges inputedges;
-
-        for (uint j = 0; j < neigh_community.at(i)->size(); j++) {
-            for (uint k = 0;
-                 k < outputedgelist.at(neigh_community.at(i)->at(j)).size();
-                 k++) {
-                if (In_tab_dichotomie(
-                        *Partition.at(i),
-                        outputedgelist.at(
-                            neigh_community.at(i)->at(j)).at(k).second))
-                    inputedges.push_back(
-                        outputedgelist.at(
-                            neigh_community.at(i)->at(j)).at(k));
-            }
-        }
-        inputedgelist.push_back(inputedges);
-    }
-
-    for (uint i = 0; i < outputedgelist.size(); i++){
-        Connection connec;
-
-        for(uint j = 0; j < outputedgelist.at(i).size(); j++){
-            Port port1;
-
-            port1.first = i + 1;
-            port1.second = outputedgelist.at(i).at(j).first;
-
-            Port port2;
-
-            port2.first = In_community_dichotomie(
-                Partition,outputedgelist.at(i).at(j).second) + 1;
-            port2.second = outputedgelist.at(i).at(j).second;
-
-            connec.first = port1;
-            connec.second = port2;
-
-            connections.push_back(connec);
-        }
-    }
-
-    for (EntiersEntiers::iterator it = neigh_community.begin();
-        it != neigh_community.end(); it++) {
-        delete *it;
-        *it = NULL;
-    }
-
-    return graph_partie;
-}
-
-/*double In_modularity(UnorientedGraph &g , const Entiers &cluster){
-	property_map<UnorientedGraph,edge_weight_t>::type poids_arc=get(edge_weight_t(),g);
-	edge_t e1;
-	bool found;
-	int val=0;
-
-	for(uint i=0;i<cluster.size();i++){
-		tie(neighbourIt, neighbourEnd) = adjacent_vertices(cluster[i],g);
-		for (; neighbourIt != neighbourEnd; ++neighbourIt){
-			tie(e1,found)=edge(vertex(cluster[i],g),vertex(*neighbourIt,g),g);
-			if(In_tab(cluster,*neighbourIt)==1)
-				val+=get(poids_arc,e1);
-		}
-	}
-	return val/2.;
-}*/
-
-/**
- *
- * @param g
- * @param cluster
- * @return
- */
-
-
-
-/**
- *
- * @param g
- * @param part
- * @return
- */
-
-/*double Modularity(UnorientedGraph &g,const EntiersEntiers &part) {
-  double q  = 0.;
-  int tmp=num_edges(g);
-  for(uint i=0;i<part.size();i++){
-	  q+=In_modularity(g,*part[i])/tmp-(Cluster_Degree(g,*part[i])/(2*tmp))*(Cluster_Degree(g,*part[i])/(2*tmp));
-  	}
-
-  return q;
-}*/
-
-/**
- *
- * @param part
- * @param val
- * @return
- */
-
-
-
-/**
- * Fonction de calcul du gain de modularité de déplacement d'un sommet d'une communoté à une autre !!!!!
- *  ajoute le sommet à part[val] et on calcul la nouvelle modularité
- *  on prend la différence entre la modularité et la nouvouvelle !
- * @param cur_mod
- * @param val
- * @param neight
- * @param node_comm
- * @param part
- * @param g
- */
-/*double Modularity_gain(double cur_mod , int val , int neight , int node_comm , EntiersEntiers part , UnorientedGraph &g) {
-	double q;
-	part[neight]->push_back(val);
-	std::sort(*part[neight]);
-	q=Modularity(g,part);
-
-	return q-cur_mod;
-}*/
-
-/**
- * Fonction de calcul du gain de modularité de déplacement d'un sommet d'une communoté à une autre !!!!!
- *  ajoute le sommet à part[val] et on calcul la nouvelle modularité
- *  on prend la différence entre la modularité et la nouvouvelle !
- * @param cur_mod
- * @param tmp_community
- * @param neight
- * @param node_comm
- * @param part
- * @param g
- */
-/*double Modularity_gain_phase_2(double cur_mod, Entiers tmp_community, int neight, int node_comm, EntiersEntiers part, UnorientedGraph &g) {
-	double q;
-	for (uint i=0;i<tmp_community.size();i++)
-		part[neight]->push_back(tmp_community[i]);
-	std::sort(*part[neight]);
-	q = Modularity(g,part);
-	return q - cur_mod;
-}*/
-
-/**
- * Donne la liste des communautés voisines à celle contenant le sommet val.
- * @param part
- * @param val
- * @param g
- * @return
- */
-/*Entiers Neight_community(const EntiersEntiers &part, int val , UnorientedGraph &g){
-	Entiers Neight;
-	tie(neighbourIt, neighbourEnd) = adjacent_vertices(val, g);
-	for (; neighbourIt != neighbourEnd; ++neighbourIt){
-		int tmp=In_community(part,*neighbourIt);
-		if(In_tab(Neight,tmp)!=1 && In_tab(*part[In_community(part,val)],*neighbourIt)!=1)
-			Neight.push_back(tmp);
-	}
-	std::sort(Neight);
-	return Neight;
-}*/
-
-/**
- *
- * @param part
- * @param community
- * @param g
- * @return
- */
-/*Entiers Part_Neight_community(const EntiersEntiers &part,int community, UnorientedGraph &g){
-	Entiers Neight;
-	for(uint i =0;i<part[community]->size();i++){
-		tie(neighbourIt, neighbourEnd) = adjacent_vertices(part[community]->at(i), g);
-		for (; neighbourIt != neighbourEnd; ++neighbourIt){
-			int tmp=In_community(part,*neighbourIt);
-			if(In_tab(Neight,tmp)!=1 && tmp!=community)
-				Neight.push_back(tmp);
-		}
-	}
-	std::sort(Neight);
-	return Neight;
-}*/
-
-void make_unoriented_graph(const OrientedGraph& og, UnorientedGraph& ug)
-{
-    std::vector < vertex_t > ug_vertex_list;
-    std::vector < vertex_t > og_vertex_list;
-
-    for (uint i = 0; i < num_vertices(og); ++i) {
-        ug_vertex_list.push_back(add_vertex(ug));
-    }
-
-    OrientedGraph::vertex_iterator it_og, end_og;
-    UnorientedGraph::vertex_iterator it_ug, end_ug;
-
-    tie(it_og, end_og) = vertices(og);
-    tie(it_ug, end_ug) = vertices(ug);
-    for (; it_og != end_og; ++it_og, ++it_ug) {
-        ug[*it_ug] = og[*it_og];
-        og_vertex_list.push_back(*it_og);
-    }
-
-    OrientedGraph::edge_iterator ite_og, ende_og;
-
-    tie(ite_og, ende_og) = edges(og);
-    for (; ite_og != ende_og; ++ite_og) {
-        boost::add_edge(source(*ite_og, og), target(*ite_og, og),
-                        og[*ite_og], ug);
-    }
-
-    // std::cout << "Oriented graph: " << std::endl;
-    // tie(it_og, end_og) = vertices(og);
-    // for (; it_og != end_og; ++it_og) {
-    //     OrientedGraph::adjacency_iterator neighbour_it, neighbour_end;
-
-    //     std::cout << og[*it_og]._index << " is connected with ";
-    //     tie(neighbour_it, neighbour_end) = adjacent_vertices(*it_og, og);
-    //     for (; neighbour_it != neighbour_end; ++neighbour_it)
-    //         std::cout << og[*neighbour_it]._index << " ";
-    //     std::cout << " and weight = " << og[*it_og]._weight << std::endl;
-    // }
-    // std::cout << std::endl;
-
-    // std::cout << "Unoriented graph: " << std::endl;
-    // tie(it_ug, end_ug) = vertices(ug);
-    // for (; it_ug != end_ug; ++it_ug) {
-    //     UnorientedGraph::adjacency_iterator neighbour_it, neighbour_end;
-
-    //     std::cout << ug[*it_ug]._index << " is connected with ";
-    //     tie(neighbour_it, neighbour_end) = adjacent_vertices(*it_ug, ug);
-    //     for (; neighbour_it != neighbour_end; ++neighbour_it)
-    //         std::cout << ug[*neighbour_it]._index << " ";
-    //     std::cout << " and weight = " << ug[*it_ug]._weight << std::endl;
-    // }
-    // std::cout << std::endl;
-}
-
-void adjacence_ggp(int vertex, Entiers &sommets_adj, UnorientedGraph *g)
-{
-    tie(neighbourIt, neighbourEnd) = adjacent_vertices(vertex, *g);
-    for (; neighbourIt != neighbourEnd; ++neighbourIt)
-    {
-        sommets_adj.push_back(*neighbourIt);
-    }
-
-}
-
-float modif_Cout_coupe(const Entiers &P, int val, float cut, UnorientedGraph *g)
-{
-    //std::cout<<"Cout de coupe initiale : "<<cut<<std::endl;
-    //std::cout<<"degré du sommet tiré : "<<Degree(*g,val)<<std::endl;
-    double cpt=0;
-    float new_cut;
-    tie(neighbourIt, neighbourEnd) = adjacent_vertices(val, *g);
-    for (; neighbourIt != neighbourEnd; neighbourIt++){
-        if(In_tab(P,*neighbourIt)==1){
-            cpt++;
-        }
-    }
-    new_cut = cut + (Degree(*g,val) - (2 * cpt));
-    return new_cut;
-}
-
-
-} } } // namespace paradevs tests boost_graph

+ 0 - 114
src/tests/boost_graph/partitioning/utils.hpp

@@ -1,114 +0,0 @@
-/**
- * @file tests/boost_graph/partitioning/utils.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 TESTS_BOOST_GRAPH_PARTITIONING_UTILS_H
-#define TESTS_BOOST_GRAPH_PARTITIONING_UTILS_H 1
-
-#include <tests/boost_graph/partitioning/defs.hpp>
-
-namespace paradevs { namespace tests { namespace boost_graph {
-
-void Global_Neigh_community(UnorientedGraph *g,
-                            const EntiersEntiers &Partition,
-                            Entiers *community, int vertex, int comm_in);
-
-OrientedGraphs Graph_Partition(const EntiersEntiers &Partition,
-                               OrientedGraph *go,
-                               UnorientedGraph *g,
-                               OutputEdgeList &outputedgelist,
-                               InputEdgeList &inputedgelist,
-                               Connections &connections);
-
-void List_edge_partie(Entiers *Partie, OrientedGraph *go, Edges &edge_partie,
-                      OutputEdges &outputedgespartie);
-
-void construire_graph(UnorientedGraph *g, OrientedGraph *graph);
-
-double Modif_Cut_one_cluster(Entiers &cluster, UnorientedGraph &g, double &vol);
-
-std::vector<double> modif_cut_tmp(UnorientedGraph *g, EntiersEntiers &Partition,
-                             std::vector<std::vector<double> > tabe_cut,
-                                  int vertexs,
-                             int comm_in, Entiers community, double cut,
-                             std::string name);
-
-double Calcul_poids(Entiers *partie, UnorientedGraph *g);
-
-bool Est_connexe(UnorientedGraph *g, EntiersEntiers Partition, Entiers &part);
-
-void Affinage_equilibrage_charge(UnorientedGraph *g, EntiersEntiers &Partition);
-
-Entiers Neigh_community(UnorientedGraph *g, EntiersEntiers &Partition,
-                        int vertex, int comm_in);
-
-void Modif_fonction_Gain_Cut(EntiersEntiers &Partition,UnorientedGraph *g,
-                             Entiers &community, int val, double &cut,
-                             std::string name);
-
-void Affinage_recherche_locale(UnorientedGraph *g, EntiersEntiers &Partition,
-                               double &cut, std::string name);
-
-void projection(EntiersEntiers &Partition,ListEntiersEntiers::iterator lit);
-
-bool contraction_HEM(UnorientedGraph *g, Base_Graph &baseg,
-                     ListEntiersEntiers &liste_corr, int val_reduc,
-                     int &val_cpt);
-bool contraction_Random_Maching(UnorientedGraph *g, Base_Graph &baseg,
-                                ListEntiersEntiers &liste_corr, int val_reduc,
-                                int &val_cpt);
-
-Entiers Liste_adjacence(UnorientedGraph &g, int vertexs,
-                        const Entiers &random_vertices);
-
-int rand_fini(int a, int b);
-int recherche_val2(const std::vector<float> &tab,float val);
-int recherche_val_double(const std::vector<double> &tab,double val);
-int recherche_val(const std::vector<int> &tab,int val);
-int dichotomie(const Entiers &tab,int i);
-void suprim_val(Entiers &tab,int i);
-bool In_tab(const Entiers &tab, int val);
-bool In_tab_dichotomie(const Entiers &tab, int val);
-double Cut_cluster(const EntiersEntiers &tab_cluster,UnorientedGraph &g,
-                   std::string name);
-void Modif_fonction_Gain_Cut(EntiersEntiers &Partition,UnorientedGraph *g,
-                             int community_out,int community_in,int val,
-                             double &cut);
-void Liste_Voisin(const Entiers &P,Entiers &tab,const UnorientedGraph &g);
-int Cout_coupe(Entiers P,int val, UnorientedGraph &g);
-double Cout_coupe_pond(Entiers P,int val, UnorientedGraph &g);
-int In_community_dichotomie(const EntiersEntiers &part, int val);
-double Degree(UnorientedGraph &g , int node);
-double Cluster_Degree(UnorientedGraph &g , const Entiers &cluster);
-
-void make_unoriented_graph(const OrientedGraph& og, UnorientedGraph& uog);
-
-void adjacence_ggp(int vertex, Entiers &sommets_adj, UnorientedGraph *g);
-
-float modif_Cout_coupe(const Entiers &P, int val, float cut, UnorientedGraph *g);
-
-} } } // namespace paradevs tests boost_graph
-
-#endif

+ 0 - 378
src/tests/boost_graph/tests.cpp

@@ -1,378 +0,0 @@
-/**
- * @file tests/boost_graph/tests.cpp
- * @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/>.
- */
-
-#include <boost/timer.hpp>
-
-#include <common/RootCoordinator.hpp>
-
-#include <tests/boost_graph/models.hpp>
-#include <tests/boost_graph/graph_builder.hpp>
-#include <tests/boost_graph/graph_manager.hpp>
-#include <tests/boost_graph/graph_partitioning.hpp>
-
-using namespace paradevs::common;
-using namespace paradevs::common::scheduler;
-using namespace paradevs::pdevs;
-using namespace paradevs::tests::boost_graph;
-
-template < class GraphBuilder >
-void flat_heap_test(double duration)
-{
-    RootCoordinator <
-        DoubleTime,
-        paradevs::pdevs::Coordinator <
-            DoubleTime,
-            SchedulerType,
-            SchedulerHandle,
-            InBuildFlatGraphManager <
-                SchedulerHandle,
-                GraphBuilder >,
-            paradevs::common::NoParameters,
-            paradevs::common::NoParameters >
-    > rc(0, duration, "root", NoParameters(), NoParameters());
-
-    rc.run();
-}
-
-template < class GraphBuilder >
-void flat_vector_test(double duration)
-{
-    RootCoordinator <
-        DoubleTime,
-        paradevs::pdevs::Coordinator <
-            DoubleTime,
-            paradevs::common::scheduler::VectorScheduler <
-                paradevs::common::DoubleTime >,
-            paradevs::common::scheduler::NoSchedulerHandle,
-            InBuildFlatGraphManager <
-                paradevs::common::scheduler::NoSchedulerHandle,
-                GraphBuilder >,
-            paradevs::common::NoParameters,
-            paradevs::common::NoParameters >
-    > rc(0, duration, "root", NoParameters(), NoParameters());
-
-    rc.run();
-}
-
-void hierarchical_test()
-{
-    // RootCoordinator <
-    //     DoubleTime,
-    //     paradevs::pdevs::Coordinator <
-    //         DoubleTime,
-    //         SchedulerType,
-    //         SchedulerHandle,
-    //         HierarchicalGraphManager <
-    //             SchedulerHandle,
-    //             HierarchicalGraphBuilder >,
-    //         paradevs::common::NoParameters,
-    //         paradevs::common::NoParameters >
-    //     > rc(0, 100, "root", NoParameters(), NoParameters());
-
-    // rc.run();
-}
-
-void parallel_partitionning_heap_test(double duration,
-                                      int cluster_number,
-                                      std::string partitioning_method_name,
-                                      int contraction_coef,
-                                      bool contraction_coef_flag)
-{
-    RootCoordinator <
-        DoubleTime,
-        paradevs::pdevs::multithreading::Coordinator <
-            DoubleTime,
-            SchedulerType,
-            SchedulerHandle,
-            ParallelHeapHierarchicalGraphManager <
-                SchedulerHandle,
-                PartitioningGraphBuilder >,
-            paradevs::common::NoParameters,
-            PartitioningParameters >
-        > rc(0, duration, "root", NoParameters(),
-             PartitioningParameters(cluster_number, partitioning_method_name,
-                                    contraction_coef, contraction_coef_flag));
-
-    rc.run();
-}
-
-void partitionning_heap_test(double duration,
-                             int cluster_number,
-                             std::string partitioning_method_name,
-                             int contraction_coef,
-                             bool contraction_coef_flag)
-{
-    RootCoordinator <
-        DoubleTime,
-        paradevs::pdevs::Coordinator <
-            DoubleTime,
-            SchedulerType,
-            SchedulerHandle,
-            HeapHierarchicalGraphManager <
-                SchedulerHandle,
-                PartitioningGraphBuilder >,
-            paradevs::common::NoParameters,
-            PartitioningParameters >
-        > rc(0, duration, "root", NoParameters(),
-             PartitioningParameters(cluster_number, partitioning_method_name,
-                                    contraction_coef, contraction_coef_flag));
-
-    rc.run();
-}
-
-void partitionning_vector_test(double duration,
-                               int cluster_number,
-                               std::string partitioning_method_name,
-                               int contraction_coef,
-                               bool contraction_coef_flag)
-{
-    RootCoordinator <
-        DoubleTime,
-        paradevs::pdevs::Coordinator <
-            DoubleTime,
-            paradevs::common::scheduler::VectorScheduler <
-                paradevs::common::DoubleTime >,
-            paradevs::common::scheduler::NoSchedulerHandle,
-            VectorHierarchicalGraphManager <
-                paradevs::common::scheduler::NoSchedulerHandle,
-                PartitioningGraphBuilder >,
-            paradevs::common::NoParameters,
-            PartitioningParameters >
-        > rc(0, duration, "root", NoParameters(),
-             PartitioningParameters(cluster_number, partitioning_method_name,
-                                    contraction_coef, contraction_coef_flag));
-
-    rc.run();
-}
-
-void test(double duration, std::string partitioning_method_name,
-          unsigned int min, unsigned int max, unsigned int step,
-          bool vector, bool heap,
-          int contraction_coef,
-          bool contraction_coef_flag)
-{
-    boost::timer t;
-
-    std::cout << "==== " << partitioning_method_name << " with ";
-    if (contraction_coef_flag) {
-        std::cout << "/";
-    }
-    std::cout << contraction_coef << " ===" << std::endl;
-    std::cout << "n";
-    if (heap) {
-        std::cout << "\t heap";
-    }
-    if (vector) {
-        std::cout << "\t vector";
-    }
-    std::cout << std::endl;
-
-    if (contraction_coef_flag) {
-        for (unsigned int n = min; n <= max; n += step) {
-            std::cout << n << "\t";
-            if (heap) {
-                double t1 = t.elapsed();
-
-                for (unsigned int i = 0; i < 20; ++i) {
-                    partitionning_heap_test(duration, n,
-                                            partitioning_method_name,
-                                            contraction_coef,
-                                            contraction_coef_flag);
-                }
-
-                double t2 = t.elapsed();
-
-                std::cout << (t2 - t1) / 20 << "\t";
-            }
-            if (vector) {
-                double t1 = t.elapsed();
-
-                for (unsigned int i = 0; i < 20; ++i) {
-                    partitionning_vector_test(duration, n,
-                                              partitioning_method_name,
-                                              contraction_coef,
-                                              contraction_coef_flag);
-                }
-
-                double t2 = t.elapsed();
-
-                std::cout << (t2 - t1) / 20 << std::endl;
-            } else {
-                std::cout << std::endl;
-            }
-
-        }
-    } else {
-        std::cout << contraction_coef << "\t";
-        if (heap) {
-            double t1 = t.elapsed();
-
-            for (unsigned int i = 0; i < 20; ++i) {
-                partitionning_heap_test(duration, contraction_coef,
-                                        partitioning_method_name,
-                                        contraction_coef,
-                                        contraction_coef_flag);
-            }
-
-            double t2 = t.elapsed();
-
-            std::cout << (t2 - t1) / 20 << "\t";
-        }
-        if (vector) {
-            double t1 = t.elapsed();
-
-            for (unsigned int i = 0; i < 20; ++i) {
-                partitionning_vector_test(duration, contraction_coef,
-                                          partitioning_method_name,
-                                          contraction_coef,
-                                          contraction_coef_flag);
-                }
-
-            double t2 = t.elapsed();
-
-            std::cout << (t2 - t1) / 20 << std::endl;
-        } else {
-            std::cout << std::endl;
-        }
-    }
-}
-
-void test_flat_38()
-{
-    boost::timer t;
-
-    std::cout << "== 38 nodes ==" << std::endl;
-    std::cout << "flat graph with heap = ";
-    for (unsigned int i = 0; i < 20; ++i) {
-        flat_heap_test< FlatGraphBuilder >(10000);
-    }
-
-    double t2 = t.elapsed();
-
-    std::cout << t2 / 20 << std::endl;
-
-    std::cout << "flat graph with vector = ";
-    for (unsigned int i = 0; i < 20; ++i) {
-        flat_vector_test< FlatGraphBuilder >(10000);
-    }
-
-    double t3 = t.elapsed();
-
-    std::cout << (t3 - t2) / 20 << std::endl;
-}
-
-const double duration_38 = -1;
-
-void test_partiotining_38()
-{
-    for (int i = 1; i <= 2; ++i) {
-        test(duration_38, "ggp", 2, 16, 2, true, true, i, true);
-        test(duration_38, "gggp_pond", 2, 16, 2, true, true, i, true);
-        test(duration_38, "random", 2, 16, 2, true, true, i, true);
-    }
-
-    for (int i = 2; i <= 8; i += 2) {
-        test(duration_38, "gggp_pond", 0, 0, 0, true, true, i, false);
-    }
-}
-
-const double corsen_duration = 20;
-
-void test_flat_corsen()
-{
-    boost::timer t;
-
-    std::cout << "== CORSEN == " << std::endl;
-    std::cout << "flat graph with heap = ";
-    for (unsigned int i = 0; i < 20; ++i) {
-        flat_heap_test< CorsenFlatGraphBuilder >(corsen_duration);
-    }
-
-    double t2 = t.elapsed();
-
-    std::cout << t2 / 20 << std::endl;
-
-    // std::cout << "flat graph with vector = ";
-    // for (unsigned int i = 0; i < 20; ++i) {
-    //     flat_vector_test< CorsenFlatGraphBuilder >(corsen_duration);
-    // }
-
-    // double t3 = t.elapsed();
-
-    // std::cout << (t3 - t2) / 20 << std::endl;
-}
-
-void test_partitioning_corsen()
-{
-    test(corsen_duration, "gggp_pond", 2, 32, 2, false, true, 10, true);
-    test(corsen_duration, "gggp_pond", 2, 32, 2, false, true, 20, true);
-    test(corsen_duration, "gggp_pond", 2, 32, 2, false, true, 40, true);
-    test(corsen_duration, "gggp_pond", 2, 32, 2, false, true, 80, true);
-    test(corsen_duration, "gggp_pond", 2, 22, 2, false, true, 200, true);
-
-    test(corsen_duration, "gggp_pond", 2, 32, 2, false, true, 30, false);
-    test(corsen_duration, "gggp_pond", 2, 32, 2, false, true, 40, false);
-    test(corsen_duration, "gggp_pond", 2, 32, 2, false, true, 50, false);
-    test(corsen_duration, "gggp_pond", 2, 32, 2, false, true, 60, false);
-    test(corsen_duration, "gggp_pond", 2, 32, 2, false, true, 70, false);
-    test(corsen_duration, "gggp_pond", 2, 32, 2, false, true, 80, false);
-    test(corsen_duration, "gggp_pond", 2, 32, 2, false, true, 90, false);
-    test(corsen_duration, "gggp_pond", 2, 32, 2, false, true, 100, false);
-
-    test(corsen_duration, "ggp", 2, 32, 2, false, true, 10, true);
-    test(corsen_duration, "ggp", 2, 32, 2, false, true, 20, true);
-    test(corsen_duration, "ggp", 2, 32, 2, false, true, 40, true);
-    test(corsen_duration, "ggp", 2, 32, 2, false, true, 80, true);
-    test(corsen_duration, "ggp", 2, 22, 2, false, true, 200, true);
-
-    test(corsen_duration, "ggp", 2, 32, 2, false, true, 30, false);
-    test(corsen_duration, "ggp", 2, 32, 2, false, true, 40, false);
-    test(corsen_duration, "ggp", 2, 32, 2, false, true, 50, false);
-    test(corsen_duration, "ggp", 2, 32, 2, false, true, 60, false);
-    test(corsen_duration, "ggp", 2, 32, 2, false, true, 70, false);
-    test(corsen_duration, "ggp", 2, 32, 2, false, true, 80, false);
-    test(corsen_duration, "ggp", 2, 32, 2, false, true, 90, false);
-    test(corsen_duration, "ggp", 2, 32, 2, false, true, 100, false);
-
-    test(corsen_duration, "random", 2, 32, 2, false, true, 10, true);
-    test(corsen_duration, "random", 2, 32, 2, false, true, 20, true);
-    test(corsen_duration, "random", 2, 32, 2, false, true, 40, true);
-    test(corsen_duration, "random", 2, 32, 2, false, true, 80, true);
-    test(corsen_duration, "random", 2, 22, 2, false, true, 200, true);
-}
-
-int main()
-{
-    srand(7262);
-
-    // test_flat_38();
-    // test_partiotining_38();
-
-    test_flat_corsen();
-    test_partitioning_corsen();
-
-    return 0;
-}

+ 0 - 6446
src/tests/catch.hpp

@@ -1,6446 +0,0 @@
-/*
- *  Generated: 2013-02-19 08:44:57.311773
- *  ----------------------------------------------------------
- *  This file has been merged from multiple headers. Please don't edit it directly
- *  Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
- *
- *  Distributed under the Boost Software License, Version 1.0. (See accompanying
- *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
-#define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
-
-#define TWOBLUECUBES_CATCH_HPP_INCLUDED
-
-#ifdef __clang__
-#pragma clang diagnostic ignored "-Wglobal-constructors"
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpadded"
-#endif
-
-// #included from: internal/catch_notimplemented_exception.h
-#define TWOBLUECUBES_CATCH_NOTIMPLEMENTED_EXCEPTION_H_INCLUDED
-
-// #included from: catch_common.h
-#define TWOBLUECUBES_CATCH_COMMON_H_INCLUDED
-
-#define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line
-#define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line )
-#define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ )
-
-#define INTERNAL_CATCH_STRINGIFY2( expr ) #expr
-#define INTERNAL_CATCH_STRINGIFY( expr ) INTERNAL_CATCH_STRINGIFY2( expr )
-
-#ifdef __GNUC__
-#define CATCH_ATTRIBUTE_NORETURN __attribute__ ((noreturn))
-#else
-#define CATCH_ATTRIBUTE_NORETURN
-#endif
-
-#include <sstream>
-#include <stdexcept>
-#include <algorithm>
-
-namespace Catch {
-
-	class NonCopyable {
-		NonCopyable( const NonCopyable& );
-		void operator = ( const NonCopyable& );
-	protected:
-		NonCopyable() {}
-		virtual ~NonCopyable();
-	};
-
-    class SafeBool {
-    public:
-        typedef void (SafeBool::*type)() const;
-
-        static type makeSafe( bool value ) {
-            return value ? &SafeBool::trueValue : 0;
-        }
-    private:
-        void trueValue() const {}
-    };
-
-    template<typename ContainerT>
-    inline void deleteAll( ContainerT& container ) {
-        typename ContainerT::const_iterator it = container.begin();
-        typename ContainerT::const_iterator itEnd = container.end();
-        for(; it != itEnd; ++it )
-        {
-            delete *it;
-        }
-    }
-    template<typename AssociativeContainerT>
-    inline void deleteAllValues( AssociativeContainerT& container ) {
-        typename AssociativeContainerT::const_iterator it = container.begin();
-        typename AssociativeContainerT::const_iterator itEnd = container.end();
-        for(; it != itEnd; ++it )
-        {
-            delete it->second;
-        }
-    }
-
-    template<typename ContainerT, typename Function>
-    inline void forEach( ContainerT& container, Function function ) {
-        std::for_each( container.begin(), container.end(), function );
-    }
-
-    template<typename ContainerT, typename Function>
-    inline void forEach( const ContainerT& container, Function function ) {
-        std::for_each( container.begin(), container.end(), function );
-    }
-
-    inline bool startsWith( const std::string& s, const std::string& prefix ) {
-        return s.size() >= prefix.size() && s.substr( 0, prefix.size() ) == prefix;
-    }
-    inline bool endsWith( const std::string& s, const std::string& suffix ) {
-        return s.size() >= suffix.size() && s.substr( s.size()-suffix.size(), suffix.size() ) == suffix;
-    }
-    inline bool contains( const std::string& s, const std::string& infix ) {
-        return s.find( infix ) != std::string::npos;
-    }
-
-    struct pluralise {
-        pluralise( std::size_t count, const std::string& label )
-        :   m_count( count ),
-            m_label( label )
-        {}
-
-        friend std::ostream& operator << ( std::ostream& os, const pluralise& pluraliser ) {
-            os << pluraliser.m_count << " " << pluraliser.m_label;
-            if( pluraliser.m_count != 1 )
-                os << "s";
-            return os;
-        }
-
-        std::size_t m_count;
-        std::string m_label;
-    };
-
-    struct SourceLineInfo {
-
-        SourceLineInfo() : line( 0 ){}
-        SourceLineInfo( const std::string& _file, std::size_t _line )
-        :   file( _file ),
-            line( _line )
-        {}
-        SourceLineInfo( const SourceLineInfo& other )
-        :   file( other.file ),
-            line( other.line )
-        {}
-        bool empty() const {
-            return file.empty();
-        }
-
-        std::string file;
-        std::size_t line;
-    };
-
-    inline std::ostream& operator << ( std::ostream& os, const SourceLineInfo& info ) {
-#ifndef __GNUG__
-        os << info.file << "(" << info.line << "): ";
-#else
-        os << info.file << ":" << info.line << ": ";
-#endif
-        return os;
-    }
-
-    CATCH_ATTRIBUTE_NORETURN
-    inline void throwLogicError( const std::string& message, const SourceLineInfo& locationInfo ) {
-        std::ostringstream oss;
-        oss << "Internal Catch error: '" << message << "' at: " << locationInfo;
-        throw std::logic_error( oss.str() );
-    }
-}
-
-#define CATCH_INTERNAL_LINEINFO ::Catch::SourceLineInfo( __FILE__, static_cast<std::size_t>( __LINE__ ) )
-#define CATCH_INTERNAL_ERROR( msg ) ::Catch::throwLogicError( msg, CATCH_INTERNAL_LINEINFO );
-
-#include <ostream>
-
-namespace Catch {
-
-    class NotImplementedException : public std::exception
-    {
-    public:
-        NotImplementedException( const SourceLineInfo& lineInfo );
-
-        virtual ~NotImplementedException() throw() {}
-
-        virtual const char* what() const throw();
-
-    private:
-        std::string m_what;
-        SourceLineInfo m_lineInfo;
-    };
-
-} // end namespace Catch
-
-///////////////////////////////////////////////////////////////////////////////
-#define CATCH_NOT_IMPLEMENTED throw Catch::NotImplementedException( CATCH_INTERNAL_LINEINFO )
-
-// #included from: internal/catch_context.h
-#define TWOBLUECUBES_CATCH_CONTEXT_H_INCLUDED
-
-// #included from: catch_interfaces_generators.h
-#define TWOBLUECUBES_CATCH_INTERFACES_GENERATORS_H_INCLUDED
-
-#include <string>
-
-namespace Catch {
-
-    struct IGeneratorInfo {
-        virtual ~IGeneratorInfo();
-        virtual bool moveNext() = 0;
-        virtual std::size_t getCurrentIndex() const = 0;
-    };
-
-    struct IGeneratorsForTest {
-        virtual ~IGeneratorsForTest();
-
-        virtual IGeneratorInfo& getGeneratorInfo( const std::string& fileInfo, std::size_t size ) = 0;
-        virtual bool moveNext() = 0;
-    };
-
-    IGeneratorsForTest* createGeneratorsForTest();
-
-} // end namespace Catch
-
-#include <memory>
-#include <vector>
-#include <stdlib.h>
-
-namespace Catch {
-
-    class TestCaseInfo;
-    class Stream;
-    struct IResultCapture;
-    struct IRunner;
-    struct IGeneratorsForTest;
-    struct IConfig;
-
-    struct IContext
-    {
-        virtual ~IContext();
-
-        virtual IResultCapture& getResultCapture() = 0;
-        virtual IRunner& getRunner() = 0;
-        virtual size_t getGeneratorIndex( const std::string& fileInfo, size_t totalSize ) = 0;
-        virtual bool advanceGeneratorsForCurrentTest() = 0;
-        virtual const IConfig* getConfig() const = 0;
-    };
-
-    struct IMutableContext : IContext
-    {
-        virtual ~IMutableContext();
-        virtual void setResultCapture( IResultCapture* resultCapture ) = 0;
-        virtual void setRunner( IRunner* runner ) = 0;
-        virtual void setConfig( const IConfig* config ) = 0;
-    };
-
-    IContext& getCurrentContext();
-    IMutableContext& getCurrentMutableContext();
-    void cleanUpContext();
-    Stream createStream( const std::string& streamName );
-
-}
-
-// #included from: internal/catch_test_registry.hpp
-#define TWOBLUECUBES_CATCH_TEST_REGISTRY_HPP_INCLUDED
-
-// #included from: catch_interfaces_testcase.h
-#define TWOBLUECUBES_CATCH_INTERFACES_TESTCASE_H_INCLUDED
-
-// #included from: catch_ptr.hpp
-#define TWOBLUECUBES_CATCH_PTR_HPP_INCLUDED
-
-namespace Catch {
-
-    // An intrusive reference counting smart pointer.
-    // T must implement addRef() and release() methods
-    // typically implementing the IShared interface
-    template<typename T>
-    class Ptr {
-    public:
-        Ptr() : m_p( NULL ){}
-        Ptr( T* p ) : m_p( p ){
-            if( m_p )
-                m_p->addRef();
-        }
-        Ptr( const Ptr& other ) : m_p( other.m_p ){
-            if( m_p )
-                m_p->addRef();
-        }
-        ~Ptr(){
-            if( m_p )
-                m_p->release();
-        }
-        Ptr& operator = ( T* p ){
-            Ptr temp( p );
-            swap( temp );
-            return *this;
-        }
-        Ptr& operator = ( const Ptr& other ){
-            Ptr temp( other );
-            swap( temp );
-            return *this;
-        }
-        void swap( Ptr& other ){
-            std::swap( m_p, other.m_p );
-        }
-
-        T* get(){
-            return m_p;
-        }
-        const T* get() const{
-            return m_p;
-        }
-
-        T& operator*() const {
-            return *m_p;
-        }
-
-        T* operator->() const {
-            return m_p;
-        }
-
-        bool operator !() const {
-            return m_p == NULL;
-        }
-
-    private:
-        T* m_p;
-    };
-
-    struct IShared : NonCopyable {
-        virtual ~IShared();
-        virtual void addRef() = 0;
-        virtual void release() = 0;
-    };
-
-    template<typename T>
-    struct SharedImpl : T {
-
-        SharedImpl() : m_rc( 0 ){}
-
-        virtual void addRef(){
-            ++m_rc;
-        }
-        virtual void release(){
-            if( --m_rc == 0 )
-                delete this;
-        }
-
-        int m_rc;
-    };
-
-} // end namespace Catch
-
-#include <vector>
-
-namespace Catch {
-
-    class TestCaseFilters;
-
-    struct ITestCase : IShared {
-        virtual void invoke () const = 0;
-    protected:
-        virtual ~ITestCase();
-    };
-
-    class TestCaseInfo;
-
-    struct ITestCaseRegistry {
-        virtual ~ITestCaseRegistry();
-        virtual const std::vector<TestCaseInfo>& getAllTests() const = 0;
-        virtual std::vector<TestCaseInfo> getMatchingTestCases( const std::string& rawTestSpec ) const = 0;
-    };
-}
-
-namespace Catch {
-
-template<typename C>
-class MethodTestCase : public SharedImpl<ITestCase> {
-
-public:
-    MethodTestCase( void (C::*method)() ) : m_method( method ) {}
-
-    virtual void invoke() const {
-        C obj;
-        (obj.*m_method)();
-    }
-
-private:
-    virtual ~MethodTestCase() {}
-
-    void (C::*m_method)();
-};
-
-typedef void(*TestFunction)();
-
-struct AutoReg {
-
-    AutoReg(    TestFunction function,
-                const char* name,
-                const char* description,
-                const SourceLineInfo& lineInfo );
-
-    template<typename C>
-    AutoReg(    void (C::*method)(),
-                const char* className,
-                const char* name,
-                const char* description,
-                const SourceLineInfo& lineInfo ) {
-        registerTestCase( new MethodTestCase<C>( method ), className, name, description, lineInfo );
-    }
-
-    void registerTestCase(  ITestCase* testCase,
-                            const char* className,
-                            const char* name,
-                            const char* description,
-                            const SourceLineInfo& lineInfo );
-
-    ~AutoReg();
-
-private:
-    AutoReg( const AutoReg& );
-    void operator= ( const AutoReg& );
-};
-
-} // end namespace Catch
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_TESTCASE( Name, Desc ) \
-    static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )(); \
-    namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME(  TestCaseFunction_catch_internal_ ), Name, Desc, CATCH_INTERNAL_LINEINFO ); }\
-    static void INTERNAL_CATCH_UNIQUE_NAME(  TestCaseFunction_catch_internal_ )()
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_TESTCASE_NORETURN( Name, Desc ) \
-    static void INTERNAL_CATCH_UNIQUE_NAME( TestCaseFunction_catch_internal_ )() CATCH_ATTRIBUTE_NORETURN; \
-    namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME(  TestCaseFunction_catch_internal_ ), Name, Desc, CATCH_INTERNAL_LINEINFO ); }\
-    static void INTERNAL_CATCH_UNIQUE_NAME(  TestCaseFunction_catch_internal_ )()
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, Name, Desc ) \
-    namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Name, Desc, CATCH_INTERNAL_LINEINFO ); }
-
-///////////////////////////////////////////////////////////////////////////////
-#define TEST_CASE_METHOD( ClassName, TestName, Desc )\
-    namespace{ \
-        struct INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ ) : ClassName{ \
-            void test(); \
-        }; \
-        Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ )::test, #ClassName, TestName, Desc, CATCH_INTERNAL_LINEINFO ); \
-    } \
-    void INTERNAL_CATCH_UNIQUE_NAME( TestCaseMethod_catch_internal_ )::test()
-
-// #included from: internal/catch_capture.hpp
-#define TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED
-
-// #included from: catch_expression_decomposer.hpp
-#define TWOBLUECUBES_CATCH_EXPRESSION_DECOMPOSER_HPP_INCLUDED
-
-// #included from: catch_expression_lhs.hpp
-#define TWOBLUECUBES_CATCH_EXPRESSION_LHS_HPP_INCLUDED
-
-// #included from: catch_expressionresult_builder.h
-#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_BUILDER_H_INCLUDED
-
-// #included from: catch_tostring.hpp
-#define TWOBLUECUBES_CATCH_TOSTRING_HPP_INCLUDED
-
-#include <sstream>
-
-#ifdef __OBJC__
-// #included from: catch_objc_arc.hpp
-#define TWOBLUECUBES_CATCH_OBJC_ARC_HPP_INCLUDED
-
-#import <Foundation/Foundation.h>
-
-#ifdef __has_feature
-#define CATCH_ARC_ENABLED __has_feature(objc_arc)
-#else
-#define CATCH_ARC_ENABLED 0
-#endif
-
-void arcSafeRelease( NSObject* obj );
-id performOptionalSelector( id obj, SEL sel );
-
-#if !CATCH_ARC_ENABLED
-inline void arcSafeRelease( NSObject* obj ) {
-    [obj release];
-}
-inline id performOptionalSelector( id obj, SEL sel ) {
-    if( [obj respondsToSelector: sel] )
-        return [obj performSelector: sel];
-    return nil;
-}
-#define CATCH_UNSAFE_UNRETAINED
-#define CATCH_ARC_STRONG
-#else
-inline void arcSafeRelease( NSObject* ){}
-inline id performOptionalSelector( id obj, SEL sel ) {
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
-#endif
-    if( [obj respondsToSelector: sel] )
-        return [obj performSelector: sel];
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-    return nil;
-}
-#define CATCH_UNSAFE_UNRETAINED __unsafe_unretained
-#define CATCH_ARC_STRONG __strong
-#endif
-
-#endif
-
-namespace Catch {
-namespace Detail {
-
-    struct NonStreamable {
-        template<typename T> NonStreamable( const T& ){}
-    };
-
-    // If the type does not have its own << overload for ostream then
-    // this one will be used instead
-    inline std::ostream& operator << ( std::ostream& ss, NonStreamable ){
-        return ss << "{?}";
-    }
-
-    template<typename T>
-    inline std::string makeString( const T& value ) {
-        std::ostringstream oss;
-        oss << value;
-        return oss.str();
-    }
-
-    template<typename T>
-    inline std::string makeString( T* p ) {
-        if( !p )
-            return INTERNAL_CATCH_STRINGIFY( NULL );
-        std::ostringstream oss;
-        oss << p;
-        return oss.str();
-    }
-
-    template<typename T>
-    inline std::string makeString( const T* p ) {
-        if( !p )
-            return INTERNAL_CATCH_STRINGIFY( NULL );
-        std::ostringstream oss;
-        oss << p;
-        return oss.str();
-    }
-
-} // end namespace Detail
-
-/// \brief converts any type to a string
-///
-/// The default template forwards on to ostringstream - except when an
-/// ostringstream overload does not exist - in which case it attempts to detect
-/// that and writes {?}.
-/// Overload (not specialise) this template for custom typs that you don't want
-/// to provide an ostream overload for.
-template<typename T>
-std::string toString( const T& value ) {
-    return Detail::makeString( value );
-}
-
-// Built in overloads
-
-inline std::string toString( const std::string& value ) {
-    return "\"" + value + "\"";
-}
-
-inline std::string toString( const std::wstring& value ) {
-    std::ostringstream oss;
-    oss << "\"";
-    for(size_t i = 0; i < value.size(); ++i )
-        oss << static_cast<char>( value[i] <= 0xff ? value[i] : '?');
-    oss << "\"";
-    return oss.str();
-}
-
-inline std::string toString( const char* const value ) {
-    return value ? Catch::toString( std::string( value ) ) : std::string( "{null string}" );
-}
-
-inline std::string toString( char* const value ) {
-    return Catch::toString( static_cast<const char*>( value ) );
-}
-
-inline std::string toString( int value ) {
-    std::ostringstream oss;
-    oss << value;
-    return oss.str();
-}
-
-inline std::string toString( unsigned long value ) {
-    std::ostringstream oss;
-    if( value > 8192 )
-        oss << "0x" << std::hex << value;
-    else
-        oss << value;
-    return oss.str();
-}
-
-inline std::string toString( unsigned int value ) {
-    return toString( static_cast<unsigned long>( value ) );
-}
-
-inline std::string toString( const double value ) {
-    std::ostringstream oss;
-    oss << value;
-    return oss.str();
-}
-
-inline std::string toString( bool value ) {
-    return value ? "true" : "false";
-}
-
-inline std::string toString( char value ) {
-    return value < ' '
-        ? toString( (unsigned int)value )
-        : Detail::makeString( value );
-}
-
-inline std::string toString( signed char value ) {
-    return toString( static_cast<char>( value ) );
-}
-
-#ifdef CATCH_CONFIG_CPP11_NULLPTR
-inline std::string toString( std::nullptr_t ) {
-    return "nullptr";
-}
-#endif
-
-#ifdef __OBJC__
-    inline std::string toString( NSString const * const& nsstring ) {
-        return std::string( "@\"" ) + [nsstring UTF8String] + "\"";
-    }
-    inline std::string toString( NSString * CATCH_ARC_STRONG const& nsstring ) {
-        return std::string( "@\"" ) + [nsstring UTF8String] + "\"";
-    }
-    inline std::string toString( NSObject* const& nsObject ) {
-        return toString( [nsObject description] );
-    }
-#endif
-
-} // end namespace Catch
-
-// #included from: catch_assertionresult.h
-#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_H_INCLUDED
-
-#include <string>
-// #included from: catch_result_type.h
-#define TWOBLUECUBES_CATCH_RESULT_TYPE_H_INCLUDED
-
-namespace Catch {
-
-    // ResultWas::OfType enum
-    struct ResultWas { enum OfType {
-        Unknown = -1,
-        Ok = 0,
-        Info = 1,
-        Warning = 2,
-
-        FailureBit = 0x10,
-
-        ExpressionFailed = FailureBit | 1,
-        ExplicitFailure = FailureBit | 2,
-
-        Exception = 0x100 | FailureBit,
-
-        ThrewException = Exception | 1,
-        DidntThrowException = Exception | 2
-
-    }; };
-
-    inline bool isOk( ResultWas::OfType resultType ) {
-        return ( resultType & ResultWas::FailureBit ) == 0;
-    }
-
-    // ResultAction::Value enum
-    struct ResultAction { enum Value {
-        None,
-        Failed = 1, // Failure - but no debug break if Debug bit not set
-        Debug = 2,  // If this bit is set, invoke the debugger
-        Abort = 4   // Test run should abort
-    }; };
-
-    // ResultDisposition::Flags enum
-    struct ResultDisposition { enum Flags {
-            Normal = 0x00,
-
-            ContinueOnFailure = 0x01,   // Failures fail test, but execution continues
-            NegateResult = 0x02,        // Prefix expressiom with !
-            SuppressFail = 0x04         // Failures are reported but do not fail the test
-    }; };
-
-    inline ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) {
-        return static_cast<ResultDisposition::Flags>( static_cast<int>( lhs ) | static_cast<int>( rhs ) );
-    }
-
-    inline bool shouldContinueOnFailure( int flags ) { return flags & ResultDisposition::ContinueOnFailure; }
-    inline bool shouldNegate( int flags ) { return flags & ResultDisposition::NegateResult; }
-    inline bool shouldSuppressFailure( int flags ) { return flags & ResultDisposition::SuppressFail; }
-
-} // end namespace Catch
-
-
-namespace Catch {
-
-    struct AssertionInfo
-    {
-        AssertionInfo() {}
-        AssertionInfo(  const std::string& _macroName,
-                        const SourceLineInfo& _lineInfo,
-                        const std::string& _capturedExpression,
-                        ResultDisposition::Flags _resultDisposition );
-
-        std::string macroName;
-        SourceLineInfo lineInfo;
-        std::string capturedExpression;
-        ResultDisposition::Flags resultDisposition;
-    };
-
-    struct AssertionResultData
-    {
-        AssertionResultData() : resultType( ResultWas::Unknown ) {}
-
-        std::string reconstructedExpression;
-        std::string message;
-        ResultWas::OfType resultType;
-    };
-
-    class AssertionResult {
-    public:
-        AssertionResult();
-        AssertionResult( const AssertionInfo& info, const AssertionResultData& data );
-        ~AssertionResult();
-
-        bool isOk() const;
-        bool succeeded() const;
-        ResultWas::OfType getResultType() const;
-        bool hasExpression() const;
-        bool hasMessage() const;
-        std::string getExpression() const;
-        bool hasExpandedExpression() const;
-        std::string getExpandedExpression() const;
-        std::string getMessage() const;
-        SourceLineInfo getSourceInfo() const;
-        std::string getTestMacroName() const;
-
-    protected:
-        AssertionInfo m_info;
-        AssertionResultData m_resultData;
-    };
-
-} // end namespace Catch
-
-// #included from: catch_evaluate.hpp
-#define TWOBLUECUBES_CATCH_EVALUATE_HPP_INCLUDED
-
-namespace Catch {
-namespace Internal {
-
-    enum Operator {
-        IsEqualTo,
-        IsNotEqualTo,
-        IsLessThan,
-        IsGreaterThan,
-        IsLessThanOrEqualTo,
-        IsGreaterThanOrEqualTo
-    };
-
-    template<Operator Op> struct OperatorTraits             { static const char* getName(){ return "*error*"; } };
-    template<> struct OperatorTraits<IsEqualTo>             { static const char* getName(){ return "=="; } };
-    template<> struct OperatorTraits<IsNotEqualTo>          { static const char* getName(){ return "!="; } };
-    template<> struct OperatorTraits<IsLessThan>            { static const char* getName(){ return "<"; } };
-    template<> struct OperatorTraits<IsGreaterThan>         { static const char* getName(){ return ">"; } };
-    template<> struct OperatorTraits<IsLessThanOrEqualTo>   { static const char* getName(){ return "<="; } };
-    template<> struct OperatorTraits<IsGreaterThanOrEqualTo>{ static const char* getName(){ return ">="; } };
-
-    // So the compare overloads can be operator agnostic we convey the operator as a template
-    // enum, which is used to specialise an Evaluator for doing the comparison.
-    template<typename T1, typename T2, Operator Op>
-    class Evaluator{};
-
-    template<typename T1, typename T2>
-    struct Evaluator<T1, T2, IsEqualTo> {
-        static bool evaluate( const T1& lhs, const T2& rhs) {
-            return const_cast<T1&>( lhs ) ==  const_cast<T2&>( rhs );
-        }
-    };
-    template<typename T1, typename T2>
-    struct Evaluator<T1, T2, IsNotEqualTo> {
-        static bool evaluate( const T1& lhs, const T2& rhs ) {
-            return const_cast<T1&>( lhs ) != const_cast<T2&>( rhs );
-        }
-    };
-    template<typename T1, typename T2>
-    struct Evaluator<T1, T2, IsLessThan> {
-        static bool evaluate( const T1& lhs, const T2& rhs ) {
-            return const_cast<T1&>( lhs ) < const_cast<T2&>( rhs );
-        }
-    };
-    template<typename T1, typename T2>
-    struct Evaluator<T1, T2, IsGreaterThan> {
-        static bool evaluate( const T1& lhs, const T2& rhs ) {
-            return const_cast<T1&>( lhs ) > const_cast<T2&>( rhs );
-        }
-    };
-    template<typename T1, typename T2>
-    struct Evaluator<T1, T2, IsGreaterThanOrEqualTo> {
-        static bool evaluate( const T1& lhs, const T2& rhs ) {
-            return const_cast<T1&>( lhs ) >= const_cast<T2&>( rhs );
-        }
-    };
-    template<typename T1, typename T2>
-    struct Evaluator<T1, T2, IsLessThanOrEqualTo> {
-        static bool evaluate( const T1& lhs, const T2& rhs ) {
-            return const_cast<T1&>( lhs ) <= const_cast<T2&>( rhs );
-        }
-    };
-
-    template<Operator Op, typename T1, typename T2>
-    bool applyEvaluator( const T1& lhs, const T2& rhs ) {
-        return Evaluator<T1, T2, Op>::evaluate( lhs, rhs );
-    }
-
-    // This level of indirection allows us to specialise for integer types
-    // to avoid signed/ unsigned warnings
-
-    // "base" overload
-    template<Operator Op, typename T1, typename T2>
-    bool compare( const T1& lhs, const T2& rhs ) {
-        return Evaluator<T1, T2, Op>::evaluate( lhs, rhs );
-    }
-
-    // unsigned X to int
-    template<Operator Op> bool compare( unsigned int lhs, int rhs ) {
-        return applyEvaluator<Op>( lhs, static_cast<unsigned int>( rhs ) );
-    }
-    template<Operator Op> bool compare( unsigned long lhs, int rhs ) {
-        return applyEvaluator<Op>( lhs, static_cast<unsigned int>( rhs ) );
-    }
-    template<Operator Op> bool compare( unsigned char lhs, int rhs ) {
-        return applyEvaluator<Op>( lhs, static_cast<unsigned int>( rhs ) );
-    }
-
-    // unsigned X to long
-    template<Operator Op> bool compare( unsigned int lhs, long rhs ) {
-        return applyEvaluator<Op>( lhs, static_cast<unsigned long>( rhs ) );
-    }
-    template<Operator Op> bool compare( unsigned long lhs, long rhs ) {
-        return applyEvaluator<Op>( lhs, static_cast<unsigned long>( rhs ) );
-    }
-    template<Operator Op> bool compare( unsigned char lhs, long rhs ) {
-        return applyEvaluator<Op>( lhs, static_cast<unsigned long>( rhs ) );
-    }
-
-    // int to unsigned X
-    template<Operator Op> bool compare( int lhs, unsigned int rhs ) {
-        return applyEvaluator<Op>( static_cast<unsigned int>( lhs ), rhs );
-    }
-    template<Operator Op> bool compare( int lhs, unsigned long rhs ) {
-        return applyEvaluator<Op>( static_cast<unsigned int>( lhs ), rhs );
-    }
-    template<Operator Op> bool compare( int lhs, unsigned char rhs ) {
-        return applyEvaluator<Op>( static_cast<unsigned int>( lhs ), rhs );
-    }
-
-    // long to unsigned X
-    template<Operator Op> bool compare( long lhs, unsigned int rhs ) {
-        return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs );
-    }
-    template<Operator Op> bool compare( long lhs, unsigned long rhs ) {
-        return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs );
-    }
-    template<Operator Op> bool compare( long lhs, unsigned char rhs ) {
-        return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs );
-    }
-
-    // pointer to long (when comparing against NULL)
-    template<Operator Op, typename T> bool compare( long lhs, T* rhs ) {
-        return Evaluator<T*, T*, Op>::evaluate( reinterpret_cast<T*>( lhs ), rhs );
-    }
-    template<Operator Op, typename T> bool compare( T* lhs, long rhs ) {
-        return Evaluator<T*, T*, Op>::evaluate( lhs, reinterpret_cast<T*>( rhs ) );
-    }
-
-    // pointer to int (when comparing against NULL)
-    template<Operator Op, typename T> bool compare( int lhs, T* rhs ) {
-        return Evaluator<T*, T*, Op>::evaluate( reinterpret_cast<T*>( lhs ), rhs );
-    }
-    template<Operator Op, typename T> bool compare( T* lhs, int rhs ) {
-        return Evaluator<T*, T*, Op>::evaluate( lhs, reinterpret_cast<T*>( rhs ) );
-    }
-
-} // end of namespace Internal
-} // end of namespace Catch
-
-namespace Catch {
-
-// Wraps the (stringised versions of) the lhs, operator and rhs of an expression - as well as
-// the result of evaluating it. This is used to build an AssertionResult object
-class ExpressionResultBuilder {
-public:
-
-    ExpressionResultBuilder( ResultWas::OfType resultType = ResultWas::Unknown );
-    ExpressionResultBuilder( const ExpressionResultBuilder& other );
-    ExpressionResultBuilder& operator=(const ExpressionResultBuilder& other );
-
-    ExpressionResultBuilder& setResultType( ResultWas::OfType result );
-    ExpressionResultBuilder& setResultType( bool result );
-    ExpressionResultBuilder& setLhs( const std::string& lhs );
-    ExpressionResultBuilder& setRhs( const std::string& rhs );
-    ExpressionResultBuilder& setOp( const std::string& op );
-
-    ExpressionResultBuilder& endExpression( ResultDisposition::Flags resultDisposition );
-
-    template<typename T>
-    ExpressionResultBuilder& operator << ( const T& value ) {
-        m_stream << value;
-        return *this;
-    }
-
-    std::string reconstructExpression( const AssertionInfo& info ) const;
-
-    AssertionResult buildResult( const AssertionInfo& info ) const;
-
-private:
-    AssertionResultData m_data;
-    struct ExprComponents {
-        ExprComponents() : shouldNegate( false ) {}
-        bool shouldNegate;
-        std::string lhs, rhs, op;
-    } m_exprComponents;
-    std::ostringstream m_stream;
-};
-
-} // end namespace Catch
-
-namespace Catch {
-
-struct STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison;
-
-// Wraps the LHS of an expression and captures the operator and RHS (if any) - wrapping them all
-// in an ExpressionResultBuilder object
-template<typename T>
-class ExpressionLhs {
-	void operator = ( const ExpressionLhs& );
-
-public:
-    ExpressionLhs( T lhs ) : m_lhs( lhs ) {}
-
-    template<typename RhsT>
-    ExpressionResultBuilder& operator == ( const RhsT& rhs ) {
-        return captureExpression<Internal::IsEqualTo>( rhs );
-    }
-
-    template<typename RhsT>
-    ExpressionResultBuilder& operator != ( const RhsT& rhs ) {
-        return captureExpression<Internal::IsNotEqualTo>( rhs );
-    }
-
-    template<typename RhsT>
-    ExpressionResultBuilder& operator < ( const RhsT& rhs ) {
-        return captureExpression<Internal::IsLessThan>( rhs );
-    }
-
-    template<typename RhsT>
-    ExpressionResultBuilder& operator > ( const RhsT& rhs ) {
-        return captureExpression<Internal::IsGreaterThan>( rhs );
-    }
-
-    template<typename RhsT>
-    ExpressionResultBuilder& operator <= ( const RhsT& rhs ) {
-        return captureExpression<Internal::IsLessThanOrEqualTo>( rhs );
-    }
-
-    template<typename RhsT>
-    ExpressionResultBuilder& operator >= ( const RhsT& rhs ) {
-        return captureExpression<Internal::IsGreaterThanOrEqualTo>( rhs );
-    }
-
-    ExpressionResultBuilder& operator == ( bool rhs ) {
-        return captureExpression<Internal::IsEqualTo>( rhs );
-    }
-
-    ExpressionResultBuilder& operator != ( bool rhs ) {
-        return captureExpression<Internal::IsNotEqualTo>( rhs );
-    }
-
-    ExpressionResultBuilder& endExpression( ResultDisposition::Flags resultDisposition ) {
-        bool value = m_lhs ? true : false;
-        return m_result
-            .setLhs( Catch::toString( value ) )
-            .setResultType( value )
-            .endExpression( resultDisposition );
-    }
-
-    // Only simple binary expressions are allowed on the LHS.
-    // If more complex compositions are required then place the sub expression in parentheses
-    template<typename RhsT> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator + ( const RhsT& );
-    template<typename RhsT> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator - ( const RhsT& );
-    template<typename RhsT> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator / ( const RhsT& );
-    template<typename RhsT> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator * ( const RhsT& );
-
-private:
-    template<Internal::Operator Op, typename RhsT>
-    ExpressionResultBuilder& captureExpression( const RhsT& rhs ) {
-        return m_result
-            .setResultType( Internal::compare<Op>( m_lhs, rhs ) )
-            .setLhs( Catch::toString( m_lhs ) )
-            .setRhs( Catch::toString( rhs ) )
-            .setOp( Internal::OperatorTraits<Op>::getName() );
-    }
-
-private:
-    ExpressionResultBuilder m_result;
-    T m_lhs;
-};
-
-} // end namespace Catch
-
-namespace Catch {
-
-// Captures the LHS of the expression and wraps it in an Expression Lhs object
-class ExpressionDecomposer {
-public:
-
-    template<typename T>
-    ExpressionLhs<const T&> operator->* ( const T & operand ) {
-        return ExpressionLhs<const T&>( operand );
-    }
-
-    ExpressionLhs<bool> operator->* ( bool value ) {
-        return ExpressionLhs<bool>( value );
-    }
-};
-
-} // end namespace Catch
-
-// #included from: catch_interfaces_capture.h
-#define TWOBLUECUBES_CATCH_INTERFACES_CAPTURE_H_INCLUDED
-
-#include <string>
-// #included from: catch_totals.hpp
-#define TWOBLUECUBES_CATCH_TOTALS_HPP_INCLUDED
-
-#include <cstddef>
-
-namespace Catch {
-
-    struct Counts {
-        Counts() : passed( 0 ), failed( 0 ) {}
-
-        Counts operator - ( const Counts& other ) const {
-            Counts diff;
-            diff.passed = passed - other.passed;
-            diff.failed = failed - other.failed;
-            return diff;
-        }
-        Counts& operator += ( const Counts& other ) {
-            passed += other.passed;
-            failed += other.failed;
-            return *this;
-        }
-
-        std::size_t total() const {
-            return passed + failed;
-        }
-
-        std::size_t passed;
-        std::size_t failed;
-    };
-
-    struct Totals {
-
-        Totals operator - ( const Totals& other ) const {
-            Totals diff;
-            diff.assertions = assertions - other.assertions;
-            diff.testCases = testCases - other.testCases;
-            return diff;
-        }
-
-        Totals delta( const Totals& prevTotals ) const {
-            Totals diff = *this - prevTotals;
-            if( diff.assertions.failed > 0 )
-                ++diff.testCases.failed;
-            else
-                ++diff.testCases.passed;
-            return diff;
-        }
-
-        Totals& operator += ( const Totals& other ) {
-            assertions += other.assertions;
-            testCases += other.testCases;
-            return *this;
-        }
-
-        Counts assertions;
-        Counts testCases;
-    };
-}
-
-
-namespace Catch {
-
-    class TestCaseInfo;
-    class ScopedInfo;
-    class ExpressionResultBuilder;
-    class AssertionResult;
-    struct AssertionInfo;
-
-    struct IResultCapture {
-
-        virtual ~IResultCapture();
-
-        virtual void testEnded( const AssertionResult& result ) = 0;
-        virtual bool sectionStarted(    const std::string& name,
-                                        const std::string& description,
-                                        const SourceLineInfo& lineInfo,
-                                        Counts& assertions ) = 0;
-        virtual void sectionEnded( const std::string& name, const Counts& assertions ) = 0;
-        virtual void pushScopedInfo( ScopedInfo* scopedInfo ) = 0;
-        virtual void popScopedInfo( ScopedInfo* scopedInfo ) = 0;
-        virtual bool shouldDebugBreak() const = 0;
-
-        virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult, const AssertionInfo& assertionInfo ) = 0;
-
-        virtual std::string getCurrentTestName() const = 0;
-        virtual const AssertionResult* getLastResult() const = 0;
-    };
-}
-
-// #included from: catch_debugger.hpp
-#define TWOBLUECUBES_CATCH_DEBUGGER_HPP_INCLUDED
-
-#include <iostream>
-
-#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
-#define CATCH_PLATFORM_MAC
-#elif  defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
-#define CATCH_PLATFORM_IPHONE
-#elif defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER)
-#define CATCH_PLATFORM_WINDOWS
-#endif
-
-#ifdef CATCH_PLATFORM_MAC
-
-    #include <assert.h>
-    #include <stdbool.h>
-    #include <sys/types.h>
-    #include <unistd.h>
-    #include <sys/sysctl.h>
-
-    namespace Catch{
-
-        // The following function is taken directly from the following technical note:
-        // http://developer.apple.com/library/mac/#qa/qa2004/qa1361.html
-
-        // Returns true if the current process is being debugged (either
-        // running under the debugger or has a debugger attached post facto).
-        inline bool isDebuggerActive(){
-
-            int                 junk;
-            int                 mib[4];
-            struct kinfo_proc   info;
-            size_t              size;
-
-            // Initialize the flags so that, if sysctl fails for some bizarre
-            // reason, we get a predictable result.
-
-            info.kp_proc.p_flag = 0;
-
-            // Initialize mib, which tells sysctl the info we want, in this case
-            // we're looking for information about a specific process ID.
-
-            mib[0] = CTL_KERN;
-            mib[1] = KERN_PROC;
-            mib[2] = KERN_PROC_PID;
-            mib[3] = getpid();
-
-            // Call sysctl.
-
-            size = sizeof(info);
-            junk = sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0);
-            assert(junk == 0);
-
-            // We're being debugged if the P_TRACED flag is set.
-
-            return ( (info.kp_proc.p_flag & P_TRACED) != 0 );
-        }
-    }
-
-    // The following code snippet taken from:
-    // http://cocoawithlove.com/2008/03/break-into-debugger.html
-    #ifdef DEBUG
-        #if defined(__ppc64__) || defined(__ppc__)
-            #define BreakIntoDebugger() \
-            if( Catch::isDebuggerActive() ) { \
-            __asm__("li r0, 20\nsc\nnop\nli r0, 37\nli r4, 2\nsc\nnop\n" \
-            : : : "memory","r0","r3","r4" ); \
-            }
-        #else
-            #define BreakIntoDebugger() if( Catch::isDebuggerActive() ) {__asm__("int $3\n" : : );}
-        #endif
-    #else
-        inline void BreakIntoDebugger(){}
-    #endif
-
-#elif defined(_MSC_VER)
-    extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent();
-    #define BreakIntoDebugger() if (IsDebuggerPresent() ) { __debugbreak(); }
-    inline bool isDebuggerActive() {
-        return IsDebuggerPresent() != 0;
-    }
-#elif defined(__MINGW32__)
-    extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent();
-    extern "C" __declspec(dllimport) void __stdcall DebugBreak();
-    #define BreakIntoDebugger() if (IsDebuggerPresent() ) { DebugBreak(); }
-    inline bool isDebuggerActive() {
-        return IsDebuggerPresent() != 0;
-    }
-#else
-	   inline void BreakIntoDebugger(){}
-	   inline bool isDebuggerActive() { return false; }
-#endif
-
-#ifdef CATCH_PLATFORM_WINDOWS
-extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA( const char* );
-inline void writeToDebugConsole( const std::string& text ) {
-    ::OutputDebugStringA( text.c_str() );
-}
-#else
-inline void writeToDebugConsole( const std::string& text ) {
-    // !TBD: Need a version for Mac/ XCode and other IDEs
-    std::cout << text;
-}
-#endif // CATCH_PLATFORM_WINDOWS
-
-// #included from: catch_interfaces_registry_hub.h
-#define TWOBLUECUBES_CATCH_INTERFACES_REGISTRY_HUB_H_INCLUDED
-
-// #included from: catch_interfaces_reporter.h
-#define TWOBLUECUBES_CATCH_INTERFACES_REPORTER_H_INCLUDED
-
-// #included from: catch_config.hpp
-#define TWOBLUECUBES_CATCH_CONFIG_HPP_INCLUDED
-
-// #included from: catch_test_spec.h
-#define TWOBLUECUBES_CATCH_TEST_SPEC_H_INCLUDED
-
-// #included from: catch_test_case_info.h
-#define TWOBLUECUBES_CATCH_TEST_CASE_INFO_H_INCLUDED
-
-#include <string>
-#include <set>
-
-namespace Catch {
-
-    struct ITestCase;
-
-    class TestCaseInfo {
-    public:
-        TestCaseInfo();
-
-        TestCaseInfo(   ITestCase* testCase,
-                        const std::string& className,
-                        const std::string& name,
-                        const std::string& description,
-                        const SourceLineInfo& lineInfo );
-
-        TestCaseInfo( const TestCaseInfo& other, const std::string& name );
-        TestCaseInfo( const TestCaseInfo& other );
-
-        void invoke() const;
-
-        const std::string& getClassName() const;
-        const std::string& getName() const;
-        const std::string& getDescription() const;
-        const SourceLineInfo& getLineInfo() const;
-        bool isHidden() const;
-        bool hasTag( const std::string& tag ) const;
-        bool matchesTags( const std::string& tagPattern ) const;
-        const std::set<std::string>& getTags() const;
-
-        void swap( TestCaseInfo& other );
-        bool operator == ( const TestCaseInfo& other ) const;
-        bool operator < ( const TestCaseInfo& other ) const;
-        TestCaseInfo& operator = ( const TestCaseInfo& other );
-
-    private:
-        Ptr<ITestCase> m_test;
-        std::string m_className;
-        std::string m_name;
-        std::string m_description;
-        std::set<std::string> m_tags;
-        SourceLineInfo m_lineInfo;
-        bool m_isHidden;
-    };
-}
-
-// #included from: catch_tags.hpp
-#define TWOBLUECUBES_CATCH_TAGS_HPP_INCLUDED
-
-#include <string>
-#include <set>
-#include <map>
-#include <vector>
-
-#ifdef __clang__
-#pragma clang diagnostic ignored "-Wpadded"
-#endif
-
-namespace Catch {
-    class TagParser {
-    public:
-        virtual ~TagParser();
-
-        void parse( const std::string& str ) {
-            std::size_t pos = 0;
-            while( pos < str.size() ) {
-                char c = str[pos];
-                if( c == '[' ) {
-                    std::size_t end = str.find_first_of( ']', pos );
-                    if( end != std::string::npos ) {
-                        acceptTag( str.substr( pos+1, end-pos-1 ) );
-                        pos = end+1;
-                    }
-                    else {
-                        acceptChar( c );
-                        pos++;
-                    }
-                }
-                else {
-                    acceptChar( c );
-                    pos++;
-                }
-            }
-            endParse();
-        }
-
-    protected:
-        virtual void acceptTag( const std::string& tag ) = 0;
-        virtual void acceptChar( char c ) = 0;
-        virtual void endParse() {}
-
-    private:
-    };
-
-    class TagExtracter : public TagParser {
-    public:
-
-        TagExtracter( std::set<std::string>& tags )
-        :   m_tags( tags )
-        {}
-        virtual ~TagExtracter();
-
-        void parse( std::string& description ) {
-            TagParser::parse( description );
-            description = m_remainder;
-        }
-
-    private:
-        virtual void acceptTag( const std::string& tag ) {
-            m_tags.insert( tag );
-        }
-        virtual void acceptChar( char c ) {
-            m_remainder += c;
-        }
-
-        TagExtracter& operator=(const TagExtracter&);
-
-        std::set<std::string>& m_tags;
-        std::string m_remainder;
-    };
-
-    class Tag {
-    public:
-        Tag()
-        :   m_isNegated( false )
-        {}
-
-        Tag( const std::string& name, bool isNegated )
-        :   m_name( name ),
-            m_isNegated( isNegated )
-        {}
-
-        std::string getName() const {
-            return m_name;
-        }
-        bool isNegated() const {
-            return m_isNegated;
-        }
-
-        bool operator ! () const {
-            return m_name.empty();
-        }
-
-    private:
-        std::string m_name;
-        bool m_isNegated;
-    };
-
-    class TagSet {
-        typedef std::map<std::string, Tag> TagMap;
-    public:
-        void add( const Tag& tag ) {
-            m_tags.insert( std::make_pair( tag.getName(), tag ) );
-        }
-
-        bool empty() const {
-            return m_tags.empty();
-        }
-
-        bool matches( const std::set<std::string>& tags ) const {
-            TagMap::const_iterator it = m_tags.begin();
-            TagMap::const_iterator itEnd = m_tags.end();
-            for(; it != itEnd; ++it ) {
-                bool found = tags.find( it->first ) != tags.end();
-                if( found == it->second.isNegated() )
-                    return false;
-            }
-            return true;
-        }
-
-    private:
-        TagMap m_tags;
-    };
-
-    class TagExpression {
-    public:
-        bool matches( const std::set<std::string>& tags ) const {
-            std::vector<TagSet>::const_iterator it = m_tagSets.begin();
-            std::vector<TagSet>::const_iterator itEnd = m_tagSets.end();
-            for(; it != itEnd; ++it )
-                if( it->matches( tags ) )
-                    return true;
-            return false;
-        }
-
-    private:
-        friend class TagExpressionParser;
-
-        std::vector<TagSet> m_tagSets;
-    };
-
-    class TagExpressionParser : public TagParser {
-    public:
-        TagExpressionParser( TagExpression& exp )
-        :   m_isNegated( false ),
-            m_exp( exp )
-        {}
-
-        ~TagExpressionParser();
-
-    private:
-        virtual void acceptTag( const std::string& tag ) {
-            m_currentTagSet.add( Tag( tag, m_isNegated ) );
-            m_isNegated = false;
-        }
-        virtual void acceptChar( char c ) {
-            switch( c ) {
-                case '~':
-                    m_isNegated = true;
-                    break;
-                case ',':
-                    m_exp.m_tagSets.push_back( m_currentTagSet );
-                    break;
-            }
-        }
-        virtual void endParse() {
-            if( !m_currentTagSet.empty() )
-                m_exp.m_tagSets.push_back( m_currentTagSet );
-        }
-
-        TagExpressionParser& operator=(const TagExpressionParser&);
-
-        bool m_isNegated;
-        TagSet m_currentTagSet;
-        TagExpression& m_exp;
-    };
-
-} // end namespace Catch
-
-#include <string>
-#include <vector>
-
-namespace Catch {
-
-    struct IfFilterMatches{ enum DoWhat {
-        AutoDetectBehaviour,
-        IncludeTests,
-        ExcludeTests
-    }; };
-
-    class TestCaseFilter {
-        enum WildcardPosition {
-            NoWildcard = 0,
-            WildcardAtStart = 1,
-            WildcardAtEnd = 2,
-            WildcardAtBothEnds = WildcardAtStart | WildcardAtEnd
-        };
-
-    public:
-        TestCaseFilter( const std::string& testSpec, IfFilterMatches::DoWhat matchBehaviour = IfFilterMatches::AutoDetectBehaviour )
-        :   m_stringToMatch( testSpec ),
-            m_filterType( matchBehaviour ),
-            m_wildcardPosition( NoWildcard )
-        {
-            if( m_filterType == IfFilterMatches::AutoDetectBehaviour ) {
-                if( startsWith( m_stringToMatch, "exclude:" ) ) {
-                    m_stringToMatch = m_stringToMatch.substr( 8 );
-                    m_filterType = IfFilterMatches::ExcludeTests;
-                }
-                else if( startsWith( m_stringToMatch, "~" ) ) {
-                    m_stringToMatch = m_stringToMatch.substr( 1 );
-                    m_filterType = IfFilterMatches::ExcludeTests;
-                }
-                else {
-                    m_filterType = IfFilterMatches::IncludeTests;
-                }
-            }
-
-            if( m_stringToMatch[0] == '*' ) {
-                m_stringToMatch = m_stringToMatch.substr( 1 );
-                m_wildcardPosition = (WildcardPosition)( m_wildcardPosition | WildcardAtStart );
-            }
-            if( m_stringToMatch[m_stringToMatch.size()-1] == '*' ) {
-                m_stringToMatch = m_stringToMatch.substr( 0, m_stringToMatch.size()-1 );
-                m_wildcardPosition = (WildcardPosition)( m_wildcardPosition | WildcardAtEnd );
-            }
-        }
-
-        IfFilterMatches::DoWhat getFilterType() const {
-            return m_filterType;
-        }
-
-        bool shouldInclude( const TestCaseInfo& testCase ) const {
-            return isMatch( testCase ) == (m_filterType == IfFilterMatches::IncludeTests);
-        }
-    private:
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunreachable-code"
-#endif
-
-        bool isMatch( const TestCaseInfo& testCase ) const {
-            const std::string& name = testCase.getName();
-
-            switch( m_wildcardPosition ) {
-                case NoWildcard:
-                    return m_stringToMatch == name;
-                case WildcardAtStart:
-                    return endsWith( name, m_stringToMatch );
-                case WildcardAtEnd:
-                    return startsWith( name, m_stringToMatch );
-                case WildcardAtBothEnds:
-                    return contains( name, m_stringToMatch );
-            }
-            throw std::logic_error( "Unhandled wildcard type" );
-        }
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-        std::string m_stringToMatch;
-        IfFilterMatches::DoWhat m_filterType;
-        WildcardPosition m_wildcardPosition;
-    };
-
-    class TestCaseFilters {
-    public:
-        TestCaseFilters( const std::string& name ) : m_name( name ) {}
-
-        std::string getName() const {
-            return m_name;
-        }
-
-        void addFilter( const TestCaseFilter& filter ) {
-            if( filter.getFilterType() == IfFilterMatches::ExcludeTests )
-                m_exclusionFilters.push_back( filter );
-            else
-                m_inclusionFilters.push_back( filter );
-        }
-
-        void addTags( const std::string& tagPattern ) {
-            TagExpression exp;
-            TagExpressionParser( exp ).parse( tagPattern );
-
-            m_tagExpressions.push_back( exp );
-        }
-
-        bool shouldInclude( const TestCaseInfo& testCase ) const {
-            if( !m_tagExpressions.empty() ) {
-                std::vector<TagExpression>::const_iterator it = m_tagExpressions.begin();
-                std::vector<TagExpression>::const_iterator itEnd = m_tagExpressions.end();
-                for(; it != itEnd; ++it )
-                    if( it->matches( testCase.getTags() ) )
-                        break;
-                if( it == itEnd )
-                    return false;
-            }
-
-            if( !m_inclusionFilters.empty() ) {
-                std::vector<TestCaseFilter>::const_iterator it = m_inclusionFilters.begin();
-                std::vector<TestCaseFilter>::const_iterator itEnd = m_inclusionFilters.end();
-                for(; it != itEnd; ++it )
-                    if( it->shouldInclude( testCase ) )
-                        break;
-                if( it == itEnd )
-                    return false;
-            }
-            else if( m_exclusionFilters.empty() && m_tagExpressions.empty() ) {
-                return !testCase.isHidden();
-            }
-
-            std::vector<TestCaseFilter>::const_iterator it = m_exclusionFilters.begin();
-            std::vector<TestCaseFilter>::const_iterator itEnd = m_exclusionFilters.end();
-            for(; it != itEnd; ++it )
-                if( !it->shouldInclude( testCase ) )
-                    return false;
-            return true;
-        }
-    private:
-        std::vector<TagExpression> m_tagExpressions;
-        std::vector<TestCaseFilter> m_inclusionFilters;
-        std::vector<TestCaseFilter> m_exclusionFilters;
-        std::string m_name;
-    };
-
-}
-
-// #included from: catch_interfaces_config.h
-#define TWOBLUECUBES_CATCH_INTERFACES_CONFIG_H_INCLUDED
-
-namespace Catch {
-
-    struct IConfig {
-
-        virtual ~IConfig();
-
-        virtual bool allowThrows() const = 0;
-    };
-}
-
-// #included from: catch_stream.hpp
-#define TWOBLUECUBES_CATCH_STREAM_HPP_INCLUDED
-
-// #included from: catch_streambuf.h
-#define TWOBLUECUBES_CATCH_STREAMBUF_H_INCLUDED
-
-#include <streambuf>
-
-namespace Catch {
-
-    class StreamBufBase : public std::streambuf {
-    public:
-        virtual ~StreamBufBase();
-    };
-}
-
-#include <stdexcept>
-#include <cstdio>
-
-namespace Catch {
-
-    template<typename WriterF, size_t bufferSize=256>
-    class StreamBufImpl : public StreamBufBase {
-        char data[bufferSize];
-        WriterF m_writer;
-
-    public:
-        StreamBufImpl() {
-            setp( data, data + sizeof(data) );
-        }
-
-        ~StreamBufImpl() {
-            sync();
-        }
-
-    private:
-        int	overflow( int c ) {
-            sync();
-
-            if( c != EOF ) {
-                if( pbase() == epptr() )
-                    m_writer( std::string( 1, static_cast<char>( c ) ) );
-                else
-                    sputc( static_cast<char>( c ) );
-            }
-            return 0;
-        }
-
-        int	sync() {
-            if( pbase() != pptr() ) {
-                m_writer( std::string( pbase(), static_cast<std::string::size_type>( pptr() - pbase() ) ) );
-                setp( pbase(), epptr() );
-            }
-            return 0;
-        }
-    };
-
-    ///////////////////////////////////////////////////////////////////////////
-
-    struct OutputDebugWriter {
-
-        void operator()( const std::string &str ) {
-            writeToDebugConsole( str );
-        }
-    };
-
-    class Stream {
-    public:
-        Stream()
-        : streamBuf( NULL ), isOwned( false )
-        {}
-
-        Stream( std::streambuf* _streamBuf, bool _isOwned )
-        : streamBuf( _streamBuf ), isOwned( _isOwned )
-        {}
-
-        void release() {
-            if( isOwned ) {
-                delete streamBuf;
-                streamBuf = NULL;
-                isOwned = false;
-            }
-        }
-
-        std::streambuf* streamBuf;
-
-    private:
-        bool isOwned;
-    };
-}
-
-#include <memory>
-#include <vector>
-#include <string>
-#include <iostream>
-
-namespace Catch {
-
-    struct Include { enum WhichResults {
-        FailedOnly,
-        SuccessfulResults
-    }; };
-
-    struct List{ enum What {
-        None = 0,
-
-        Reports = 1,
-        Tests = 2,
-        All = 3,
-
-        TestNames = 6,
-
-        WhatMask = 0xf,
-
-        AsText = 0x10,
-        AsXml = 0x20,
-
-        AsMask = 0xf0
-    }; };
-
-    struct ConfigData {
-
-        struct WarnAbout { enum What {
-            Nothing = 0x00,
-            NoAssertions = 0x01
-        }; };
-
-        ConfigData()
-        :   listSpec( List::None ),
-            shouldDebugBreak( false ),
-            includeWhichResults( Include::FailedOnly ),
-            cutoff( -1 ),
-            allowThrows( true ),
-            warnings( WarnAbout::Nothing )
-        {}
-
-        std::string reporter;
-        std::string outputFilename;
-        List::What listSpec;
-        std::vector<TestCaseFilters> filters;
-        bool shouldDebugBreak;
-        std::string stream;
-        Include::WhichResults includeWhichResults;
-        std::string name;
-        int cutoff;
-        bool allowThrows;
-        WarnAbout::What warnings;
-    };
-
-    class Config : public IConfig {
-    private:
-        Config( const Config& other );
-        Config& operator = ( const Config& other );
-        virtual void dummy();
-    public:
-
-        Config()
-        :   m_os( std::cout.rdbuf() )
-        {}
-
-        Config( const ConfigData& data )
-        :   m_data( data ),
-            m_os( std::cout.rdbuf() )
-        {}
-
-        virtual ~Config() {
-            m_os.rdbuf( std::cout.rdbuf() );
-            m_stream.release();
-        }
-
-        void setFilename( const std::string& filename ) {
-            m_data.outputFilename = filename;
-        }
-
-        List::What getListSpec( void ) const {
-            return m_data.listSpec;
-        }
-
-        const std::string& getFilename() const {
-            return m_data.outputFilename ;
-        }
-
-        List::What listWhat() const {
-            return static_cast<List::What>( m_data.listSpec & List::WhatMask );
-        }
-
-        List::What listAs() const {
-            return static_cast<List::What>( m_data.listSpec & List::AsMask );
-        }
-
-        std::string getName() const {
-            return m_data.name;
-        }
-
-        bool shouldDebugBreak() const {
-            return m_data.shouldDebugBreak;
-        }
-
-        virtual std::ostream& stream() const {
-            return m_os;
-        }
-
-        void setStreamBuf( std::streambuf* buf ) {
-            m_os.rdbuf( buf ? buf : std::cout.rdbuf() );
-        }
-
-        void useStream( const std::string& streamName ) {
-            Stream stream = createStream( streamName );
-            setStreamBuf( stream.streamBuf );
-            m_stream.release();
-            m_stream = stream;
-        }
-
-        void addTestSpec( const std::string& testSpec ) {
-            TestCaseFilters filters( testSpec );
-            filters.addFilter( TestCaseFilter( testSpec ) );
-            m_data.filters.push_back( filters );
-        }
-
-        virtual bool includeSuccessfulResults() const {
-            return m_data.includeWhichResults == Include::SuccessfulResults;
-        }
-
-        int getCutoff() const {
-            return m_data.cutoff;
-        }
-
-        virtual bool allowThrows() const {
-            return m_data.allowThrows;
-        }
-
-        const ConfigData& data() const {
-            return m_data;
-        }
-        ConfigData& data() {
-            return m_data;
-        }
-
-    private:
-        ConfigData m_data;
-
-        // !TBD Move these out of here
-        Stream m_stream;
-        mutable std::ostream m_os;
-    };
-
-} // end namespace Catch
-
-#include <string>
-#include <ostream>
-#include <map>
-
-namespace Catch
-{
-    struct ReporterConfig
-    {
-        ReporterConfig( const std::string& _name,
-                        std::ostream& _stream,
-                        bool _includeSuccessfulResults,
-                        const ConfigData& _fullConfig )
-        :   name( _name ),
-            stream( _stream ),
-            includeSuccessfulResults( _includeSuccessfulResults ),
-            fullConfig( _fullConfig )
-        {}
-
-        ReporterConfig( const ReporterConfig& other )
-        :   name( other.name ),
-            stream( other.stream ),
-            includeSuccessfulResults( other.includeSuccessfulResults ),
-            fullConfig( other.fullConfig )
-        {}
-
-        std::string name;
-        std::ostream& stream;
-        bool includeSuccessfulResults;
-        ConfigData fullConfig;
-
-    private:
-        void operator=(const ReporterConfig&);
-    };
-
-    class TestCaseInfo;
-    class AssertionResult;
-
-    struct IReporter : IShared {
-        virtual ~IReporter();
-
-        virtual bool shouldRedirectStdout() const = 0;
-
-        virtual void StartTesting() = 0;
-        virtual void EndTesting( const Totals& totals ) = 0;
-
-        virtual void StartGroup( const std::string& groupName ) = 0;
-        virtual void EndGroup( const std::string& groupName, const Totals& totals ) = 0;
-
-        virtual void StartTestCase( const TestCaseInfo& testInfo ) = 0;
-        // TestCaseResult
-        virtual void EndTestCase( const TestCaseInfo& testInfo, const Totals& totals, const std::string& stdOut, const std::string& stdErr ) = 0;
-
-        // SectionInfo
-        virtual void StartSection( const std::string& sectionName, const std::string& description ) = 0;
-        // Section Result
-        virtual void EndSection( const std::string& sectionName, const Counts& assertions ) = 0;
-
-        // - merge into SectionResult ?
-        virtual void NoAssertionsInSection( const std::string& sectionName ) = 0;
-        virtual void NoAssertionsInTestCase( const std::string& testName ) = 0;
-
-        // - merge into SectionResult, TestCaseResult, GroupResult & TestRunResult
-        virtual void Aborted() = 0;
-
-        // AssertionReslt
-        virtual void Result( const AssertionResult& result ) = 0;
-    };
-
-    struct IReporterFactory {
-        virtual ~IReporterFactory();
-        virtual IReporter* create( const ReporterConfig& config ) const = 0;
-        virtual std::string getDescription() const = 0;
-    };
-
-    struct IReporterRegistry {
-        typedef std::map<std::string, IReporterFactory*> FactoryMap;
-
-        virtual ~IReporterRegistry();
-        virtual IReporter* create( const std::string& name, const ReporterConfig& config ) const = 0;
-        virtual const FactoryMap& getFactories() const = 0;
-    };
-
-    inline std::string trim( const std::string& str ) {
-        std::string::size_type start = str.find_first_not_of( "\n\r\t " );
-        std::string::size_type end = str.find_last_not_of( "\n\r\t " );
-
-        return start != std::string::npos ? str.substr( start, 1+end-start ) : "";
-    }
-}
-
-#include <vector>
-
-namespace Catch {
-
-    class TestCaseInfo;
-    struct ITestCaseRegistry;
-    struct IExceptionTranslatorRegistry;
-    struct IExceptionTranslator;
-
-    struct IRegistryHub {
-        virtual ~IRegistryHub();
-
-        virtual const IReporterRegistry& getReporterRegistry() const = 0;
-        virtual const ITestCaseRegistry& getTestCaseRegistry() const = 0;
-        virtual IExceptionTranslatorRegistry& getExceptionTranslatorRegistry() = 0;
-    };
-
-    struct IMutableRegistryHub {
-        virtual ~IMutableRegistryHub();
-        virtual void registerReporter( const std::string& name, IReporterFactory* factory ) = 0;
-        virtual void registerTest( const TestCaseInfo& testInfo ) = 0;
-        virtual void registerTranslator( const IExceptionTranslator* translator ) = 0;
-    };
-
-    IRegistryHub& getRegistryHub();
-    IMutableRegistryHub& getMutableRegistryHub();
-    void cleanUp();
-    std::string translateActiveException();
-
-}
-
-#include <ostream>
-
-namespace Catch {
-
-    inline IResultCapture& getResultCapture() {
-        return getCurrentContext().getResultCapture();
-    }
-
-    template<typename MatcherT>
-    ExpressionResultBuilder expressionResultBuilderFromMatcher( const MatcherT& matcher,
-                                                                const std::string& matcherCallAsString ) {
-        std::string matcherAsString = matcher.toString();
-        if( matcherAsString == "{?}" )
-            matcherAsString = matcherCallAsString;
-        return ExpressionResultBuilder()
-            .setRhs( matcherAsString )
-            .setOp( "matches" );
-    }
-
-    template<typename MatcherT, typename ArgT>
-    ExpressionResultBuilder expressionResultBuilderFromMatcher( const MatcherT& matcher,
-                                                                const ArgT& arg,
-                                                                const std::string& matcherCallAsString ) {
-        return expressionResultBuilderFromMatcher( matcher, matcherCallAsString )
-            .setLhs( Catch::toString( arg ) )
-            .setResultType( matcher.match( arg ) );
-    }
-
-    template<typename MatcherT, typename ArgT>
-    ExpressionResultBuilder expressionResultBuilderFromMatcher( const MatcherT& matcher,
-                                                                ArgT* arg,
-                                                                const std::string& matcherCallAsString ) {
-        return expressionResultBuilderFromMatcher( matcher, matcherCallAsString )
-            .setLhs( Catch::toString( arg ) )
-            .setResultType( matcher.match( arg ) );
-    }
-
-struct TestFailureException{};
-
-class ScopedInfo {
-public:
-    ScopedInfo() : m_resultBuilder( ResultWas::Info ) {
-        getResultCapture().pushScopedInfo( this );
-    }
-    ~ScopedInfo() {
-        getResultCapture().popScopedInfo( this );
-    }
-    template<typename T>
-    ScopedInfo& operator << ( const T& value ) {
-        m_resultBuilder << value;
-        return *this;
-    }
-    AssertionResult buildResult( const AssertionInfo& assertionInfo ) const {
-        return m_resultBuilder.buildResult( assertionInfo );
-    }
-
-private:
-    ExpressionResultBuilder m_resultBuilder;
-};
-
-// This is just here to avoid compiler warnings with macro constants and boolean literals
-inline bool isTrue( bool value ){ return value; }
-
-} // end namespace Catch
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_ASSERTIONINFO_NAME INTERNAL_CATCH_UNIQUE_NAME( __assertionInfo )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_ACCEPT_EXPR( evaluatedExpr, resultDisposition, originalExpr ) \
-    if( Catch::ResultAction::Value internal_catch_action = Catch::getResultCapture().acceptExpression( evaluatedExpr, INTERNAL_CATCH_ASSERTIONINFO_NAME )  ) { \
-        if( internal_catch_action & Catch::ResultAction::Debug ) BreakIntoDebugger(); \
-        if( internal_catch_action & Catch::ResultAction::Abort ) throw Catch::TestFailureException(); \
-        if( !Catch::shouldContinueOnFailure( resultDisposition ) ) throw Catch::TestFailureException(); \
-        if( Catch::isTrue( false ) ){ bool this_is_here_to_invoke_warnings = ( originalExpr ); Catch::isTrue( this_is_here_to_invoke_warnings ); } \
-    }
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_ACCEPT_INFO( expr, macroName, resultDisposition ) \
-    Catch::AssertionInfo INTERNAL_CATCH_ASSERTIONINFO_NAME( macroName, CATCH_INTERNAL_LINEINFO, expr, resultDisposition );
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ) \
-    do { \
-        INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, resultDisposition ); \
-        try { \
-            INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionDecomposer()->*expr ).endExpression( resultDisposition ), resultDisposition, expr ); \
-        } catch( Catch::TestFailureException& ) { \
-            throw; \
-        } catch( ... ) { \
-            INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), \
-                resultDisposition | Catch::ResultDisposition::ContinueOnFailure, expr ); \
-            throw; \
-        } \
-    } while( Catch::isTrue( false ) )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_IF( expr, resultDisposition, macroName ) \
-    INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ); \
-    if( Catch::getResultCapture().getLastResult()->succeeded() )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_ELSE( expr, resultDisposition, macroName ) \
-    INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ); \
-    if( !Catch::getResultCapture().getLastResult()->succeeded() )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_NO_THROW( expr, resultDisposition, macroName ) \
-    do { \
-        INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, resultDisposition ); \
-        try { \
-            expr; \
-            INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::Ok ), resultDisposition, false ); \
-        } \
-        catch( ... ) { \
-            INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), resultDisposition, false ); \
-        } \
-} while( Catch::isTrue( false ) )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, resultDisposition ) \
-    try { \
-        if( Catch::getCurrentContext().getConfig()->allowThrows() ) { \
-            expr; \
-            INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::DidntThrowException ), resultDisposition, false ); \
-        } \
-    } \
-    catch( Catch::TestFailureException& ) { \
-        throw; \
-    } \
-    catch( exceptionType ) { \
-        INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::Ok ), resultDisposition, false ); \
-    }
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_THROWS( expr, exceptionType, resultDisposition, macroName ) \
-    do { \
-        INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, resultDisposition ); \
-        INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, resultDisposition ) \
-    } while( Catch::isTrue( false ) )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_THROWS_AS( expr, exceptionType, resultDisposition, macroName ) \
-    do { \
-        INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, resultDisposition ); \
-        INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, resultDisposition ) \
-        catch( ... ) { \
-            INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), \
-                resultDisposition | Catch::ResultDisposition::ContinueOnFailure, false ); \
-        } \
-    } while( Catch::isTrue( false ) )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_MSG( reason, resultType, resultDisposition, macroName ) \
-    do { \
-        INTERNAL_CATCH_ACCEPT_INFO( "", macroName, resultDisposition ); \
-        INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( resultType ) << reason, resultDisposition, true ) \
-    } while( Catch::isTrue( false ) )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_SCOPED_INFO( log, macroName ) \
-    INTERNAL_CATCH_ACCEPT_INFO( "", macroName, Catch::ResultDisposition::Normal ); \
-    Catch::ScopedInfo INTERNAL_CATCH_UNIQUE_NAME( info ); \
-    INTERNAL_CATCH_UNIQUE_NAME( info ) << log
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CHECK_THAT( arg, matcher, resultDisposition, macroName ) \
-    do { \
-        INTERNAL_CATCH_ACCEPT_INFO( #arg " " #matcher, macroName, resultDisposition ); \
-        try { \
-            INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::expressionResultBuilderFromMatcher( ::Catch::Matchers::matcher, arg, #matcher ) ), resultDisposition, false ); \
-        } catch( Catch::TestFailureException& ) { \
-            throw; \
-        } catch( ... ) { \
-            INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), \
-                resultDisposition | Catch::ResultDisposition::ContinueOnFailure, false ); \
-            throw; \
-        } \
-    } while( Catch::isTrue( false ) )
-
-// #included from: internal/catch_section.hpp
-#define TWOBLUECUBES_CATCH_SECTION_HPP_INCLUDED
-
-#include <string>
-
-namespace Catch {
-
-    class Section {
-    public:
-        Section(    const std::string& name,
-                    const std::string& description,
-                    const SourceLineInfo& lineInfo )
-        :   m_name( name ),
-            m_sectionIncluded( getCurrentContext().getResultCapture().sectionStarted( name, description, lineInfo, m_assertions ) )
-        {}
-
-        ~Section() {
-            if( m_sectionIncluded )
-                getCurrentContext().getResultCapture().sectionEnded( m_name, m_assertions );
-        }
-
-        // This indicates whether the section should be executed or not
-        operator bool() {
-            return m_sectionIncluded;
-        }
-
-    private:
-
-        std::string m_name;
-        Counts m_assertions;
-        bool m_sectionIncluded;
-    };
-
-} // end namespace Catch
-
-#define INTERNAL_CATCH_SECTION( name, desc ) \
-    if( Catch::Section INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::Section( name, desc, CATCH_INTERNAL_LINEINFO ) )
-
-// #included from: internal/catch_generators.hpp
-#define TWOBLUECUBES_CATCH_GENERATORS_HPP_INCLUDED
-
-#include <iterator>
-#include <vector>
-#include <string>
-#include <stdlib.h>
-
-namespace Catch {
-
-template<typename T>
-struct IGenerator {
-    virtual ~IGenerator() {}
-    virtual T getValue( std::size_t index ) const = 0;
-    virtual std::size_t size () const = 0;
-};
-
-template<typename T>
-class BetweenGenerator : public IGenerator<T> {
-public:
-    BetweenGenerator( T from, T to ) : m_from( from ), m_to( to ){}
-
-    virtual T getValue( std::size_t index ) const {
-        return m_from+static_cast<T>( index );
-    }
-
-    virtual std::size_t size() const {
-        return static_cast<std::size_t>( 1+m_to-m_from );
-    }
-
-private:
-
-    T m_from;
-    T m_to;
-};
-
-template<typename T>
-class ValuesGenerator : public IGenerator<T> {
-public:
-    ValuesGenerator(){}
-
-    void add( T value ) {
-        m_values.push_back( value );
-    }
-
-    virtual T getValue( std::size_t index ) const {
-        return m_values[index];
-    }
-
-    virtual std::size_t size() const {
-        return m_values.size();
-    }
-
-private:
-    std::vector<T> m_values;
-};
-
-template<typename T>
-class CompositeGenerator {
-public:
-    CompositeGenerator() : m_totalSize( 0 ) {}
-
-	// *** Move semantics, similar to auto_ptr ***
-    CompositeGenerator( CompositeGenerator& other )
-    :   m_fileInfo( other.m_fileInfo ),
-        m_totalSize( 0 )
-    {
-		move( other );
-    }
-
-    CompositeGenerator& setFileInfo( const char* fileInfo ) {
-        m_fileInfo = fileInfo;
-        return *this;
-    }
-
-    ~CompositeGenerator() {
-        deleteAll( m_composed );
-    }
-
-    operator T () const {
-        size_t overallIndex = getCurrentContext().getGeneratorIndex( m_fileInfo, m_totalSize );
-
-        typename std::vector<const IGenerator<T>*>::const_iterator it = m_composed.begin();
-        typename std::vector<const IGenerator<T>*>::const_iterator itEnd = m_composed.end();
-        for( size_t index = 0; it != itEnd; ++it )
-        {
-            const IGenerator<T>* generator = *it;
-            if( overallIndex >= index && overallIndex < index + generator->size() )
-            {
-                return generator->getValue( overallIndex-index );
-            }
-            index += generator->size();
-        }
-        CATCH_INTERNAL_ERROR( "Indexed past end of generated range" );
-		return T(); // Suppress spurious "not all control paths return a value" warning in Visual Studio - if you know how to fix this please do so
-    }
-
-    void add( const IGenerator<T>* generator ) {
-        m_totalSize += generator->size();
-        m_composed.push_back( generator );
-    }
-
-    CompositeGenerator& then( CompositeGenerator& other ) {
-        move( other );
-        return *this;
-    }
-
-    CompositeGenerator& then( T value ) {
-        ValuesGenerator<T>* valuesGen = new ValuesGenerator<T>();
-        valuesGen->add( value );
-        add( valuesGen );
-        return *this;
-    }
-
-private:
-
-    void move( CompositeGenerator& other ) {
-        std::copy( other.m_composed.begin(), other.m_composed.end(), std::back_inserter( m_composed ) );
-        m_totalSize += other.m_totalSize;
-        other.m_composed.clear();
-    }
-
-    std::vector<const IGenerator<T>*> m_composed;
-    std::string m_fileInfo;
-    size_t m_totalSize;
-};
-
-namespace Generators
-{
-    template<typename T>
-    CompositeGenerator<T> between( T from, T to ) {
-        CompositeGenerator<T> generators;
-        generators.add( new BetweenGenerator<T>( from, to ) );
-        return generators;
-    }
-
-    template<typename T>
-    CompositeGenerator<T> values( T val1, T val2 ) {
-        CompositeGenerator<T> generators;
-        ValuesGenerator<T>* valuesGen = new ValuesGenerator<T>();
-        valuesGen->add( val1 );
-        valuesGen->add( val2 );
-        generators.add( valuesGen );
-        return generators;
-    }
-
-    template<typename T>
-    CompositeGenerator<T> values( T val1, T val2, T val3 ){
-        CompositeGenerator<T> generators;
-        ValuesGenerator<T>* valuesGen = new ValuesGenerator<T>();
-        valuesGen->add( val1 );
-        valuesGen->add( val2 );
-        valuesGen->add( val3 );
-        generators.add( valuesGen );
-        return generators;
-    }
-
-    template<typename T>
-    CompositeGenerator<T> values( T val1, T val2, T val3, T val4 ) {
-        CompositeGenerator<T> generators;
-        ValuesGenerator<T>* valuesGen = new ValuesGenerator<T>();
-        valuesGen->add( val1 );
-        valuesGen->add( val2 );
-        valuesGen->add( val3 );
-        valuesGen->add( val4 );
-        generators.add( valuesGen );
-        return generators;
-    }
-
-} // end namespace Generators
-
-using namespace Generators;
-
-} // end namespace Catch
-
-#define INTERNAL_CATCH_LINESTR2( line ) #line
-#define INTERNAL_CATCH_LINESTR( line ) INTERNAL_CATCH_LINESTR2( line )
-
-#define INTERNAL_CATCH_GENERATE( expr ) expr.setFileInfo( __FILE__ "(" INTERNAL_CATCH_LINESTR( __LINE__ ) ")" )
-
-// #included from: internal/catch_interfaces_exception.h
-#define TWOBLUECUBES_CATCH_INTERFACES_EXCEPTION_H_INCLUDED
-
-#include <string>
-
-namespace Catch {
-
-    typedef std::string(*exceptionTranslateFunction)();
-
-    struct IExceptionTranslator {
-        virtual ~IExceptionTranslator();
-        virtual std::string translate() const = 0;
-    };
-
-    struct IExceptionTranslatorRegistry {
-        virtual ~IExceptionTranslatorRegistry();
-
-        virtual std::string translateActiveException() const = 0;
-    };
-
-    class ExceptionTranslatorRegistrar {
-        template<typename T>
-        class ExceptionTranslator : public IExceptionTranslator {
-        public:
-
-            ExceptionTranslator( std::string(*translateFunction)( T& ) )
-            : m_translateFunction( translateFunction )
-            {}
-
-            virtual std::string translate() const {
-                try {
-                    throw;
-                }
-                catch( T& ex ) {
-                    return m_translateFunction( ex );
-                }
-            }
-
-        protected:
-            std::string(*m_translateFunction)( T& );
-        };
-
-    public:
-        template<typename T>
-        ExceptionTranslatorRegistrar( std::string(*translateFunction)( T& ) ) {
-            getMutableRegistryHub().registerTranslator
-                ( new ExceptionTranslator<T>( translateFunction ) );
-        }
-    };
-}
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) \
-    static std::string INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator )( signature ); \
-    namespace{ Catch::ExceptionTranslatorRegistrar INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator ) ); }\
-    static std::string INTERNAL_CATCH_UNIQUE_NAME(  catch_internal_ExceptionTranslator )( signature )
-
-// #included from: internal/catch_approx.hpp
-#define TWOBLUECUBES_CATCH_APPROX_HPP_INCLUDED
-
-#include <cmath>
-#include <limits>
-
-namespace Catch {
-namespace Detail {
-
-    class Approx {
-    public:
-        explicit Approx ( double value )
-        :   m_epsilon( std::numeric_limits<float>::epsilon()*100 ),
-            m_scale( 1.0 ),
-            m_value( value )
-        {}
-
-        Approx( const Approx& other )
-        :   m_epsilon( other.m_epsilon ),
-            m_scale( other.m_scale ),
-            m_value( other.m_value )
-        {}
-
-        static Approx custom() {
-            return Approx( 0 );
-        }
-
-        Approx operator()( double value ) {
-            Approx approx( value );
-            approx.epsilon( m_epsilon );
-            approx.scale( m_scale );
-            return approx;
-        }
-
-        friend bool operator == ( double lhs, const Approx& rhs ) {
-            // Thanks to Richard Harris for his help refining this formula
-            return fabs( lhs - rhs.m_value ) < rhs.m_epsilon * (rhs.m_scale + (std::max)( fabs(lhs), fabs(rhs.m_value) ) );
-        }
-
-        friend bool operator == ( const Approx& lhs, double rhs ) {
-            return operator==( rhs, lhs );
-        }
-
-        friend bool operator != ( double lhs, const Approx& rhs ) {
-            return !operator==( lhs, rhs );
-        }
-
-        friend bool operator != ( const Approx& lhs, double rhs ) {
-            return !operator==( rhs, lhs );
-        }
-
-        Approx& epsilon( double newEpsilon ) {
-            m_epsilon = newEpsilon;
-            return *this;
-        }
-
-        Approx& scale( double newScale ) {
-            m_scale = newScale;
-            return *this;
-        }
-
-        std::string toString() const {
-            std::ostringstream oss;
-            oss << "Approx( " << m_value << " )";
-            return oss.str();
-        }
-
-    private:
-        double m_epsilon;
-        double m_scale;
-        double m_value;
-    };
-}
-
-template<>
-inline std::string toString<Detail::Approx>( const Detail::Approx& value ) {
-    return value.toString();
-}
-
-} // end namespace Catch
-
-// #included from: internal/catch_matchers.hpp
-#define TWOBLUECUBES_CATCH_MATCHERS_HPP_INCLUDED
-
-namespace Catch {
-namespace Matchers {
-    namespace Impl {
-
-    template<typename ExpressionT>
-    struct Matcher : SharedImpl<IShared>
-    {
-        typedef ExpressionT ExpressionType;
-
-        virtual ~Matcher() {}
-        virtual Ptr<Matcher> clone() const = 0;
-        virtual bool match( const ExpressionT& expr ) const = 0;
-        virtual std::string toString() const = 0;
-    };
-
-    template<typename DerivedT, typename ExpressionT>
-    struct MatcherImpl : Matcher<ExpressionT> {
-
-        virtual Ptr<Matcher<ExpressionT> > clone() const {
-            return Ptr<Matcher<ExpressionT> >( new DerivedT( static_cast<const DerivedT&>( *this ) ) );
-        }
-    };
-
-    namespace Generic {
-
-        template<typename ExpressionT>
-        class AllOf : public MatcherImpl<AllOf<ExpressionT>, ExpressionT> {
-        public:
-
-            AllOf() {}
-            AllOf( const AllOf& other ) : m_matchers( other.m_matchers ) {}
-
-            AllOf& add( const Matcher<ExpressionT>& matcher ) {
-                m_matchers.push_back( matcher.clone() );
-                return *this;
-            }
-            virtual bool match( const ExpressionT& expr ) const
-            {
-                for( std::size_t i = 0; i < m_matchers.size(); ++i )
-                    if( !m_matchers[i]->match( expr ) )
-                        return false;
-                return true;
-            }
-            virtual std::string toString() const {
-                std::ostringstream oss;
-                oss << "( ";
-                for( std::size_t i = 0; i < m_matchers.size(); ++i ) {
-                    if( i != 0 )
-                        oss << " and ";
-                    oss << m_matchers[i]->toString();
-                }
-                oss << " )";
-                return oss.str();
-            }
-
-        private:
-            std::vector<Ptr<Matcher<ExpressionT> > > m_matchers;
-        };
-
-        template<typename ExpressionT>
-        class AnyOf : public MatcherImpl<AnyOf<ExpressionT>, ExpressionT> {
-        public:
-
-            AnyOf() {}
-            AnyOf( const AnyOf& other ) : m_matchers( other.m_matchers ) {}
-
-            AnyOf& add( const Matcher<ExpressionT>& matcher ) {
-                m_matchers.push_back( matcher.clone() );
-                return *this;
-            }
-            virtual bool match( const ExpressionT& expr ) const
-            {
-                for( std::size_t i = 0; i < m_matchers.size(); ++i )
-                    if( m_matchers[i]->match( expr ) )
-                        return true;
-                return false;
-            }
-            virtual std::string toString() const {
-                std::ostringstream oss;
-                oss << "( ";
-                for( std::size_t i = 0; i < m_matchers.size(); ++i ) {
-                    if( i != 0 )
-                        oss << " or ";
-                    oss << m_matchers[i]->toString();
-                }
-                oss << " )";
-                return oss.str();
-            }
-
-        private:
-            std::vector<Ptr<Matcher<ExpressionT> > > m_matchers;
-        };
-
-    }
-
-    namespace StdString {
-
-        struct Equals : MatcherImpl<Equals, std::string> {
-            Equals( const std::string& str ) : m_str( str ){}
-            Equals( const Equals& other ) : m_str( other.m_str ){}
-
-            virtual ~Equals();
-
-            virtual bool match( const std::string& expr ) const {
-                return m_str == expr;
-            }
-            virtual std::string toString() const {
-                return "equals: \"" + m_str + "\"";
-            }
-
-            std::string m_str;
-        };
-
-        struct Contains : MatcherImpl<Contains, std::string> {
-            Contains( const std::string& substr ) : m_substr( substr ){}
-            Contains( const Contains& other ) : m_substr( other.m_substr ){}
-
-            virtual ~Contains();
-
-            virtual bool match( const std::string& expr ) const {
-                return expr.find( m_substr ) != std::string::npos;
-            }
-            virtual std::string toString() const {
-                return "contains: \"" + m_substr + "\"";
-            }
-
-            std::string m_substr;
-        };
-
-        struct StartsWith : MatcherImpl<StartsWith, std::string> {
-            StartsWith( const std::string& substr ) : m_substr( substr ){}
-            StartsWith( const StartsWith& other ) : m_substr( other.m_substr ){}
-
-            virtual ~StartsWith();
-
-            virtual bool match( const std::string& expr ) const {
-                return expr.find( m_substr ) == 0;
-            }
-            virtual std::string toString() const {
-                return "starts with: \"" + m_substr + "\"";
-            }
-
-            std::string m_substr;
-        };
-
-        struct EndsWith : MatcherImpl<EndsWith, std::string> {
-            EndsWith( const std::string& substr ) : m_substr( substr ){}
-            EndsWith( const EndsWith& other ) : m_substr( other.m_substr ){}
-
-            virtual ~EndsWith();
-
-            virtual bool match( const std::string& expr ) const {
-                return expr.find( m_substr ) == expr.size() - m_substr.size();
-            }
-            virtual std::string toString() const {
-                return "ends with: \"" + m_substr + "\"";
-            }
-
-            std::string m_substr;
-        };
-    } // namespace StdString
-    } // namespace Impl
-
-    // The following functions create the actual matcher objects.
-    // This allows the types to be inferred
-    template<typename ExpressionT>
-    inline Impl::Generic::AllOf<ExpressionT> AllOf( const Impl::Matcher<ExpressionT>& m1,
-                                                    const Impl::Matcher<ExpressionT>& m2 ) {
-        return Impl::Generic::AllOf<ExpressionT>().add( m1 ).add( m2 );
-    }
-    template<typename ExpressionT>
-    inline Impl::Generic::AllOf<ExpressionT> AllOf( const Impl::Matcher<ExpressionT>& m1,
-                                                    const Impl::Matcher<ExpressionT>& m2,
-                                                    const Impl::Matcher<ExpressionT>& m3 ) {
-        return Impl::Generic::AllOf<ExpressionT>().add( m1 ).add( m2 ).add( m3 );
-    }
-    template<typename ExpressionT>
-    inline Impl::Generic::AnyOf<ExpressionT> AnyOf( const Impl::Matcher<ExpressionT>& m1,
-                                                    const Impl::Matcher<ExpressionT>& m2 ) {
-        return Impl::Generic::AnyOf<ExpressionT>().add( m1 ).add( m2 );
-    }
-    template<typename ExpressionT>
-    inline Impl::Generic::AnyOf<ExpressionT> AnyOf( const Impl::Matcher<ExpressionT>& m1,
-                                                    const Impl::Matcher<ExpressionT>& m2,
-                                                    const Impl::Matcher<ExpressionT>& m3 ) {
-        return Impl::Generic::AnyOf<ExpressionT>().add( m1 ).add( m2 ).add( m3 );
-    }
-
-    inline Impl::StdString::Equals      Equals( const std::string& str ){ return Impl::StdString::Equals( str ); }
-    inline Impl::StdString::Contains    Contains( const std::string& substr ){ return Impl::StdString::Contains( substr ); }
-    inline Impl::StdString::StartsWith  StartsWith( const std::string& substr ){ return Impl::StdString::StartsWith( substr ); }
-    inline Impl::StdString::EndsWith    EndsWith( const std::string& substr ){ return Impl::StdString::EndsWith( substr ); }
-
-} // namespace Matchers
-
-using namespace Matchers;
-
-} // namespace Catch
-
-// These files are included here so the single_include script doesn't put them
-// in the conditionally compiled sections
-// #included from: internal/catch_interfaces_runner.h
-#define TWOBLUECUBES_CATCH_INTERFACES_RUNNER_H_INCLUDED
-
-#include <string>
-
-namespace Catch {
-    class TestCaseInfo;
-
-    struct IRunner {
-        virtual ~IRunner();
-    };
-}
-
-
-#ifdef __OBJC__
-// #included from: internal/catch_objc.hpp
-#define TWOBLUECUBES_CATCH_OBJC_HPP_INCLUDED
-
-#import <objc/runtime.h>
-
-#include <string>
-
-// NB. Any general catch headers included here must be included
-// in catch.hpp first to make sure they are included by the single
-// header for non obj-usage
-
-///////////////////////////////////////////////////////////////////////////////
-// This protocol is really only here for (self) documenting purposes, since
-// all its methods are optional.
-@protocol OcFixture
-
-@optional
-
--(void) setUp;
--(void) tearDown;
-
-@end
-
-namespace Catch {
-
-    class OcMethod : public SharedImpl<ITestCase> {
-
-    public:
-        OcMethod( Class cls, SEL sel ) : m_cls( cls ), m_sel( sel ) {}
-
-        virtual void invoke() const {
-            id obj = [[m_cls alloc] init];
-
-            performOptionalSelector( obj, @selector(setUp)  );
-            performOptionalSelector( obj, m_sel );
-            performOptionalSelector( obj, @selector(tearDown)  );
-
-            arcSafeRelease( obj );
-        }
-    private:
-        virtual ~OcMethod() {}
-
-        Class m_cls;
-        SEL m_sel;
-    };
-
-    namespace Detail{
-
-        inline bool startsWith( const std::string& str, const std::string& sub ) {
-            return str.length() > sub.length() && str.substr( 0, sub.length() ) == sub;
-        }
-
-        inline std::string getAnnotation(   Class cls,
-                                            const std::string& annotationName,
-                                            const std::string& testCaseName ) {
-            NSString* selStr = [[NSString alloc] initWithFormat:@"Catch_%s_%s", annotationName.c_str(), testCaseName.c_str()];
-            SEL sel = NSSelectorFromString( selStr );
-            arcSafeRelease( selStr );
-            id value = performOptionalSelector( cls, sel );
-            if( value )
-                return [(NSString*)value UTF8String];
-            return "";
-        }
-    }
-
-    inline size_t registerTestMethods() {
-        size_t noTestMethods = 0;
-        int noClasses = objc_getClassList( NULL, 0 );
-
-        Class* classes = (CATCH_UNSAFE_UNRETAINED Class *)malloc( sizeof(Class) * noClasses);
-        objc_getClassList( classes, noClasses );
-
-        for( int c = 0; c < noClasses; c++ ) {
-            Class cls = classes[c];
-            {
-                u_int count;
-                Method* methods = class_copyMethodList( cls, &count );
-                for( u_int m = 0; m < count ; m++ ) {
-                    SEL selector = method_getName(methods[m]);
-                    std::string methodName = sel_getName(selector);
-                    if( Detail::startsWith( methodName, "Catch_TestCase_" ) ) {
-                        std::string testCaseName = methodName.substr( 15 );
-                        std::string name = Detail::getAnnotation( cls, "Name", testCaseName );
-                        std::string desc = Detail::getAnnotation( cls, "Description", testCaseName );
-                        const char* className = class_getName( cls );
-
-                        getMutableRegistryHub().registerTest( TestCaseInfo( new OcMethod( cls, selector ), className, name.c_str(), desc.c_str(), SourceLineInfo() ) );
-                        noTestMethods++;
-                    }
-                }
-                free(methods);
-            }
-        }
-        return noTestMethods;
-    }
-
-    namespace Matchers {
-        namespace Impl {
-        namespace NSStringMatchers {
-
-            template<typename MatcherT>
-            struct StringHolder : MatcherImpl<MatcherT, NSString*>{
-                StringHolder( NSString* substr ) : m_substr( [substr copy] ){}
-                StringHolder( StringHolder const& other ) : m_substr( [other.m_substr copy] ){}
-                StringHolder() {
-                    arcSafeRelease( m_substr );
-                }
-
-                NSString* m_substr;
-            };
-
-            struct Equals : StringHolder<Equals> {
-                Equals( NSString* substr ) : StringHolder( substr ){}
-
-                virtual bool match( ExpressionType const& str ) const {
-                    return [str isEqualToString:m_substr];
-                }
-
-                virtual std::string toString() const {
-                    return "equals string: \"" + Catch::toString( m_substr ) + "\"";
-                }
-            };
-
-            struct Contains : StringHolder<Contains> {
-                Contains( NSString* substr ) : StringHolder( substr ){}
-
-                virtual bool match( ExpressionType const& str ) const {
-                    return [str rangeOfString:m_substr].location != NSNotFound;
-                }
-
-                virtual std::string toString() const {
-                    return "contains string: \"" + Catch::toString( m_substr ) + "\"";
-                }
-            };
-
-            struct StartsWith : StringHolder<StartsWith> {
-                StartsWith( NSString* substr ) : StringHolder( substr ){}
-
-                virtual bool match( ExpressionType const& str ) const {
-                    return [str rangeOfString:m_substr].location == 0;
-                }
-
-                virtual std::string toString() const {
-                    return "starts with: \"" + Catch::toString( m_substr ) + "\"";
-                }
-            };
-            struct EndsWith : StringHolder<EndsWith> {
-                EndsWith( NSString* substr ) : StringHolder( substr ){}
-
-                virtual bool match( ExpressionType const& str ) const {
-                    return [str rangeOfString:m_substr].location == [str length] - [m_substr length];
-                }
-
-                virtual std::string toString() const {
-                    return "ends with: \"" + Catch::toString( m_substr ) + "\"";
-                }
-            };
-
-        } // namespace NSStringMatchers
-        } // namespace Impl
-
-        inline Impl::NSStringMatchers::Equals
-            Equals( NSString* substr ){ return Impl::NSStringMatchers::Equals( substr ); }
-
-        inline Impl::NSStringMatchers::Contains
-            Contains( NSString* substr ){ return Impl::NSStringMatchers::Contains( substr ); }
-
-        inline Impl::NSStringMatchers::StartsWith
-            StartsWith( NSString* substr ){ return Impl::NSStringMatchers::StartsWith( substr ); }
-
-        inline Impl::NSStringMatchers::EndsWith
-            EndsWith( NSString* substr ){ return Impl::NSStringMatchers::EndsWith( substr ); }
-
-    } // namespace Matchers
-
-    using namespace Matchers;
-
-} // namespace Catch
-
-///////////////////////////////////////////////////////////////////////////////
-#define OC_TEST_CASE( name, desc )\
-+(NSString*) INTERNAL_CATCH_UNIQUE_NAME( Catch_Name_test ) \
-{\
-return @ name; \
-}\
-+(NSString*) INTERNAL_CATCH_UNIQUE_NAME( Catch_Description_test ) \
-{ \
-return @ desc; \
-} \
--(void) INTERNAL_CATCH_UNIQUE_NAME( Catch_TestCase_test )
-
-#endif
-
-#if defined( CATCH_CONFIG_MAIN ) || defined( CATCH_CONFIG_RUNNER )
-// #included from: internal/catch_impl.hpp
-#define TWOBLUECUBES_CATCH_IMPL_HPP_INCLUDED
-
-// Collect all the implementation files together here
-// These are the equivalent of what would usually be cpp files
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wweak-vtables"
-#endif
-
-// #included from: catch_runner.hpp
-#define TWOBLUECUBES_CATCH_RUNNER_HPP_INCLUDED
-
-// #included from: internal/catch_commandline.hpp
-#define TWOBLUECUBES_CATCH_COMMANDLINE_HPP_INCLUDED
-
-namespace Catch {
-
-    class Command {
-    public:
-        Command(){}
-
-        explicit Command( const std::string& name ) : m_name( name ) {
-        }
-
-        Command& operator += ( const std::string& arg ) {
-            m_args.push_back( arg );
-            return *this;
-        }
-        Command& operator += ( const Command& other ) {
-            std::copy( other.m_args.begin(), other.m_args.end(), std::back_inserter( m_args ) );
-            if( m_name.empty() )
-                m_name = other.m_name;
-            return *this;
-        }
-        Command operator + ( const Command& other ) {
-            Command newCommand( *this );
-            newCommand += other;
-            return newCommand;
-        }
-
-        operator SafeBool::type() const {
-            return SafeBool::makeSafe( !m_name.empty() || !m_args.empty() );
-        }
-
-        std::string name() const { return m_name; }
-        std::string operator[]( std::size_t i ) const { return m_args[i]; }
-        std::size_t argsCount() const { return m_args.size(); }
-
-        CATCH_ATTRIBUTE_NORETURN
-        void raiseError( const std::string& message ) const {
-            std::ostringstream oss;
-            if( m_name.empty() )
-                oss << "Error while parsing " << m_name << ". " << message << ".";
-            else
-                oss << "Error while parsing arguments. " << message << ".";
-
-            if( m_args.size() > 0 )
-                oss << " Arguments were:";
-            for( std::size_t i = 0; i < m_args.size(); ++i )
-                oss << " " << m_args[i];
-            throw std::domain_error( oss.str() );
-        }
-
-    private:
-
-        std::string m_name;
-        std::vector<std::string> m_args;
-    };
-
-    class CommandParser {
-    public:
-        CommandParser( int argc, char const * const * argv ) : m_argc( static_cast<std::size_t>( argc ) ), m_argv( argv ) {}
-
-        std::string exeName() const {
-            return m_argv[0];
-        }
-        Command find( const std::string& arg1,  const std::string& arg2, const std::string& arg3 ) const {
-            return find( arg1 ) + find( arg2 ) + find( arg3 );
-        }
-
-        Command find( const std::string& shortArg, const std::string& longArg ) const {
-            return find( shortArg ) + find( longArg );
-        }
-        Command find( const std::string& arg ) const {
-            if( arg.empty() )
-                return getArgs( "", 1 );
-            else
-                for( std::size_t i = 1; i < m_argc; ++i  )
-                    if( m_argv[i] == arg )
-                        return getArgs( m_argv[i], i+1 );
-            return Command();
-        }
-        Command getDefaultArgs() const {
-            return getArgs( "", 1 );
-        }
-
-    private:
-        Command getArgs( const std::string& cmdName, std::size_t from ) const {
-            Command command( cmdName );
-            for( std::size_t i = from; i < m_argc && m_argv[i][0] != '-'; ++i  )
-                command += m_argv[i];
-            return command;
-        }
-
-        std::size_t m_argc;
-        char const * const * m_argv;
-    };
-
-    class OptionParser : public SharedImpl<IShared> {
-    public:
-        OptionParser( int minArgs = 0, int maxArgs = 0 )
-        : m_minArgs( minArgs ), m_maxArgs( maxArgs )
-        {}
-
-        virtual ~OptionParser() {}
-
-        Command find( const CommandParser& parser ) const {
-            Command cmd;
-            for( std::vector<std::string>::const_iterator it = m_optionNames.begin();
-                it != m_optionNames.end();
-                ++it )
-                cmd += parser.find( *it );
-            return cmd;
-        }
-
-        void validateArgs( const Command& args ) const {
-            if(  tooFewArgs( args ) || tooManyArgs( args ) ) {
-                std::ostringstream oss;
-                if( m_maxArgs == -1 )
-                    oss <<"Expected at least " << pluralise( static_cast<std::size_t>( m_minArgs ), "argument" );
-                else if( m_minArgs == m_maxArgs )
-                    oss <<"Expected " << pluralise( static_cast<std::size_t>( m_minArgs ), "argument" );
-                else
-                    oss <<"Expected between " << m_minArgs << " and " << m_maxArgs << " argument";
-                args.raiseError( oss.str() );
-            }
-        }
-
-        void parseIntoConfig( const CommandParser& parser, ConfigData& config ) {
-            if( Command cmd = find( parser ) ) {
-                validateArgs( cmd );
-                parseIntoConfig( cmd, config );
-            }
-        }
-
-        virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) = 0;
-        virtual std::string argsSynopsis() const = 0;
-        virtual std::string optionSummary() const = 0;
-        virtual std::string optionDescription() const { return ""; }
-
-        std::string optionNames() const {
-            std::string names;
-            for(    std::vector<std::string>::const_iterator it = m_optionNames.begin();
-                    it != m_optionNames.end();
-                    ++it ) {
-                if( !it->empty() ) {
-                    if( !names.empty() )
-                        names += ", ";
-                    names += *it;
-                }
-                else {
-                    names = "[" + names;
-                }
-            }
-            if( names[0] == '[' )
-                names += "]";
-            return names;
-        }
-
-    protected:
-
-        bool tooFewArgs( const Command& args ) const {
-            return args.argsCount() < static_cast<std::size_t>( m_minArgs );
-        }
-        bool tooManyArgs( const Command& args ) const {
-            return m_maxArgs >= 0 && args.argsCount() > static_cast<std::size_t>( m_maxArgs );
-        }
-        std::vector<std::string> m_optionNames;
-        int m_minArgs;
-        int m_maxArgs;
-    };
-
-    namespace Options {
-
-        class HelpOptionParser : public OptionParser {
-        public:
-            HelpOptionParser() {
-                m_optionNames.push_back( "-?" );
-                m_optionNames.push_back( "-h" );
-                m_optionNames.push_back( "--help" );
-            }
-            virtual std::string argsSynopsis() const {
-                return "[<option for help on> ...]";
-            }
-            virtual std::string optionSummary() const {
-                return "Shows this usage summary, or help on a specific option, or options, if supplied";
-            }
-            virtual std::string optionDescription() const {
-                return "";
-            }
-
-            virtual void parseIntoConfig( const Command&, ConfigData& ) {
-                // Does not affect config
-            }
-        };
-
-        class TestCaseOptionParser : public OptionParser {
-        public:
-            TestCaseOptionParser() : OptionParser( 1, -1 ) {
-                m_optionNames.push_back( "-t" );
-                m_optionNames.push_back( "--test" );
-                m_optionNames.push_back( "" ); // default option
-            }
-            virtual std::string argsSynopsis() const {
-                return "<testspec> [<testspec>...]";
-            }
-            virtual std::string optionSummary() const {
-                return "Specifies which test case or cases to run";
-            }
-
-            // Lines are split at the nearest prior space char to the 80 char column.
-            // Tab chars are removed from the output but their positions are used to align
-            // subsequently wrapped lines
-            virtual std::string optionDescription() const {
-                return
-                    "This option allows one ore more test specs to be supplied. Each spec either fully "
-                    "specifies a test case or is a pattern containing wildcards to match a set of test "
-                    "cases. If this option is not provided then all test cases, except those prefixed "
-                    "by './' are run\n"
-                    "\n"
-                    "Specs must be enclosed in \"quotes\" if they contain spaces. If they do not "
-                    "contain spaces the quotes are optional.\n"
-                    "\n"
-                    "Wildcards consist of the * character at the beginning, end, or both and can substitute for "
-                    "any number of any characters (including none)\n"
-                    "\n"
-                    "If spec is prefixed with exclude: or the ~ character then the pattern matches an exclusion. "
-                    "This means that tests matching the pattern are excluded from the set - even if a prior "
-                    "inclusion spec included them. Subsequent inclusion specs will take precedence, however. "
-                    "Inclusions and exclusions are evaluated in left-to-right order.\n"
-                    "\n"
-                    "Examples:\n"
-                    "\n"
-                    "    -t thisTestOnly        \tMatches the test case called, 'thisTestOnly'\n"
-                    "    -t \"this test only\"    \tMatches the test case called, 'this test only'\n"
-                    "    -t these/*             \tMatches all cases starting with 'these/'\n"
-                    "    -t exclude:notThis     \tMatches all tests except, 'notThis'\n"
-                    "    -t ~notThis            \tMatches all tests except, 'notThis'\n"
-                    "    -t ~*private*          \tMatches all tests except those that contain 'private'\n"
-                    "    -t a/* ~a/b/* a/b/c    \tMatches all tests that start with 'a/', except those "
-                                                 "that start with 'a/b/', except 'a/b/c', which is included";
-            }
-
-            virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) {
-                std::string groupName;
-                for( std::size_t i = 0; i < cmd.argsCount(); ++i ) {
-                    if( i != 0 )
-                        groupName += " ";
-                    groupName += cmd[i];
-                }
-                TestCaseFilters filters( groupName );
-                for( std::size_t i = 0; i < cmd.argsCount(); ++i )
-                    filters.addFilter( TestCaseFilter( cmd[i] ) );
-                config.filters.push_back( filters );
-            }
-        };
-
-        class TagOptionParser : public OptionParser {
-        public:
-            TagOptionParser() : OptionParser( 1, -1 ) {
-                m_optionNames.push_back( "-g" );
-                m_optionNames.push_back( "--tag" );
-            }
-            virtual std::string argsSynopsis() const {
-                return "<tagspec> [,<tagspec>...]";
-            }
-            virtual std::string optionSummary() const {
-                return "Matches test cases against tags or tag patterns";
-            }
-
-            // Lines are split at the nearest prior space char to the 80 char column.
-            // Tab chars are removed from the output but their positions are used to align
-            // subsequently wrapped lines
-            virtual std::string optionDescription() const {
-                return
-                "This option allows one or more tags or tag patterns to be specified.\n"
-                "Each tag is enclosed in square brackets. A series of tags form an AND expression "
-                "wheras a comma seperated sequence forms an OR expression. e.g.:\n\n"
-                "    -g [one][two],[three]\n\n"
-                "This matches all tests tagged [one] and [two], as well as all tests tagged [three].\n\n"
-                "Tags can be negated with the ~ character. This removes matching tests from the set. e.g.:\n\n"
-                "    -g [one]~[two]\n\n"
-                "matches all tests tagged [one], except those also tagged [two]";
-            }
-
-            virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) {
-                std::string groupName;
-                for( std::size_t i = 0; i < cmd.argsCount(); ++i ) {
-                    if( i != 0 )
-                        groupName += " ";
-                    groupName += cmd[i];
-                }
-                TestCaseFilters filters( groupName );
-                for( std::size_t i = 0; i < cmd.argsCount(); ++i )
-                    filters.addTags( cmd[i] );
-                config.filters.push_back( filters );
-            }
-        };
-
-        class ListOptionParser : public OptionParser {
-        public:
-            ListOptionParser() : OptionParser( 0, 2 ) {
-                m_optionNames.push_back( "-l" );
-                m_optionNames.push_back( "--list" );
-            }
-            virtual std::string argsSynopsis() const {
-                return "[all | tests | reporters [xml]]";
-            }
-            virtual std::string optionSummary() const {
-                return "Lists available tests or reporters";
-            }
-
-            virtual std::string optionDescription() const {
-                return
-                    "With no arguments this option will list all registered tests - one per line.\n"
-                    "Supplying the xml argument formats the list as an xml document (which may be useful for "
-                    "consumption by other tools).\n"
-                    "Supplying the tests or reporters lists tests or reporters respectively - with descriptions.\n"
-                    "\n"
-                    "Examples:\n"
-                    "\n"
-                    "    -l\n"
-                    "    -l tests\n"
-                    "    -l reporters xml\n"
-                    "    -l xml";
-            }
-
-            virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) {
-                config.listSpec = List::TestNames;
-                if( cmd.argsCount() >= 1 ) {
-                    if( cmd[0] == "all" )
-                        config.listSpec = List::All;
-                    else if( cmd[0] == "tests" )
-                        config.listSpec = List::Tests;
-                    else if( cmd[0] == "reporters" )
-                        config.listSpec = List::Reports;
-                    else
-                        cmd.raiseError( "Expected [tests] or [reporters]" );
-                }
-                if( cmd.argsCount() >= 2 ) {
-                    if( cmd[1] == "xml" )
-                        config.listSpec = static_cast<List::What>( config.listSpec | List::AsXml );
-                    else if( cmd[1] == "text" )
-                        config.listSpec = static_cast<List::What>( config.listSpec | List::AsText );
-                    else
-                        cmd.raiseError( "Expected [xml] or [text]" );
-                }
-            }
-        };
-
-        class ReporterOptionParser : public OptionParser {
-        public:
-            ReporterOptionParser() : OptionParser( 1, 1 ) {
-                m_optionNames.push_back( "-r" );
-                m_optionNames.push_back( "--reporter" );
-            }
-            virtual std::string argsSynopsis() const {
-                return "<reporter name>";
-            }
-            virtual std::string optionSummary() const {
-                return "Specifies type of reporter";
-            }
-
-            virtual std::string optionDescription() const {
-                return
-                    "A reporter is an object that formats and structures the output of running "
-                    "tests, and potentially summarises the results. By default a basic reporter "
-                    "is used that writes IDE friendly results. CATCH comes bundled with some "
-                    "alternative reporters, but more can be added in client code.\n"
-                    "\n"
-                    "The bundled reporters are:\n"
-                    "    -r basic\n"
-                    "    -r xml\n"
-                    "    -r junit\n"
-                    "\n"
-                    "The JUnit reporter is an xml format that follows the structure of the JUnit "
-                    "XML Report ANT task, as consumed by a number of third-party tools, "
-                    "including Continuous Integration servers such as Jenkins.\n"
-                    "If not otherwise needed, the standard XML reporter is preferred as this is "
-                    "a streaming reporter, whereas the Junit reporter needs to hold all its "
-                    "results until the end so it can write the overall results into attributes "
-                    "of the root node.";
-            }
-
-            virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) {
-                config.reporter = cmd[0];
-            }
-        };
-
-        class OutputOptionParser : public OptionParser {
-        public:
-            OutputOptionParser() : OptionParser( 1, 1 ) {
-                m_optionNames.push_back( "-o" );
-                m_optionNames.push_back( "--out" );
-            }
-            virtual std::string argsSynopsis() const {
-                return "<file name>|<%stream name>";
-            }
-            virtual std::string optionSummary() const {
-                return "Sends output to a file or stream";
-            }
-            virtual std::string optionDescription() const {
-                return
-                    "Use this option to send all output to a file or a stream. By default output is "
-                    "sent to stdout (note that uses of stdout and stderr from within test cases are "
-                    "redirected and included in the report - so even stderr will effectively end up "
-                    "on stdout). If the name begins with % it is interpreted as a stream. "
-                    "Otherwise it is treated as a filename.\n"
-                    "\n"
-                    "Examples are:\n"
-                    "\n"
-                    "    -o filename.txt\n"
-                    "    -o \"long filename.txt\"\n"
-                    "    -o %stdout\n"
-                    "    -o %stderr\n"
-                    "    -o %debug    \t(The IDE's debug output window - currently only Windows' "
-                                        "OutputDebugString is supported).";
-            }
-            virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) {
-                if( cmd[0][0] == '%' )
-                    config.stream = cmd[0].substr( 1 );
-                else
-                    config.outputFilename = cmd[0];
-            }
-        };
-
-        class SuccessOptionParser : public OptionParser {
-        public:
-            SuccessOptionParser() {
-                m_optionNames.push_back( "-s" );
-                m_optionNames.push_back( "--success" );
-            }
-            virtual std::string argsSynopsis() const {
-                return "";
-            }
-            virtual std::string optionSummary() const {
-                return "Shows results for successful tests";
-            }
-            virtual std::string optionDescription() const {
-                return
-                    "Usually you only want to see reporting for failed tests. Sometimes it's useful "
-                    "to see all the output (especially when you don't trust that that test you just "
-                    "added worked first time!). To see successful, as well as failing, test results "
-                    "just pass this option.";
-            }
-            virtual void parseIntoConfig( const Command&, ConfigData& config ) {
-                config.includeWhichResults = Include::SuccessfulResults;
-            }
-        };
-
-        class DebugBreakOptionParser : public OptionParser {
-        public:
-            DebugBreakOptionParser() {
-                m_optionNames.push_back( "-b" );
-                m_optionNames.push_back( "--break" );
-            }
-            virtual std::string argsSynopsis() const {
-                return "";
-            }
-            virtual std::string optionSummary() const {
-                return "Breaks into the debugger on failure";
-            }
-            virtual std::string optionDescription() const {
-                return
-                    "In some IDEs (currently XCode and Visual Studio) it is possible for CATCH to "
-                    "break into the debugger on a test failure. This can be very helpful during "
-                    "debug sessions - especially when there is more than one path through a "
-                    "particular test. In addition to the command line option, ensure you have "
-                    "built your code with the DEBUG preprocessor symbol";
-            }
-
-            virtual void parseIntoConfig( const Command&, ConfigData& config ) {
-                config.shouldDebugBreak = true;
-            }
-        };
-
-        class NameOptionParser : public OptionParser {
-        public:
-            NameOptionParser() : OptionParser( 1, 1 ) {
-                m_optionNames.push_back( "-n" );
-                m_optionNames.push_back( "--name" );
-            }
-            virtual std::string argsSynopsis() const {
-                return "<name>";
-            }
-            virtual std::string optionSummary() const {
-                return "Names a test run";
-            }
-            virtual std::string optionDescription() const {
-                return
-                    "If a name is supplied it will be used by the reporter to provide an overall "
-                    "name for the test run. This can be useful if you are sending to a file, for "
-                    "example, and need to distinguish different test runs - either from different "
-                    "Catch executables or runs of the same executable with different options.\n"
-                    "\n"
-                    "Examples:\n"
-                    "\n"
-                    "    -n testRun\n"
-                    "    -n \"tests of the widget component\"";
-            }
-
-            virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) {
-                config.name = cmd[0];
-            }
-        };
-
-        class AbortOptionParser : public OptionParser {
-        public:
-            AbortOptionParser() : OptionParser( 0, 1 ) {
-                m_optionNames.push_back( "-a" );
-                m_optionNames.push_back( "--abort" );
-            }
-            virtual std::string argsSynopsis() const {
-                return "[#]";
-            }
-            virtual std::string optionSummary() const {
-                return "Aborts after a certain number of failures";
-            }
-            virtual std::string optionDescription() const {
-                return
-                    "If a REQUIRE assertion fails the test case aborts, but subsequent test cases "
-                    "are still run. If a CHECK assertion fails even the current test case is not "
-                    "aborted.\n"
-                    "\n"
-                    "Sometimes this results in a flood of failure messages and you'd rather just "
-                    "see the first few. Specifying -a or --abort on its own will abort the whole "
-                    "test run on the first failed assertion of any kind. Following it with a "
-                    "number causes it to abort after that number of assertion failures.";
-            }
-
-            virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) {
-                int threshold = 1;
-                if( cmd.argsCount() == 1 ) {
-                    std::stringstream ss;
-                    ss << cmd[0];
-                    ss >> threshold;
-                    if( ss.fail() || threshold <= 0 )
-                        cmd.raiseError( "threshold must be a number greater than zero" );
-                }
-                config.cutoff = threshold;
-            }
-        };
-
-        class NoThrowOptionParser : public OptionParser {
-        public:
-            NoThrowOptionParser() {
-                m_optionNames.push_back( "-nt" );
-                m_optionNames.push_back( "--nothrow" );
-            }
-            virtual std::string argsSynopsis() const {
-                return "";
-            }
-            virtual std::string optionSummary() const {
-                return "Elides assertions expected to throw";
-            }
-            virtual std::string optionDescription() const {
-                return
-                    "Skips all assertions that test that an exception is thrown, "
-                    "e.g. REQUIRE_THROWS.\n"
-                    "\n"
-                    "These can be a nuisance in certain debugging environments that may break when "
-                    "exceptions are thrown (while this is usually optional for handled exceptions, "
-                    "it can be useful to have enabled if you are trying to track down something "
-                    "unexpected).\n"
-                    "\n"
-                    "When running with this option the throw checking assertions are skipped so "
-                    "as not to contribute additional noise.";
-            }
-
-            virtual void parseIntoConfig( const Command&, ConfigData& config ) {
-                config.allowThrows = false;
-            }
-        };
-
-        class WarningsOptionParser : public OptionParser {
-        public:
-            WarningsOptionParser() : OptionParser( 1, -1 ) {
-                m_optionNames.push_back( "-w" );
-                m_optionNames.push_back( "--warnings" );
-            }
-            virtual std::string argsSynopsis() const {
-                return "<warning>";
-            }
-            virtual std::string optionSummary() const {
-                return "Enable warnings";
-            }
-            virtual std::string optionDescription() const {
-                return
-                    "Enables the named warnings. If the warnings are violated the test case is "
-                    "failed.\n"
-                    "\n"
-                    "At present only one warning has been provided: NoAssertions. If this warning "
-                    "is enabled then any test case that completes without an assertions (CHECK, "
-                    "REQUIRE etc) being encountered violates the warning.\n"
-                    "\n"
-                    "e.g.:\n"
-                    "\n"
-                    "    -w NoAssertions";
-            }
-
-            virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) {
-                for( std::size_t i = 0; i < cmd.argsCount(); ++i ) {
-                    if( cmd[i] == "NoAssertions" )
-                        config.warnings = (ConfigData::WarnAbout::What)( config.warnings | ConfigData::WarnAbout::NoAssertions );
-                    else
-                        cmd.raiseError( "Unrecognised warning: " + cmd[i] );
-                }
-            }
-        };
-    }
-
-    class AllOptions
-    {
-    public:
-        typedef std::vector<Ptr<OptionParser> > Parsers;
-        typedef Parsers::const_iterator const_iterator;
-        typedef Parsers::const_iterator iterator;
-
-        AllOptions() {
-            add<Options::TestCaseOptionParser>();   // Keep this one first
-
-            add<Options::TagOptionParser>();
-            add<Options::ListOptionParser>();
-            add<Options::ReporterOptionParser>();
-            add<Options::OutputOptionParser>();
-            add<Options::SuccessOptionParser>();
-            add<Options::DebugBreakOptionParser>();
-            add<Options::NameOptionParser>();
-            add<Options::AbortOptionParser>();
-            add<Options::NoThrowOptionParser>();
-            add<Options::WarningsOptionParser>();
-
-            add<Options::HelpOptionParser>();       // Keep this one last
-        }
-
-        void parseIntoConfig( const CommandParser& parser, ConfigData& config ) {
-            for( const_iterator it = m_parsers.begin(); it != m_parsers.end(); ++it )
-                (*it)->parseIntoConfig( parser, config );
-        }
-
-        const_iterator begin() const {
-            return m_parsers.begin();
-        }
-        const_iterator end() const {
-            return m_parsers.end();
-        }
-    private:
-
-        template<typename T>
-        void add() {
-            m_parsers.push_back( new T() );
-        }
-        Parsers m_parsers;
-
-    };
-
-} // end namespace Catch
-
-// #included from: internal/catch_list.hpp
-#define TWOBLUECUBES_CATCH_LIST_HPP_INCLUDED
-
-#include <limits>
-
-namespace Catch {
-    inline bool matchesFilters( const std::vector<TestCaseFilters>& filters, const TestCaseInfo& testCase ) {
-        std::vector<TestCaseFilters>::const_iterator it = filters.begin();
-        std::vector<TestCaseFilters>::const_iterator itEnd = filters.end();
-        for(; it != itEnd; ++it )
-            if( !it->shouldInclude( testCase ) )
-                return false;
-        return true;
-    }
-    inline void List( const ConfigData& config ) {
-
-        if( config.listSpec & List::Reports ) {
-            std::cout << "Available reports:\n";
-            IReporterRegistry::FactoryMap::const_iterator it = getRegistryHub().getReporterRegistry().getFactories().begin();
-            IReporterRegistry::FactoryMap::const_iterator itEnd = getRegistryHub().getReporterRegistry().getFactories().end();
-            for(; it != itEnd; ++it ) {
-                // !TBD: consider listAs()
-                std::cout << "\t" << it->first << "\n\t\t'" << it->second->getDescription() << "'\n";
-            }
-            std::cout << std::endl;
-        }
-
-        if( config.listSpec & List::Tests ) {
-            if( config.filters.empty() )
-                std::cout << "All available test cases:\n";
-            else
-                std::cout << "Matching test cases:\n";
-            std::vector<TestCaseInfo>::const_iterator it = getRegistryHub().getTestCaseRegistry().getAllTests().begin();
-            std::vector<TestCaseInfo>::const_iterator itEnd = getRegistryHub().getTestCaseRegistry().getAllTests().end();
-            std::size_t matchedTests = 0;
-            for(; it != itEnd; ++it ) {
-                if( matchesFilters( config.filters, *it ) ) {
-                    matchedTests++;
-                    // !TBD: consider listAs()
-                    std::cout << "\t" << it->getName() << "\n";
-                    if( ( config.listSpec & List::TestNames ) != List::TestNames )
-                        std::cout << "\t\t '" << it->getDescription() << "'\n";
-                }
-            }
-            if( config.filters.empty() )
-                std::cout << pluralise( matchedTests, "test case" ) << std::endl;
-            else
-                std::cout << pluralise( matchedTests, "matching test case" ) << std::endl;
-        }
-
-        if( ( config.listSpec & List::All ) == 0 ) {
-            std::ostringstream oss;
-            oss << "Unknown list type";
-            throw std::domain_error( oss.str() );
-        }
-    }
-
-} // end namespace Catch
-
-// #included from: internal/catch_runner_impl.hpp
-#define TWOBLUECUBES_CATCH_RUNNER_IMPL_HPP_INCLUDED
-
-// #included from: catch_running_test.hpp
-#define TWOBLUECUBES_CATCH_RUNNING_TEST_HPP_INCLUDED
-
-// #included from: catch_section_info.hpp
-#define TWOBLUECUBES_CATCH_SECTION_INFO_HPP_INCLUDED
-
-#include <map>
-#include <string>
-
-namespace Catch {
-
-    class SectionInfo {
-    public:
-
-        enum Status {
-            Root,
-            Unknown,
-            Branch,
-            TestedBranch,
-            TestedLeaf
-        };
-
-        SectionInfo( SectionInfo* parent )
-        :   m_status( Unknown ),
-            m_parent( parent )
-        {}
-
-        SectionInfo()
-        :   m_status( Root ),
-            m_parent( NULL )
-        {}
-
-        ~SectionInfo() {
-            deleteAllValues( m_subSections );
-        }
-
-        bool shouldRun() const {
-            return m_status < TestedBranch;
-        }
-
-        bool ran() {
-            if( m_status < Branch ) {
-                m_status = TestedLeaf;
-                return true;
-            }
-            return false;
-        }
-
-        bool isBranch() const {
-            return m_status == Branch;
-        }
-
-        void ranToCompletion() {
-            if( m_status == Branch && !hasUntestedSections() )
-                m_status = TestedBranch;
-        }
-
-        SectionInfo* findSubSection( const std::string& name ) {
-            std::map<std::string, SectionInfo*>::const_iterator it = m_subSections.find( name );
-            return it != m_subSections.end()
-                        ? it->second
-                        : NULL;
-        }
-
-        SectionInfo* addSubSection( const std::string& name ) {
-            SectionInfo* subSection = new SectionInfo( this );
-            m_subSections.insert( std::make_pair( name, subSection ) );
-            m_status = Branch;
-            return subSection;
-        }
-
-        SectionInfo* getParent() {
-            return m_parent;
-        }
-
-        bool hasUntestedSections() const {
-            if( m_status == Unknown )
-                return true;
-
-            std::map<std::string, SectionInfo*>::const_iterator it = m_subSections.begin();
-            std::map<std::string, SectionInfo*>::const_iterator itEnd = m_subSections.end();
-            for(; it != itEnd; ++it ) {
-                if( it->second->hasUntestedSections() )
-                    return true;
-            }
-            return false;
-        }
-
-    private:
-        Status m_status;
-        std::map<std::string, SectionInfo*> m_subSections;
-        SectionInfo* m_parent;
-    };
-}
-
-namespace Catch {
-
-    class RunningTest {
-
-        enum RunStatus {
-            NothingRun,
-            EncounteredASection,
-            RanAtLeastOneSection,
-            RanToCompletionWithSections,
-            RanToCompletionWithNoSections
-        };
-
-    public:
-        explicit RunningTest( const TestCaseInfo* info = NULL )
-        :   m_info( info ),
-            m_runStatus( RanAtLeastOneSection ),
-            m_currentSection( &m_rootSection ),
-            m_changed( false )
-        {}
-
-        bool wasSectionSeen() const {
-            return  m_runStatus == RanAtLeastOneSection ||
-                    m_runStatus == RanToCompletionWithSections;
-        }
-
-        bool isBranchSection() const {
-            return  m_currentSection &&
-                    m_currentSection->isBranch();
-        }
-
-        bool hasSections() const {
-            return  m_runStatus == RanAtLeastOneSection ||
-                    m_runStatus == RanToCompletionWithSections ||
-                    m_runStatus == EncounteredASection;
-        }
-
-        void reset() {
-            m_runStatus = NothingRun;
-            m_changed = false;
-            m_lastSectionToRun = NULL;
-        }
-
-        void ranToCompletion() {
-            if( m_runStatus == RanAtLeastOneSection ||
-                m_runStatus == EncounteredASection ) {
-                m_runStatus = RanToCompletionWithSections;
-                if( m_lastSectionToRun ) {
-                    m_lastSectionToRun->ranToCompletion();
-                    m_changed = true;
-                }
-            }
-            else {
-                m_runStatus = RanToCompletionWithNoSections;
-            }
-        }
-
-        bool addSection( const std::string& name ) {
-            if( m_runStatus == NothingRun )
-                m_runStatus = EncounteredASection;
-
-            SectionInfo* thisSection = m_currentSection->findSubSection( name );
-            if( !thisSection ) {
-                thisSection = m_currentSection->addSubSection( name );
-                m_changed = true;
-            }
-
-            if( !wasSectionSeen() && thisSection->shouldRun() ) {
-                m_currentSection = thisSection;
-                m_lastSectionToRun = NULL;
-                return true;
-            }
-            return false;
-        }
-
-        void endSection( const std::string& ) {
-            if( m_currentSection->ran() ) {
-                m_runStatus = RanAtLeastOneSection;
-                m_changed = true;
-            }
-            else if( m_runStatus == EncounteredASection ) {
-                m_runStatus = RanAtLeastOneSection;
-                m_lastSectionToRun = m_currentSection;
-            }
-            m_currentSection = m_currentSection->getParent();
-        }
-
-        const TestCaseInfo& getTestCaseInfo() const {
-            return *m_info;
-        }
-
-        bool hasUntestedSections() const {
-            return  m_runStatus == RanAtLeastOneSection ||
-                    ( m_rootSection.hasUntestedSections() && m_changed );
-        }
-
-    private:
-        const TestCaseInfo* m_info;
-        RunStatus m_runStatus;
-        SectionInfo m_rootSection;
-        SectionInfo* m_currentSection;
-        SectionInfo* m_lastSectionToRun;
-        bool m_changed;
-    };
-}
-
-#include <set>
-#include <string>
-
-namespace Catch {
-
-    class StreamRedirect {
-
-    public:
-        StreamRedirect( std::ostream& stream, std::string& targetString )
-        :   m_stream( stream ),
-            m_prevBuf( stream.rdbuf() ),
-            m_targetString( targetString )
-        {
-            stream.rdbuf( m_oss.rdbuf() );
-        }
-
-        ~StreamRedirect() {
-            m_targetString += m_oss.str();
-            m_stream.rdbuf( m_prevBuf );
-        }
-
-    private:
-        std::ostream& m_stream;
-        std::streambuf* m_prevBuf;
-        std::ostringstream m_oss;
-        std::string& m_targetString;
-    };
-
-    ///////////////////////////////////////////////////////////////////////////
-
-    class Runner : public IResultCapture, public IRunner {
-
-        Runner( const Runner& );
-        void operator =( const Runner& );
-
-    public:
-
-        explicit Runner( const Config& config, const Ptr<IReporter>& reporter )
-        :   m_context( getCurrentMutableContext() ),
-            m_runningTest( NULL ),
-            m_config( config ),
-            m_reporter( reporter ),
-            m_prevRunner( &m_context.getRunner() ),
-            m_prevResultCapture( &m_context.getResultCapture() ),
-            m_prevConfig( m_context.getConfig() )
-        {
-            m_context.setRunner( this );
-            m_context.setConfig( &m_config );
-            m_context.setResultCapture( this );
-            m_reporter->StartTesting();
-        }
-
-        virtual ~Runner() {
-            m_reporter->EndTesting( m_totals );
-            m_context.setRunner( m_prevRunner );
-            m_context.setConfig( NULL );
-            m_context.setResultCapture( m_prevResultCapture );
-            m_context.setConfig( m_prevConfig );
-        }
-
-        Totals runMatching( const std::string& testSpec ) {
-
-            std::vector<TestCaseInfo> matchingTests = getRegistryHub().getTestCaseRegistry().getMatchingTestCases( testSpec );
-
-            Totals totals;
-
-            m_reporter->StartGroup( testSpec );
-
-            std::vector<TestCaseInfo>::const_iterator it = matchingTests.begin();
-            std::vector<TestCaseInfo>::const_iterator itEnd = matchingTests.end();
-            for(; it != itEnd; ++it )
-                totals += runTest( *it );
-            // !TBD use std::accumulate?
-
-            m_reporter->EndGroup( testSpec, totals );
-            return totals;
-        }
-
-        Totals runTest( const TestCaseInfo& testInfo ) {
-            Totals prevTotals = m_totals;
-
-            std::string redirectedCout;
-            std::string redirectedCerr;
-
-            m_reporter->StartTestCase( testInfo );
-
-            m_runningTest = new RunningTest( &testInfo );
-
-            do {
-                do {
-                    runCurrentTest( redirectedCout, redirectedCerr );
-                }
-                while( m_runningTest->hasUntestedSections() && !aborting() );
-            }
-            while( getCurrentContext().advanceGeneratorsForCurrentTest() && !aborting() );
-
-            delete m_runningTest;
-            m_runningTest = NULL;
-
-            Totals deltaTotals = m_totals.delta( prevTotals );
-            m_totals.testCases += deltaTotals.testCases;
-            m_reporter->EndTestCase( testInfo, deltaTotals, redirectedCout, redirectedCerr );
-            return deltaTotals;
-        }
-
-        const Config& config() const {
-            return m_config;
-        }
-
-    private: // IResultCapture
-
-        virtual ResultAction::Value acceptExpression( const ExpressionResultBuilder& assertionResult, const AssertionInfo& assertionInfo ) {
-            m_lastAssertionInfo = assertionInfo;
-            return actOnCurrentResult( assertionResult.buildResult( assertionInfo ) );
-        }
-
-        virtual void testEnded( const AssertionResult& result ) {
-            if( result.getResultType() == ResultWas::Ok ) {
-                m_totals.assertions.passed++;
-            }
-            else if( !result.isOk() ) {
-                m_totals.assertions.failed++;
-
-                {
-                    std::vector<ScopedInfo*>::const_iterator it = m_scopedInfos.begin();
-                    std::vector<ScopedInfo*>::const_iterator itEnd = m_scopedInfos.end();
-                    for(; it != itEnd; ++it )
-                        m_reporter->Result( (*it)->buildResult( m_lastAssertionInfo ) );
-                }
-                {
-                    std::vector<AssertionResult>::const_iterator it = m_assertionResults.begin();
-                    std::vector<AssertionResult>::const_iterator itEnd = m_assertionResults.end();
-                    for(; it != itEnd; ++it )
-                        m_reporter->Result( *it );
-                }
-                m_assertionResults.clear();
-            }
-
-            if( result.getResultType() == ResultWas::Info )
-                m_assertionResults.push_back( result );
-            else
-                m_reporter->Result( result );
-        }
-
-        virtual bool sectionStarted (
-            const std::string& name,
-            const std::string& description,
-            const SourceLineInfo& lineInfo,
-            Counts& assertions
-        )
-        {
-            std::ostringstream oss;
-            oss << name << "@" << lineInfo;
-
-            if( !m_runningTest->addSection( oss.str() ) )
-                return false;
-
-            m_lastAssertionInfo.lineInfo = lineInfo;
-
-            m_reporter->StartSection( name, description );
-            assertions = m_totals.assertions;
-
-            return true;
-        }
-
-        virtual void sectionEnded( const std::string& name, const Counts& prevAssertions ) {
-            Counts assertions = m_totals.assertions - prevAssertions;
-            if( assertions.total() == 0  &&
-               ( m_config.data().warnings & ConfigData::WarnAbout::NoAssertions ) &&
-               !m_runningTest->isBranchSection() ) {
-                m_reporter->NoAssertionsInSection( name );
-                m_totals.assertions.failed++;
-                assertions.failed++;
-            }
-            m_runningTest->endSection( name );
-            m_reporter->EndSection( name, assertions );
-        }
-
-        virtual void pushScopedInfo( ScopedInfo* scopedInfo ) {
-            m_scopedInfos.push_back( scopedInfo );
-        }
-
-        virtual void popScopedInfo( ScopedInfo* scopedInfo ) {
-            if( m_scopedInfos.back() == scopedInfo )
-                m_scopedInfos.pop_back();
-        }
-
-        virtual bool shouldDebugBreak() const {
-            return m_config.shouldDebugBreak();
-        }
-
-        virtual std::string getCurrentTestName() const {
-            return m_runningTest
-                ? m_runningTest->getTestCaseInfo().getName()
-                : "";
-        }
-
-        virtual const AssertionResult* getLastResult() const {
-            return &m_lastResult;
-        }
-
-    public:
-        // !TBD We need to do this another way!
-        bool aborting() const {
-            return m_totals.assertions.failed == static_cast<std::size_t>( m_config.getCutoff() );
-        }
-
-    private:
-
-        ResultAction::Value actOnCurrentResult( const AssertionResult& result ) {
-            m_lastResult = result;
-            testEnded( m_lastResult );
-
-            ResultAction::Value action = ResultAction::None;
-
-            if( !m_lastResult.isOk() ) {
-                action = ResultAction::Failed;
-                if( shouldDebugBreak() )
-                    action = (ResultAction::Value)( action | ResultAction::Debug );
-                if( aborting() )
-                    action = (ResultAction::Value)( action | ResultAction::Abort );
-            }
-            return action;
-        }
-
-        void runCurrentTest( std::string& redirectedCout, std::string& redirectedCerr ) {
-            try {
-                m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCaseInfo().getLineInfo(), "", ResultDisposition::Normal );
-                m_runningTest->reset();
-                Counts prevAssertions = m_totals.assertions;
-                if( m_reporter->shouldRedirectStdout() ) {
-                    StreamRedirect coutRedir( std::cout, redirectedCout );
-                    StreamRedirect cerrRedir( std::cerr, redirectedCerr );
-                    m_runningTest->getTestCaseInfo().invoke();
-                }
-                else {
-                    m_runningTest->getTestCaseInfo().invoke();
-                }
-                Counts assertions = m_totals.assertions - prevAssertions;
-                if( assertions.total() == 0  &&
-                   ( m_config.data().warnings & ConfigData::WarnAbout::NoAssertions ) &&
-                   !m_runningTest->hasSections() ) {
-                        m_totals.assertions.failed++;
-                        m_reporter->NoAssertionsInTestCase( m_runningTest->getTestCaseInfo().getName() );
-                }
-                m_runningTest->ranToCompletion();
-            }
-            catch( TestFailureException& ) {
-                // This just means the test was aborted due to failure
-            }
-            catch(...) {
-                ExpressionResultBuilder exResult( ResultWas::ThrewException );
-                exResult << translateActiveException();
-                actOnCurrentResult( exResult.buildResult( m_lastAssertionInfo )  );
-            }
-            m_assertionResults.clear();
-        }
-
-    private:
-        IMutableContext& m_context;
-        RunningTest* m_runningTest;
-        AssertionResult m_lastResult;
-
-        const Config& m_config;
-        Totals m_totals;
-        Ptr<IReporter> m_reporter;
-        std::vector<ScopedInfo*> m_scopedInfos;
-        std::vector<AssertionResult> m_assertionResults;
-        IRunner* m_prevRunner;
-        IResultCapture* m_prevResultCapture;
-        const IConfig* m_prevConfig;
-        AssertionInfo m_lastAssertionInfo;
-    };
-
-} // end namespace Catch
-
-#include <fstream>
-#include <stdlib.h>
-#include <limits>
-
-namespace Catch {
-
-    class Runner2 { // This will become Runner when Runner becomes Context
-
-    public:
-        Runner2( Config& configWrapper )
-        :   m_configWrapper( configWrapper ),
-            m_config( configWrapper.data() )
-        {
-            openStream();
-            makeReporter();
-        }
-
-        Totals runTests() {
-
-            std::vector<TestCaseFilters> filterGroups = m_config.filters;
-            if( filterGroups.empty() ) {
-                TestCaseFilters filterGroup( "" );
-                filterGroups.push_back( filterGroup );
-            }
-
-            Runner context( m_configWrapper, m_reporter ); // This Runner will be renamed Context
-            Totals totals;
-
-            std::vector<TestCaseFilters>::const_iterator it = filterGroups.begin();
-            std::vector<TestCaseFilters>::const_iterator itEnd = filterGroups.end();
-            for(; it != itEnd && !context.aborting(); ++it ) {
-                m_reporter->StartGroup( it->getName() );
-                totals += runTestsForGroup( context, *it );
-                if( context.aborting() )
-                    m_reporter->Aborted();
-                m_reporter->EndGroup( it->getName(), totals );
-            }
-            return totals;
-        }
-
-        Totals runTestsForGroup( Runner& context, const TestCaseFilters& filterGroup ) {
-            Totals totals;
-            std::vector<TestCaseInfo>::const_iterator it = getRegistryHub().getTestCaseRegistry().getAllTests().begin();
-            std::vector<TestCaseInfo>::const_iterator itEnd = getRegistryHub().getTestCaseRegistry().getAllTests().end();
-            int testsRunForGroup = 0;
-            for(; it != itEnd; ++it ) {
-                if( filterGroup.shouldInclude( *it ) ) {
-                    testsRunForGroup++;
-                    if( m_testsAlreadyRun.find( *it ) == m_testsAlreadyRun.end() ) {
-
-                        if( context.aborting() )
-                            break;
-
-                        totals += context.runTest( *it );
-                        m_testsAlreadyRun.insert( *it );
-                    }
-                }
-            }
-            if( testsRunForGroup == 0 )
-                std::cerr << "\n[No test cases matched with: " << filterGroup.getName() << "]" << std::endl;
-            return totals;
-
-        }
-
-    private:
-        void openStream() {
-            if( !m_config.stream.empty() )
-                m_configWrapper.useStream( m_config.stream );
-
-            // Open output file, if specified
-            if( !m_config.outputFilename.empty() ) {
-                m_ofs.open( m_config.outputFilename.c_str() );
-                if( m_ofs.fail() ) {
-                    std::ostringstream oss;
-                    oss << "Unable to open file: '" << m_config.outputFilename << "'";
-                    throw std::domain_error( oss.str() );
-                }
-                m_configWrapper.setStreamBuf( m_ofs.rdbuf() );
-            }
-        }
-        void makeReporter() {
-            std::string reporterName = m_config.reporter.empty()
-            ? "basic"
-            : m_config.reporter;
-
-            ReporterConfig reporterConfig( m_config.name, m_configWrapper.stream(), m_config.includeWhichResults == Include::SuccessfulResults, m_config );
-
-            m_reporter = getRegistryHub().getReporterRegistry().create( reporterName, reporterConfig );
-            if( !m_reporter ) {
-                std::ostringstream oss;
-                oss << "No reporter registered with name: '" << reporterName << "'";
-                throw std::domain_error( oss.str() );
-            }
-        }
-
-    private:
-        Config& m_configWrapper;
-        const ConfigData& m_config;
-        std::ofstream m_ofs;
-        Ptr<IReporter> m_reporter;
-        std::set<TestCaseInfo> m_testsAlreadyRun;
-    };
-
-    inline int Main( Config& configWrapper ) {
-        int result = 0;
-        try
-        {
-            Runner2 runner( configWrapper );
-
-            const ConfigData& config = configWrapper.data();
-
-            // Handle list request
-            if( config.listSpec != List::None ) {
-                List( config );
-                Catch::cleanUp();
-                return 0;
-            }
-
-            result = static_cast<int>( runner.runTests().assertions.failed );
-
-        }
-        catch( std::exception& ex ) {
-            std::cerr << ex.what() << std::endl;
-            result = (std::numeric_limits<int>::max)();
-        }
-
-        Catch::cleanUp();
-        return result;
-    }
-
-    inline void showUsage( std::ostream& os ) {
-        AllOptions options;
-
-        for( AllOptions::const_iterator it = options.begin(); it != options.end(); ++it ) {
-            OptionParser& opt = **it;
-            os << "  " << opt.optionNames() << " " << opt.argsSynopsis() << "\n";
-        }
-        os << "\nFor more detail usage please see: https://github.com/philsquared/Catch/wiki/Command-line\n" << std::endl;
-    }
-
-    inline void addIndent( std::ostream& os, std::size_t indent ) {
-        while( indent-- > 0 )
-            os << ' ';
-    }
-
-    inline void recursivelyWrapLine( std::ostream& os, std::string paragraph, std::size_t columns, std::size_t indent ) {
-        std::size_t width = columns-indent;
-        std::size_t tab = 0;
-        std::size_t wrapPoint = width;
-        for( std::size_t pos = 0; pos < paragraph.size(); ++pos ) {
-            if( pos == width ) {
-                addIndent( os, indent );
-                os << paragraph.substr( 0, wrapPoint ) << "\n";
-                return recursivelyWrapLine( os, paragraph.substr( wrapPoint+1 ), columns, indent+tab );
-            }
-            if( paragraph[pos] == '\t' ) {
-                    tab = pos;
-                    paragraph = paragraph.substr( 0, tab ) + paragraph.substr( tab+1 );
-                    pos--;
-            }
-            else if( paragraph[pos] == ' ' ) {
-                wrapPoint = pos;
-            }
-        }
-        addIndent( os, indent );
-        os << paragraph << "\n";
-    }
-
-    inline std::string addLineBreaks( const std::string& str, std::size_t columns, std::size_t indent = 0 ) {
-        std::ostringstream oss;
-        std::string::size_type pos = 0;
-        std::string::size_type newline = str.find_first_of( '\n' );
-        while( newline != std::string::npos ) {
-            std::string paragraph = str.substr( pos, newline-pos );
-            recursivelyWrapLine( oss, paragraph, columns, indent );
-            pos = newline+1;
-            newline = str.find_first_of( '\n', pos );
-        }
-        if( pos != str.size() )
-            recursivelyWrapLine( oss, str.substr( pos, str.size()-pos ), columns, indent );
-
-        return oss.str();
-    }
-
-    inline void showHelp( const CommandParser& parser ) {
-        std::string exeName = parser.exeName();
-        std::string::size_type pos = exeName.find_last_of( "/\\" );
-        if( pos != std::string::npos ) {
-            exeName = exeName.substr( pos+1 );
-        }
-
-        AllOptions options;
-        Options::HelpOptionParser helpOpt;
-        bool displayedSpecificOption = false;
-        for( AllOptions::const_iterator it = options.begin(); it != options.end(); ++it ) {
-            OptionParser& opt = **it;
-            if( opt.find( parser ) && opt.optionNames() != helpOpt.optionNames() ) {
-                displayedSpecificOption = true;
-                std::cout   << "\n" << opt.optionNames() << " " << opt.argsSynopsis() << "\n\n"
-                            << opt.optionSummary() << "\n\n"
-
-                << addLineBreaks( opt.optionDescription(), 80, 2 ) << "\n" << std::endl;
-            }
-        }
-
-        if( !displayedSpecificOption ) {
-            std::cout << exeName << " is a CATCH host application. Options are as follows:\n\n";
-            showUsage( std::cout );
-        }
-    }
-
-    inline int Main( int argc, char* const argv[], Config& config ) {
-
-        try {
-            CommandParser parser( argc, argv );
-
-            if( Command cmd = Options::HelpOptionParser().find( parser ) ) {
-                if( cmd.argsCount() != 0 )
-                    cmd.raiseError( "Does not accept arguments" );
-
-                showHelp( parser );
-                Catch::cleanUp();
-                return 0;
-            }
-
-            AllOptions options;
-
-            options.parseIntoConfig( parser, config.data() );
-        }
-        catch( std::exception& ex ) {
-            std::cerr << ex.what() << "\n\nUsage: ...\n\n";
-            showUsage( std::cerr );
-            Catch::cleanUp();
-            return (std::numeric_limits<int>::max)();
-        }
-
-        return Main( config );
-    }
-
-    inline int Main( int argc, char* const argv[] ) {
-        Config config;
-// !TBD: This doesn't always work, for some reason
-//        if( isDebuggerActive() )
-//            config.useStream( "debug" );
-        return Main( argc, argv, config );
-    }
-
-} // end namespace Catch
-
-// #included from: catch_registry_hub.hpp
-#define TWOBLUECUBES_CATCH_REGISTRY_HUB_HPP_INCLUDED
-
-// #included from: catch_test_case_registry_impl.hpp
-#define TWOBLUECUBES_CATCH_TEST_CASE_REGISTRY_IMPL_HPP_INCLUDED
-
-#include <vector>
-#include <set>
-#include <sstream>
-#include <iostream>
-
-namespace Catch {
-
-    class TestRegistry : public ITestCaseRegistry {
-    public:
-        TestRegistry() : m_unnamedCount( 0 ) {}
-        virtual ~TestRegistry();
-
-        virtual void registerTest( const TestCaseInfo& testInfo ) {
-            if( testInfo.getName() == "" ) {
-                std::ostringstream oss;
-                oss << testInfo.getName() << "unnamed/" << ++m_unnamedCount;
-                return registerTest( TestCaseInfo( testInfo, oss.str() ) );
-            }
-
-            if( m_functions.find( testInfo ) == m_functions.end() ) {
-                m_functions.insert( testInfo );
-                m_functionsInOrder.push_back( testInfo );
-                if( !testInfo.isHidden() )
-                    m_nonHiddenFunctions.push_back( testInfo );
-            }
-            else {
-                const TestCaseInfo& prev = *m_functions.find( testInfo );
-                std::cerr   << "error: TEST_CASE( \"" << testInfo.getName() << "\" ) already defined.\n"
-                            << "\tFirst seen at " << SourceLineInfo( prev.getLineInfo() ) << "\n"
-                            << "\tRedefined at " << SourceLineInfo( testInfo.getLineInfo() ) << std::endl;
-                exit(1);
-            }
-        }
-
-        virtual const std::vector<TestCaseInfo>& getAllTests() const {
-            return m_functionsInOrder;
-        }
-
-        virtual const std::vector<TestCaseInfo>& getAllNonHiddenTests() const {
-            return m_nonHiddenFunctions;
-        }
-
-        // !TBD deprecated
-        virtual std::vector<TestCaseInfo> getMatchingTestCases( const std::string& rawTestSpec ) const {
-            std::vector<TestCaseInfo> matchingTests;
-            getMatchingTestCases( rawTestSpec, matchingTests );
-            return matchingTests;
-        }
-
-        // !TBD deprecated
-        virtual void getMatchingTestCases( const std::string& rawTestSpec, std::vector<TestCaseInfo>& matchingTestsOut ) const {
-            TestCaseFilter filter( rawTestSpec );
-
-            std::vector<TestCaseInfo>::const_iterator it = m_functionsInOrder.begin();
-            std::vector<TestCaseInfo>::const_iterator itEnd = m_functionsInOrder.end();
-            for(; it != itEnd; ++it ) {
-                if( filter.shouldInclude( *it ) ) {
-                    matchingTestsOut.push_back( *it );
-                }
-            }
-        }
-        virtual void getMatchingTestCases( const TestCaseFilters& filters, std::vector<TestCaseInfo>& matchingTestsOut ) const {
-            std::vector<TestCaseInfo>::const_iterator it = m_functionsInOrder.begin();
-            std::vector<TestCaseInfo>::const_iterator itEnd = m_functionsInOrder.end();
-            // !TBD: replace with algorithm
-            for(; it != itEnd; ++it )
-                if( filters.shouldInclude( *it ) )
-                    matchingTestsOut.push_back( *it );
-        }
-
-    private:
-
-        std::set<TestCaseInfo> m_functions;
-        std::vector<TestCaseInfo> m_functionsInOrder;
-        std::vector<TestCaseInfo> m_nonHiddenFunctions;
-        size_t m_unnamedCount;
-    };
-
-    ///////////////////////////////////////////////////////////////////////////
-
-    class FreeFunctionTestCase : public SharedImpl<ITestCase> {
-    public:
-
-        FreeFunctionTestCase( TestFunction fun ) : m_fun( fun ) {}
-
-        virtual void invoke() const {
-            m_fun();
-        }
-
-    private:
-        virtual ~FreeFunctionTestCase();
-
-        TestFunction m_fun;
-    };
-
-    inline std::string extractClassName( const std::string& classOrQualifiedMethodName ) {
-        std::string className = classOrQualifiedMethodName;
-        if( className[0] == '&' )
-        {
-            std::size_t lastColons = className.rfind( "::" );
-            std::size_t penultimateColons = className.rfind( "::", lastColons-1 );
-            if( penultimateColons == std::string::npos )
-                penultimateColons = 1;
-            className = className.substr( penultimateColons, lastColons-penultimateColons );
-        }
-        return className;
-    }
-
-    ///////////////////////////////////////////////////////////////////////////
-
-    AutoReg::AutoReg(   TestFunction function,
-                        const char* name,
-                        const char* description,
-                        const SourceLineInfo& lineInfo ) {
-        registerTestCase( new FreeFunctionTestCase( function ), "global", name, description, lineInfo );
-    }
-
-    AutoReg::~AutoReg() {}
-
-    void AutoReg::registerTestCase( ITestCase* testCase,
-                                    const char* classOrQualifiedMethodName,
-                                    const char* name,
-                                    const char* description,
-                                    const SourceLineInfo& lineInfo ) {
-
-        getMutableRegistryHub().registerTest( TestCaseInfo( testCase, extractClassName( classOrQualifiedMethodName ), name, description, lineInfo ) );
-    }
-
-} // end namespace Catch
-
-// #included from: catch_reporter_registry.hpp
-#define TWOBLUECUBES_CATCH_REPORTER_REGISTRY_HPP_INCLUDED
-
-#include <map>
-
-namespace Catch {
-
-    class ReporterRegistry : public IReporterRegistry {
-
-    public:
-
-        virtual ~ReporterRegistry() {
-            deleteAllValues( m_factories );
-        }
-
-        virtual IReporter* create( const std::string& name, const ReporterConfig& config ) const {
-            FactoryMap::const_iterator it =  m_factories.find( name );
-            if( it == m_factories.end() )
-                return NULL;
-            return it->second->create( config );
-        }
-
-        void registerReporter( const std::string& name, IReporterFactory* factory ) {
-            m_factories.insert( std::make_pair( name, factory ) );
-        }
-
-        const FactoryMap& getFactories() const {
-            return m_factories;
-        }
-
-    private:
-        FactoryMap m_factories;
-    };
-}
-
-// #included from: catch_exception_translator_registry.hpp
-#define TWOBLUECUBES_CATCH_EXCEPTION_TRANSLATOR_REGISTRY_HPP_INCLUDED
-
-#ifdef __OBJC__
-#import "Foundation/Foundation.h"
-#endif
-
-namespace Catch {
-
-    class ExceptionTranslatorRegistry : public IExceptionTranslatorRegistry {
-    public:
-        ~ExceptionTranslatorRegistry() {
-            deleteAll( m_translators );
-        }
-
-        virtual void registerTranslator( const IExceptionTranslator* translator ) {
-            m_translators.push_back( translator );
-        }
-
-        virtual std::string translateActiveException() const {
-            try {
-#ifdef __OBJC__
-                // In Objective-C try objective-c exceptions first
-                @try {
-                    throw;
-                }
-                @catch (NSException *exception) {
-                    return toString( [exception description] );
-                }
-#else
-                throw;
-#endif
-            }
-            catch( std::exception& ex ) {
-                return ex.what();
-            }
-            catch( std::string& msg ) {
-                return msg;
-            }
-            catch( const char* msg ) {
-                return msg;
-            }
-            catch(...) {
-                return tryTranslators( m_translators.begin() );
-            }
-        }
-
-        std::string tryTranslators( std::vector<const IExceptionTranslator*>::const_iterator it ) const {
-            if( it == m_translators.end() )
-                return "Unknown exception";
-
-            try {
-                return (*it)->translate();
-            }
-            catch(...) {
-                return tryTranslators( it+1 );
-            }
-        }
-
-    private:
-        std::vector<const IExceptionTranslator*> m_translators;
-    };
-}
-
-namespace Catch {
-
-    namespace {
-
-        class RegistryHub : public IRegistryHub, public IMutableRegistryHub {
-
-            RegistryHub( const RegistryHub& );
-            void operator=( const RegistryHub& );
-
-        public: // IRegistryHub
-            RegistryHub() {
-            }
-            virtual const IReporterRegistry& getReporterRegistry() const {
-                return m_reporterRegistry;
-            }
-            virtual const ITestCaseRegistry& getTestCaseRegistry() const {
-                return m_testCaseRegistry;
-            }
-            virtual IExceptionTranslatorRegistry& getExceptionTranslatorRegistry() {
-                return m_exceptionTranslatorRegistry;
-            }
-
-        public: // IMutableRegistryHub
-            virtual void registerReporter( const std::string& name, IReporterFactory* factory ) {
-                m_reporterRegistry.registerReporter( name, factory );
-            }
-            virtual void registerTest( const TestCaseInfo& testInfo ) {
-                m_testCaseRegistry.registerTest( testInfo );
-            }
-            virtual void registerTranslator( const IExceptionTranslator* translator ) {
-                m_exceptionTranslatorRegistry.registerTranslator( translator );
-            }
-
-        private:
-            TestRegistry m_testCaseRegistry;
-            ReporterRegistry m_reporterRegistry;
-            ExceptionTranslatorRegistry m_exceptionTranslatorRegistry;
-        };
-
-        // Single, global, instance
-        inline RegistryHub*& getTheRegistryHub() {
-            static RegistryHub* theRegistryHub = NULL;
-            if( !theRegistryHub )
-                theRegistryHub = new RegistryHub();
-            return theRegistryHub;
-        }
-    }
-
-    IRegistryHub& getRegistryHub() {
-        return *getTheRegistryHub();
-    }
-    IMutableRegistryHub& getMutableRegistryHub() {
-        return *getTheRegistryHub();
-    }
-    void cleanUp() {
-        delete getTheRegistryHub();
-        getTheRegistryHub() = NULL;
-        cleanUpContext();
-    }
-    std::string translateActiveException() {
-        return getRegistryHub().getExceptionTranslatorRegistry().translateActiveException();
-    }
-
-} // end namespace Catch
-
-// #included from: catch_notimplemented_exception.hpp
-#define TWOBLUECUBES_CATCH_NOTIMPLEMENTED_EXCEPTION_HPP_INCLUDED
-
-#include <ostream>
-
-namespace Catch {
-
-    NotImplementedException::NotImplementedException( const SourceLineInfo& lineInfo )
-    :   m_lineInfo( lineInfo ) {
-        std::ostringstream oss;
-        oss << lineInfo << "function ";
-        oss << "not implemented";
-        m_what = oss.str();
-    }
-
-    const char* NotImplementedException::what() const throw() {
-        return m_what.c_str();
-    }
-
-} // end namespace Catch
-
-// #included from: catch_context_impl.hpp
-#define TWOBLUECUBES_CATCH_CONTEXT_IMPL_HPP_INCLUDED
-
-namespace Catch {
-
-    class Context : public IMutableContext {
-
-        Context() : m_config( NULL ) {}
-        Context( const Context& );
-        void operator=( const Context& );
-
-    public: // IContext
-        virtual IResultCapture& getResultCapture() {
-            return *m_resultCapture;
-        }
-        virtual IRunner& getRunner() {
-            return *m_runner;
-        }
-        virtual size_t getGeneratorIndex( const std::string& fileInfo, size_t totalSize ) {
-            return getGeneratorsForCurrentTest()
-            .getGeneratorInfo( fileInfo, totalSize )
-            .getCurrentIndex();
-        }
-        virtual bool advanceGeneratorsForCurrentTest() {
-            IGeneratorsForTest* generators = findGeneratorsForCurrentTest();
-            return generators && generators->moveNext();
-        }
-
-        virtual const IConfig* getConfig() const {
-            return m_config;
-        }
-
-    public: // IMutableContext
-        virtual void setResultCapture( IResultCapture* resultCapture ) {
-            m_resultCapture = resultCapture;
-        }
-        virtual void setRunner( IRunner* runner ) {
-            m_runner = runner;
-        }
-        virtual void setConfig( const IConfig* config ) {
-            m_config = config;
-        }
-
-        friend IMutableContext& getCurrentMutableContext();
-
-    private:
-        IGeneratorsForTest* findGeneratorsForCurrentTest() {
-            std::string testName = getResultCapture().getCurrentTestName();
-
-            std::map<std::string, IGeneratorsForTest*>::const_iterator it =
-            m_generatorsByTestName.find( testName );
-            return it != m_generatorsByTestName.end()
-            ? it->second
-            : NULL;
-        }
-
-        IGeneratorsForTest& getGeneratorsForCurrentTest() {
-            IGeneratorsForTest* generators = findGeneratorsForCurrentTest();
-            if( !generators ) {
-                std::string testName = getResultCapture().getCurrentTestName();
-                generators = createGeneratorsForTest();
-                m_generatorsByTestName.insert( std::make_pair( testName, generators ) );
-            }
-            return *generators;
-        }
-
-    private:
-        IRunner* m_runner;
-        IResultCapture* m_resultCapture;
-        const IConfig* m_config;
-        std::map<std::string, IGeneratorsForTest*> m_generatorsByTestName;
-    };
-
-    namespace {
-        Context* currentContext = NULL;
-    }
-    IMutableContext& getCurrentMutableContext() {
-        if( !currentContext )
-            currentContext = new Context();
-        return *currentContext;
-    }
-    IContext& getCurrentContext() {
-        return getCurrentMutableContext();
-    }
-
-    Stream createStream( const std::string& streamName ) {
-        if( streamName == "stdout" ) return Stream( std::cout.rdbuf(), false );
-        if( streamName == "stderr" ) return Stream( std::cerr.rdbuf(), false );
-        if( streamName == "debug" ) return Stream( new StreamBufImpl<OutputDebugWriter>, true );
-
-        throw std::domain_error( "Unknown stream: " + streamName );
-    }
-
-    void cleanUpContext() {
-        delete currentContext;
-        currentContext = NULL;
-    }
-}
-
-// #included from: catch_console_colour_impl.hpp
-#define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_IMPL_HPP_INCLUDED
-
-// #included from: catch_console_colour.hpp
-#define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_HPP_INCLUDED
-
-namespace Catch {
-
-    struct ConsoleColourImpl;
-
-    class TextColour : NonCopyable {
-    public:
-
-        enum Colours {
-            None,
-
-            FileName,
-            ResultError,
-            ResultSuccess,
-
-            Error,
-            Success,
-
-            OriginalExpression,
-            ReconstructedExpression
-        };
-
-        TextColour( Colours colour = None );
-        void set( Colours colour );
-        ~TextColour();
-
-    private:
-        ConsoleColourImpl* m_impl;
-    };
-
-} // end namespace Catch
-
-#if defined( CATCH_CONFIG_USE_ANSI_COLOUR_CODES )
-
-#include <unistd.h>
-
-namespace Catch {
-
-    // use POSIX/ ANSI console terminal codes
-    // Implementation contributed by Adam Strzelecki (http://github.com/nanoant)
-    // https://github.com/philsquared/Catch/pull/131
-
-    TextColour::TextColour( Colours colour ) {
-        if( colour )
-            set( colour );
-    }
-
-    TextColour::~TextColour() {
-        set( TextColour::None );
-    }
-
-    namespace { const char colourEscape = '\033'; }
-
-    void TextColour::set( Colours colour ) {
-        if( isatty( fileno(stdout) ) ) {
-            switch( colour ) {
-                case TextColour::FileName:
-                    std::cout << colourEscape << "[0m";    // white/ normal
-                    break;
-                case TextColour::ResultError:
-                    std::cout << colourEscape << "[1;31m"; // bold red
-                    break;
-                case TextColour::ResultSuccess:
-                    std::cout << colourEscape << "[1;32m"; // bold green
-                    break;
-                case TextColour::Error:
-                    std::cout << colourEscape << "[0;31m"; // red
-                    break;
-                case TextColour::Success:
-                    std::cout << colourEscape << "[0;32m"; // green
-                    break;
-                case TextColour::OriginalExpression:
-                    std::cout << colourEscape << "[0;36m"; // cyan
-                    break;
-                case TextColour::ReconstructedExpression:
-                    std::cout << colourEscape << "[0;33m"; // yellow
-                    break;
-                case TextColour::None:
-                    std::cout << colourEscape << "[0m"; // reset
-            }
-        }
-    }
-
-} // namespace Catch
-
-#elif defined ( CATCH_PLATFORM_WINDOWS )
-
-#include <windows.h>
-
-namespace Catch {
-
-    namespace {
-
-        WORD mapConsoleColour( TextColour::Colours colour ) {
-            switch( colour ) {
-                case TextColour::FileName:
-                    return FOREGROUND_INTENSITY;                    // greyed out
-                case TextColour::ResultError:
-                    return FOREGROUND_RED | FOREGROUND_INTENSITY;   // bright red
-                case TextColour::ResultSuccess:
-                    return FOREGROUND_GREEN | FOREGROUND_INTENSITY; // bright green
-                case TextColour::Error:
-                    return FOREGROUND_RED;                          // dark red
-                case TextColour::Success:
-                    return FOREGROUND_GREEN;                        // dark green
-                case TextColour::OriginalExpression:
-                    return FOREGROUND_BLUE | FOREGROUND_GREEN;      // turquoise
-                case TextColour::ReconstructedExpression:
-                    return FOREGROUND_RED | FOREGROUND_GREEN;       // greeny-yellow
-                default: return 0;
-            }
-        }
-    }
-
-    struct ConsoleColourImpl {
-
-        ConsoleColourImpl()
-        :   hStdout( GetStdHandle(STD_OUTPUT_HANDLE) ),
-            wOldColorAttrs( 0 )
-        {
-            GetConsoleScreenBufferInfo( hStdout, &csbiInfo );
-            wOldColorAttrs = csbiInfo.wAttributes;
-        }
-
-        ~ConsoleColourImpl() {
-            SetConsoleTextAttribute( hStdout, wOldColorAttrs );
-        }
-
-        void set( TextColour::Colours colour ) {
-            WORD consoleColour = mapConsoleColour( colour );
-            if( consoleColour > 0 )
-                SetConsoleTextAttribute( hStdout, consoleColour );
-        }
-
-        HANDLE hStdout;
-        CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
-        WORD wOldColorAttrs;
-    };
-
-    TextColour::TextColour( Colours colour )
-    : m_impl( new ConsoleColourImpl() )
-    {
-        if( colour )
-            m_impl->set( colour );
-    }
-
-    TextColour::~TextColour() {
-        delete m_impl;
-    }
-
-    void TextColour::set( Colours colour ) {
-        m_impl->set( colour );
-    }
-
-} // end namespace Catch
-
-#else
-
-namespace Catch {
-
-    TextColour::TextColour( Colours ){}
-    TextColour::~TextColour(){}
-    void TextColour::set( Colours ){}
-
-} // end namespace Catch
-
-#endif
-
-// #included from: catch_generators_impl.hpp
-#define TWOBLUECUBES_CATCH_GENERATORS_IMPL_HPP_INCLUDED
-
-#include <vector>
-#include <string>
-#include <map>
-
-namespace Catch {
-
-    struct GeneratorInfo : IGeneratorInfo {
-
-        GeneratorInfo( std::size_t size )
-        :   m_size( size ),
-            m_currentIndex( 0 )
-        {}
-
-        bool moveNext() {
-            if( ++m_currentIndex == m_size ) {
-                m_currentIndex = 0;
-                return false;
-            }
-            return true;
-        }
-
-        std::size_t getCurrentIndex() const {
-            return m_currentIndex;
-        }
-
-        std::size_t m_size;
-        std::size_t m_currentIndex;
-    };
-
-    ///////////////////////////////////////////////////////////////////////////
-
-    class GeneratorsForTest : public IGeneratorsForTest {
-
-    public:
-        ~GeneratorsForTest() {
-            deleteAll( m_generatorsInOrder );
-        }
-
-        IGeneratorInfo& getGeneratorInfo( const std::string& fileInfo, std::size_t size ) {
-            std::map<std::string, IGeneratorInfo*>::const_iterator it = m_generatorsByName.find( fileInfo );
-            if( it == m_generatorsByName.end() ) {
-                IGeneratorInfo* info = new GeneratorInfo( size );
-                m_generatorsByName.insert( std::make_pair( fileInfo, info ) );
-                m_generatorsInOrder.push_back( info );
-                return *info;
-            }
-            return *it->second;
-        }
-
-        bool moveNext() {
-            std::vector<IGeneratorInfo*>::const_iterator it = m_generatorsInOrder.begin();
-            std::vector<IGeneratorInfo*>::const_iterator itEnd = m_generatorsInOrder.end();
-            for(; it != itEnd; ++it ) {
-                if( (*it)->moveNext() )
-                    return true;
-            }
-            return false;
-        }
-
-    private:
-        std::map<std::string, IGeneratorInfo*> m_generatorsByName;
-        std::vector<IGeneratorInfo*> m_generatorsInOrder;
-    };
-
-    IGeneratorsForTest* createGeneratorsForTest()
-    {
-        return new GeneratorsForTest();
-    }
-
-} // end namespace Catch
-
-// #included from: catch_assertionresult.hpp
-#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_HPP_INCLUDED
-
-namespace Catch {
-
-    AssertionInfo::AssertionInfo(   const std::string& _macroName,
-                                    const SourceLineInfo& _lineInfo,
-                                    const std::string& _capturedExpression,
-                                    ResultDisposition::Flags _resultDisposition )
-    :   macroName( _macroName ),
-        lineInfo( _lineInfo ),
-        capturedExpression( _capturedExpression ),
-        resultDisposition( _resultDisposition )
-    {
-        if( shouldNegate( resultDisposition ) )
-            capturedExpression = "!" + _capturedExpression;
-    }
-
-    AssertionResult::AssertionResult() {}
-
-    AssertionResult::AssertionResult( const AssertionInfo& info, const AssertionResultData& data )
-    :   m_info( info ),
-        m_resultData( data )
-    {}
-
-    AssertionResult::~AssertionResult() {}
-
-    // Result was a success
-    bool AssertionResult::succeeded() const {
-        return Catch::isOk( m_resultData.resultType );
-    }
-
-    // Result was a success, or failure is suppressed
-    bool AssertionResult::isOk() const {
-        return Catch::isOk( m_resultData.resultType ) || shouldSuppressFailure( m_info.resultDisposition );
-    }
-
-    ResultWas::OfType AssertionResult::getResultType() const {
-        return m_resultData.resultType;
-    }
-
-    bool AssertionResult::hasExpression() const {
-        return !m_info.capturedExpression.empty();
-    }
-
-    bool AssertionResult::hasMessage() const {
-        return !m_resultData.message.empty();
-    }
-
-    std::string AssertionResult::getExpression() const {
-        return m_info.capturedExpression;
-    }
-
-    bool AssertionResult::hasExpandedExpression() const {
-        return hasExpression() && getExpandedExpression() != getExpression();
-    }
-
-    std::string AssertionResult::getExpandedExpression() const {
-        return m_resultData.reconstructedExpression;
-    }
-
-    std::string AssertionResult::getMessage() const {
-        return m_resultData.message;
-    }
-    SourceLineInfo AssertionResult::getSourceInfo() const {
-        return m_info.lineInfo;
-    }
-
-    std::string AssertionResult::getTestMacroName() const {
-        return m_info.macroName;
-    }
-
-} // end namespace Catch
-
-// #included from: catch_expressionresult_builder.hpp
-#define TWOBLUECUBES_CATCH_EXPRESSIONRESULT_BUILDER_HPP_INCLUDED
-
-#include <assert.h>
-
-namespace Catch {
-
-    ExpressionResultBuilder::ExpressionResultBuilder( ResultWas::OfType resultType ) {
-        m_data.resultType = resultType;
-    }
-    ExpressionResultBuilder::ExpressionResultBuilder( const ExpressionResultBuilder& other )
-    :   m_data( other.m_data ),
-        m_exprComponents( other.m_exprComponents )
-    {
-        m_stream << other.m_stream.str();
-    }
-    ExpressionResultBuilder& ExpressionResultBuilder::operator=(const ExpressionResultBuilder& other ) {
-        m_data = other.m_data;
-        m_exprComponents = other.m_exprComponents;
-        m_stream.str("");
-        m_stream << other.m_stream.str();
-        return *this;
-    }
-    ExpressionResultBuilder& ExpressionResultBuilder::setResultType( ResultWas::OfType result ) {
-        m_data.resultType = result;
-        return *this;
-    }
-    ExpressionResultBuilder& ExpressionResultBuilder::setResultType( bool result ) {
-        m_data.resultType = result ? ResultWas::Ok : ResultWas::ExpressionFailed;
-        return *this;
-    }
-    ExpressionResultBuilder& ExpressionResultBuilder::endExpression( ResultDisposition::Flags resultDisposition ) {
-        m_exprComponents.shouldNegate = shouldNegate( resultDisposition );
-        return *this;
-    }
-    ExpressionResultBuilder& ExpressionResultBuilder::setLhs( const std::string& lhs ) {
-        m_exprComponents.lhs = lhs;
-        return *this;
-    }
-    ExpressionResultBuilder& ExpressionResultBuilder::setRhs( const std::string& rhs ) {
-        m_exprComponents.rhs = rhs;
-        return *this;
-    }
-    ExpressionResultBuilder& ExpressionResultBuilder::setOp( const std::string& op ) {
-        m_exprComponents.op = op;
-        return *this;
-    }
-    AssertionResult ExpressionResultBuilder::buildResult( const AssertionInfo& info ) const
-    {
-        assert( m_data.resultType != ResultWas::Unknown );
-
-        AssertionResultData data = m_data;
-
-        // Flip bool results if shouldNegate is set
-        if( m_exprComponents.shouldNegate && data.resultType == ResultWas::Ok )
-            data.resultType = ResultWas::ExpressionFailed;
-        else if( m_exprComponents.shouldNegate && data.resultType == ResultWas::ExpressionFailed )
-            data.resultType = ResultWas::Ok;
-
-        data.message = m_stream.str();
-        data.reconstructedExpression = reconstructExpression( info );
-        if( m_exprComponents.shouldNegate ) {
-            if( m_exprComponents.op == "" )
-                data.reconstructedExpression = "!" + data.reconstructedExpression;
-            else
-                data.reconstructedExpression = "!(" + data.reconstructedExpression + ")";
-        }
-        return AssertionResult( info, data );
-    }
-    std::string ExpressionResultBuilder::reconstructExpression( const AssertionInfo& info ) const {
-        if( m_exprComponents.op == "" )
-            return m_exprComponents.lhs.empty() ? info.capturedExpression : m_exprComponents.op + m_exprComponents.lhs;
-        else if( m_exprComponents.op == "matches" )
-            return m_exprComponents.lhs + " " + m_exprComponents.rhs;
-        else if( m_exprComponents.op != "!" ) {
-            if( m_exprComponents.lhs.size() + m_exprComponents.rhs.size() < 30 )
-                return m_exprComponents.lhs + " " + m_exprComponents.op + " " + m_exprComponents.rhs;
-            else if( m_exprComponents.lhs.size() < 70 && m_exprComponents.rhs.size() < 70 )
-                return "\n\t" + m_exprComponents.lhs + "\n\t" + m_exprComponents.op + "\n\t" + m_exprComponents.rhs;
-            else
-                return "\n" + m_exprComponents.lhs + "\n" + m_exprComponents.op + "\n" + m_exprComponents.rhs + "\n\n";
-        }
-        else
-            return "{can't expand - use " + info.macroName + "_FALSE( " + info.capturedExpression.substr(1) + " ) instead of " + info.macroName + "( " + info.capturedExpression + " ) for better diagnostics}";
-    }
-
-} // end namespace Catch
-
-// #included from: catch_test_case_info.hpp
-#define TWOBLUECUBES_CATCH_TEST_CASE_INFO_HPP_INCLUDED
-
-namespace Catch {
-
-    TestCaseInfo::TestCaseInfo( ITestCase* testCase,
-                                const std::string& className,
-                                const std::string& name,
-                                const std::string& description,
-                                const SourceLineInfo& lineInfo )
-    :   m_test( testCase ),
-        m_className( className ),
-        m_name( name ),
-        m_description( description ),
-        m_lineInfo( lineInfo ),
-        m_isHidden( startsWith( name, "./" ) )
-    {
-        TagExtracter( m_tags ).parse( m_description );
-        if( hasTag( "hide" ) )
-            m_isHidden = true;
-    }
-
-    TestCaseInfo::TestCaseInfo()
-    :   m_test( NULL ),
-        m_className(),
-        m_name(),
-        m_description(),
-        m_isHidden( false )
-    {}
-
-    TestCaseInfo::TestCaseInfo( const TestCaseInfo& other, const std::string& name )
-    :   m_test( other.m_test ),
-        m_className( other.m_className ),
-        m_name( name ),
-        m_description( other.m_description ),
-        m_tags( other.m_tags ),
-        m_lineInfo( other.m_lineInfo ),
-        m_isHidden( other.m_isHidden )
-    {}
-
-    TestCaseInfo::TestCaseInfo( const TestCaseInfo& other )
-    :   m_test( other.m_test ),
-        m_className( other.m_className ),
-        m_name( other.m_name ),
-        m_description( other.m_description ),
-        m_tags( other.m_tags ),
-        m_lineInfo( other.m_lineInfo ),
-        m_isHidden( other.m_isHidden )
-    {}
-
-    void TestCaseInfo::invoke() const {
-        m_test->invoke();
-    }
-
-    const std::string& TestCaseInfo::getClassName() const {
-        return m_className;
-    }
-    const std::string& TestCaseInfo::getName() const {
-        return m_name;
-    }
-    const std::string& TestCaseInfo::getDescription() const {
-        return m_description;
-    }
-    const SourceLineInfo& TestCaseInfo::getLineInfo() const {
-        return m_lineInfo;
-    }
-
-    bool TestCaseInfo::isHidden() const {
-        return m_isHidden;
-    }
-
-    bool TestCaseInfo::hasTag( const std::string& tag ) const {
-        return m_tags.find( tag ) != m_tags.end();
-    }
-    bool TestCaseInfo::matchesTags( const std::string& tagPattern ) const {
-        TagExpression exp;
-        TagExpressionParser( exp ).parse( tagPattern );
-        return exp.matches( m_tags );
-    }
-    const std::set<std::string>& TestCaseInfo::getTags() const {
-        return m_tags;
-    }
-
-    void TestCaseInfo::swap( TestCaseInfo& other ) {
-        m_test.swap( other.m_test );
-        m_className.swap( other.m_className );
-        m_name.swap( other.m_name );
-        m_description.swap( other.m_description );
-        std::swap( m_lineInfo, other.m_lineInfo );
-    }
-
-    bool TestCaseInfo::operator == ( const TestCaseInfo& other ) const {
-        return  m_test.get() == other.m_test.get() &&
-                m_name == other.m_name &&
-                m_className == other.m_className;
-    }
-
-    bool TestCaseInfo::operator < ( const TestCaseInfo& other ) const {
-        return m_name < other.m_name;
-    }
-    TestCaseInfo& TestCaseInfo::operator = ( const TestCaseInfo& other ) {
-        TestCaseInfo temp( other );
-        swap( temp );
-        return *this;
-    }
-
-} // end namespace Catch
-
-// #included from: ../reporters/catch_reporter_basic.hpp
-#define TWOBLUECUBES_CATCH_REPORTER_BASIC_HPP_INCLUDED
-
-// #included from: ../internal/catch_reporter_registrars.hpp
-#define TWOBLUECUBES_CATCH_REPORTER_REGISTRARS_HPP_INCLUDED
-
-namespace Catch {
-
-    template<typename T>
-    class ReporterRegistrar {
-
-        class ReporterFactory : public IReporterFactory {
-
-            virtual IReporter* create( const ReporterConfig& config ) const {
-                return new T( config );
-            }
-
-            virtual std::string getDescription() const {
-                return T::getDescription();
-            }
-        };
-
-    public:
-
-        ReporterRegistrar( const std::string& name ) {
-            getMutableRegistryHub().registerReporter( name, new ReporterFactory() );
-        }
-    };
-}
-
-#define INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) \
-    Catch::ReporterRegistrar<reporterType> catch_internal_RegistrarFor##reporterType( name );
-
-namespace Catch {
-
-    class BasicReporter : public SharedImpl<IReporter> {
-
-        struct SpanInfo {
-
-            SpanInfo()
-            :   emitted( false )
-            {}
-
-            SpanInfo( const std::string& spanName )
-            :   name( spanName ),
-                emitted( false )
-            {}
-
-            SpanInfo( const SpanInfo& other )
-            :   name( other.name ),
-                emitted( other.emitted )
-            {}
-
-            std::string name;
-            bool emitted;
-        };
-
-    public:
-        BasicReporter( const ReporterConfig& config )
-        :   m_config( config ),
-            m_firstSectionInTestCase( true ),
-            m_aborted( false )
-        {}
-
-        virtual ~BasicReporter();
-
-        static std::string getDescription() {
-            return "Reports test results as lines of text";
-        }
-
-    private:
-
-        void ReportCounts( const std::string& label, const Counts& counts, const std::string& allPrefix = "All " ) {
-            if( counts.passed )
-                m_config.stream << counts.failed << " of " << counts.total() << " " << label << "s failed";
-            else
-                m_config.stream << ( counts.failed > 1 ? allPrefix : "" ) << pluralise( counts.failed, label ) << " failed";
-        }
-
-        void ReportCounts( const Totals& totals, const std::string& allPrefix = "All " ) {
-            if( totals.assertions.total() == 0 ) {
-                m_config.stream << "No tests ran";
-            }
-            else if( totals.assertions.failed ) {
-                TextColour colour( TextColour::ResultError );
-                ReportCounts( "test case", totals.testCases, allPrefix );
-                if( totals.testCases.failed > 0 ) {
-                    m_config.stream << " (";
-                    ReportCounts( "assertion", totals.assertions, allPrefix );
-                    m_config.stream << ")";
-                }
-            }
-            else {
-                TextColour colour( TextColour::ResultSuccess );
-                m_config.stream   << allPrefix << "tests passed ("
-                                    << pluralise( totals.assertions.passed, "assertion" ) << " in "
-                                    << pluralise( totals.testCases.passed, "test case" ) << ")";
-            }
-        }
-
-    private: // IReporter
-
-        virtual bool shouldRedirectStdout() const {
-            return false;
-        }
-
-        virtual void StartTesting() {
-            m_testingSpan = SpanInfo();
-        }
-
-        virtual void Aborted() {
-            m_aborted = true;
-        }
-
-        virtual void EndTesting( const Totals& totals ) {
-            // Output the overall test results even if "Started Testing" was not emitted
-            if( m_aborted ) {
-                m_config.stream << "\n[Testing aborted. ";
-                ReportCounts( totals, "The first " );
-            }
-            else {
-                m_config.stream << "\n[Testing completed. ";
-                ReportCounts( totals );
-            }
-            m_config.stream << "]\n" << std::endl;
-        }
-
-        virtual void StartGroup( const std::string& groupName ) {
-            m_groupSpan = groupName;
-        }
-
-        virtual void EndGroup( const std::string& groupName, const Totals& totals ) {
-            if( m_groupSpan.emitted && !groupName.empty() ) {
-                m_config.stream << "[End of group: '" << groupName << "'. ";
-                ReportCounts( totals );
-                m_config.stream << "]\n" << std::endl;
-                m_groupSpan = SpanInfo();
-            }
-        }
-
-        virtual void StartTestCase( const TestCaseInfo& testInfo ) {
-            m_testSpan = testInfo.getName();
-        }
-
-        virtual void StartSection( const std::string& sectionName, const std::string& ) {
-            m_sectionSpans.push_back( SpanInfo( sectionName ) );
-        }
-
-        virtual void NoAssertionsInSection( const std::string& sectionName ) {
-            startSpansLazily();
-            TextColour colour( TextColour::ResultError );
-            m_config.stream << "\nNo assertions in section, '" << sectionName << "'\n" << std::endl;
-        }
-        virtual void NoAssertionsInTestCase( const std::string& testName ) {
-            startSpansLazily();
-            TextColour colour( TextColour::ResultError );
-            m_config.stream << "\nNo assertions in test case, '" << testName << "'\n" << std::endl;
-        }
-
-        virtual void EndSection( const std::string& sectionName, const Counts& assertions ) {
-
-            SpanInfo& sectionSpan = m_sectionSpans.back();
-            if( sectionSpan.emitted && !sectionSpan.name.empty() ) {
-                m_config.stream << "[End of section: '" << sectionName << "' ";
-
-                if( assertions.failed ) {
-                    TextColour colour( TextColour::ResultError );
-                    ReportCounts( "assertion", assertions);
-                }
-                else {
-                    TextColour colour( TextColour::ResultSuccess );
-                    m_config.stream   << ( assertions.passed > 1 ? "All " : "" )
-                                        << pluralise( assertions.passed, "assertion" ) << " passed" ;
-                }
-                m_config.stream << "]\n" << std::endl;
-            }
-            m_sectionSpans.pop_back();
-        }
-
-        virtual void Result( const AssertionResult& assertionResult ) {
-            if( !m_config.includeSuccessfulResults && assertionResult.getResultType() == ResultWas::Ok )
-                return;
-
-            startSpansLazily();
-
-            if( !assertionResult.getSourceInfo().empty() ) {
-                TextColour colour( TextColour::FileName );
-                m_config.stream << assertionResult.getSourceInfo();
-            }
-
-            if( assertionResult.hasExpression() ) {
-                TextColour colour( TextColour::OriginalExpression );
-                m_config.stream << assertionResult.getExpression();
-                if( assertionResult.succeeded() ) {
-                    TextColour successColour( TextColour::Success );
-                    m_config.stream << " succeeded";
-                }
-                else {
-                    TextColour errorColour( TextColour::Error );
-                    m_config.stream << " failed";
-                    if( assertionResult.isOk() ) {
-                        TextColour okAnywayColour( TextColour::Success );
-                        m_config.stream << " - but was ok";
-                    }
-                }
-            }
-            switch( assertionResult.getResultType() ) {
-                case ResultWas::ThrewException:
-                    {
-                        TextColour colour( TextColour::Error );
-                        if( assertionResult.hasExpression() )
-                            m_config.stream << " with unexpected";
-                        else
-                            m_config.stream << "Unexpected";
-                        m_config.stream << " exception with message: '" << assertionResult.getMessage() << "'";
-                    }
-                    break;
-                case ResultWas::DidntThrowException:
-                    {
-                        TextColour colour( TextColour::Error );
-                        if( assertionResult.hasExpression() )
-                            m_config.stream << " because no exception was thrown where one was expected";
-                        else
-                            m_config.stream << "No exception thrown where one was expected";
-                    }
-                    break;
-                case ResultWas::Info:
-                    {
-                        TextColour colour( TextColour::ReconstructedExpression );
-                        streamVariableLengthText( "info", assertionResult.getMessage() );
-                    }
-                    break;
-                case ResultWas::Warning:
-                    {
-                        TextColour colour( TextColour::ReconstructedExpression );
-                        streamVariableLengthText( "warning", assertionResult.getMessage() );
-                    }
-                    break;
-                case ResultWas::ExplicitFailure:
-                    {
-                        TextColour colour( TextColour::Error );
-                        m_config.stream << "failed with message: '" << assertionResult.getMessage() << "'";
-                    }
-                    break;
-                case ResultWas::Unknown: // These cases are here to prevent compiler warnings
-                case ResultWas::Ok:
-                case ResultWas::FailureBit:
-                case ResultWas::ExpressionFailed:
-                case ResultWas::Exception:
-                    if( !assertionResult.hasExpression() ) {
-                        if( assertionResult.succeeded() ) {
-                            TextColour colour( TextColour::Success );
-                            m_config.stream << " succeeded";
-                        }
-                        else {
-                            TextColour colour( TextColour::Error );
-                            m_config.stream << " failed";
-                            if( assertionResult.isOk() ) {
-                                TextColour okAnywayColour( TextColour::Success );
-                                m_config.stream << " - but was ok";
-                            }
-                        }
-                    }
-                    break;
-            }
-
-            if( assertionResult.hasExpandedExpression() ) {
-                m_config.stream << " for: ";
-                if( assertionResult.getExpandedExpression().size() > 40 ) {
-                    m_config.stream << "\n";
-                    if( assertionResult.getExpandedExpression().size() < 70 )
-                        m_config.stream << "\t";
-                }
-                TextColour colour( TextColour::ReconstructedExpression );
-                m_config.stream << assertionResult.getExpandedExpression();
-            }
-            m_config.stream << std::endl;
-        }
-
-        virtual void EndTestCase(   const TestCaseInfo& testInfo,
-                                    const Totals& totals,
-                                    const std::string& stdOut,
-                                    const std::string& stdErr ) {
-            if( !stdOut.empty() ) {
-                startSpansLazily();
-                streamVariableLengthText( "stdout", stdOut );
-            }
-
-            if( !stdErr.empty() ) {
-                startSpansLazily();
-                streamVariableLengthText( "stderr", stdErr );
-            }
-
-            if( m_testSpan.emitted ) {
-                m_config.stream << "[Finished: '" << testInfo.getName() << "' ";
-                ReportCounts( totals );
-                m_config.stream << "]" << std::endl;
-            }
-        }
-
-    private: // helpers
-
-        void startSpansLazily() {
-            if( !m_testingSpan.emitted ) {
-                if( m_config.name.empty() )
-                    m_config.stream << "[Started testing]" << std::endl;
-                else
-                    m_config.stream << "[Started testing: " << m_config.name << "]" << std::endl;
-                m_testingSpan.emitted = true;
-            }
-
-            if( !m_groupSpan.emitted && !m_groupSpan.name.empty() ) {
-                m_config.stream << "[Started group: '" << m_groupSpan.name << "']" << std::endl;
-                m_groupSpan.emitted = true;
-            }
-
-            if( !m_testSpan.emitted ) {
-                m_config.stream << std::endl << "[Running: " << m_testSpan.name << "]" << std::endl;
-                m_testSpan.emitted = true;
-            }
-
-            if( !m_sectionSpans.empty() ) {
-                SpanInfo& sectionSpan = m_sectionSpans.back();
-                if( !sectionSpan.emitted && !sectionSpan.name.empty() ) {
-                    if( m_firstSectionInTestCase ) {
-                        m_config.stream << "\n";
-                        m_firstSectionInTestCase = false;
-                    }
-                    std::vector<SpanInfo>::iterator it = m_sectionSpans.begin();
-                    std::vector<SpanInfo>::iterator itEnd = m_sectionSpans.end();
-                    for(; it != itEnd; ++it ) {
-                        SpanInfo& prevSpan = *it;
-                        if( !prevSpan.emitted && !prevSpan.name.empty() ) {
-                            m_config.stream << "[Started section: '" << prevSpan.name << "']" << std::endl;
-                            prevSpan.emitted = true;
-                        }
-                    }
-                }
-            }
-        }
-
-        void streamVariableLengthText( const std::string& prefix, const std::string& text ) {
-            std::string trimmed = trim( text );
-            if( trimmed.find_first_of( "\r\n" ) == std::string::npos ) {
-                m_config.stream << "[" << prefix << ": " << trimmed << "]";
-            }
-            else {
-                m_config.stream << "\n[" << prefix << "] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n" << trimmed
-                << "\n[end of " << prefix << "] <<<<<<<<<<<<<<<<<<<<<<<<\n";
-            }
-        }
-
-    private:
-        ReporterConfig m_config;
-        bool m_firstSectionInTestCase;
-
-        SpanInfo m_testingSpan;
-        SpanInfo m_groupSpan;
-        SpanInfo m_testSpan;
-        std::vector<SpanInfo> m_sectionSpans;
-        bool m_aborted;
-    };
-
-} // end namespace Catch
-
-// #included from: ../reporters/catch_reporter_xml.hpp
-#define TWOBLUECUBES_CATCH_REPORTER_XML_HPP_INCLUDED
-
-// #included from: ../internal/catch_xmlwriter.hpp
-#define TWOBLUECUBES_CATCH_XMLWRITER_HPP_INCLUDED
-
-#include <sstream>
-#include <iostream>
-#include <string>
-#include <vector>
-
-namespace Catch {
-
-    class XmlWriter {
-    public:
-
-        class ScopedElement {
-        public:
-            ScopedElement( XmlWriter* writer )
-            :   m_writer( writer )
-            {}
-
-            ScopedElement( const ScopedElement& other )
-            :   m_writer( other.m_writer ){
-                other.m_writer = NULL;
-            }
-
-            ~ScopedElement() {
-                if( m_writer )
-                    m_writer->endElement();
-            }
-
-            ScopedElement& writeText( const std::string& text ) {
-                m_writer->writeText( text );
-                return *this;
-            }
-
-            template<typename T>
-            ScopedElement& writeAttribute( const std::string& name, const T& attribute ) {
-                m_writer->writeAttribute( name, attribute );
-                return *this;
-            }
-
-        private:
-            mutable XmlWriter* m_writer;
-        };
-
-        XmlWriter()
-        :   m_tagIsOpen( false ),
-            m_needsNewline( false ),
-            m_os( &std::cout )
-        {}
-
-        XmlWriter( std::ostream& os )
-        :   m_tagIsOpen( false ),
-            m_needsNewline( false ),
-            m_os( &os )
-        {}
-
-        ~XmlWriter() {
-            while( !m_tags.empty() )
-                endElement();
-        }
-
-        XmlWriter& operator = ( const XmlWriter& other ) {
-            XmlWriter temp( other );
-            swap( temp );
-            return *this;
-        }
-
-        void swap( XmlWriter& other ) {
-            std::swap( m_tagIsOpen, other.m_tagIsOpen );
-            std::swap( m_needsNewline, other.m_needsNewline );
-            std::swap( m_tags, other.m_tags );
-            std::swap( m_indent, other.m_indent );
-            std::swap( m_os, other.m_os );
-        }
-
-        XmlWriter& startElement( const std::string& name ) {
-            ensureTagClosed();
-            newlineIfNecessary();
-            stream() << m_indent << "<" << name;
-            m_tags.push_back( name );
-            m_indent += "  ";
-            m_tagIsOpen = true;
-            return *this;
-        }
-
-        ScopedElement scopedElement( const std::string& name ) {
-            ScopedElement scoped( this );
-            startElement( name );
-            return scoped;
-        }
-
-        XmlWriter& endElement() {
-            newlineIfNecessary();
-            m_indent = m_indent.substr( 0, m_indent.size()-2 );
-            if( m_tagIsOpen ) {
-                stream() << "/>\n";
-                m_tagIsOpen = false;
-            }
-            else {
-                stream() << m_indent << "</" << m_tags.back() << ">\n";
-            }
-            m_tags.pop_back();
-            return *this;
-        }
-
-        XmlWriter& writeAttribute( const std::string& name, const std::string& attribute ) {
-            if( !name.empty() && !attribute.empty() ) {
-                stream() << " " << name << "=\"";
-                writeEncodedText( attribute );
-                stream() << "\"";
-            }
-            return *this;
-        }
-
-        XmlWriter& writeAttribute( const std::string& name, bool attribute ) {
-            stream() << " " << name << "=\"" << ( attribute ? "true" : "false" ) << "\"";
-            return *this;
-        }
-
-        template<typename T>
-        XmlWriter& writeAttribute( const std::string& name, const T& attribute ) {
-            if( !name.empty() )
-                stream() << " " << name << "=\"" << attribute << "\"";
-            return *this;
-        }
-
-        XmlWriter& writeText( const std::string& text ) {
-            if( !text.empty() ){
-                bool tagWasOpen = m_tagIsOpen;
-                ensureTagClosed();
-                if( tagWasOpen )
-                    stream() << m_indent;
-                writeEncodedText( text );
-                m_needsNewline = true;
-            }
-            return *this;
-        }
-
-        XmlWriter& writeComment( const std::string& text ) {
-            ensureTagClosed();
-            stream() << m_indent << "<!--" << text << "-->";
-            m_needsNewline = true;
-            return *this;
-        }
-
-        XmlWriter& writeBlankLine() {
-            ensureTagClosed();
-            stream() << "\n";
-            return *this;
-        }
-
-    private:
-
-        std::ostream& stream() {
-            return *m_os;
-        }
-
-        void ensureTagClosed() {
-            if( m_tagIsOpen ) {
-                stream() << ">\n";
-                m_tagIsOpen = false;
-            }
-        }
-
-        void newlineIfNecessary() {
-            if( m_needsNewline ) {
-                stream() << "\n";
-                m_needsNewline = false;
-            }
-        }
-
-        void writeEncodedText( const std::string& text ) {
-            static const char* charsToEncode = "<&\"";
-            std::string mtext = text;
-            std::string::size_type pos = mtext.find_first_of( charsToEncode );
-            while( pos != std::string::npos ) {
-                stream() << mtext.substr( 0, pos );
-
-                switch( mtext[pos] ) {
-                    case '<':
-                        stream() << "&lt;";
-                        break;
-                    case '&':
-                        stream() << "&amp;";
-                        break;
-                    case '\"':
-                        stream() << "&quot;";
-                        break;
-                }
-                mtext = mtext.substr( pos+1 );
-                pos = mtext.find_first_of( charsToEncode );
-            }
-            stream() << mtext;
-        }
-
-        bool m_tagIsOpen;
-        bool m_needsNewline;
-        std::vector<std::string> m_tags;
-        std::string m_indent;
-        std::ostream* m_os;
-    };
-
-}
-namespace Catch {
-    class XmlReporter : public SharedImpl<IReporter> {
-    public:
-        XmlReporter( const ReporterConfig& config ) : m_config( config ) {}
-
-        static std::string getDescription() {
-            return "Reports test results as an XML document";
-        }
-        virtual ~XmlReporter();
-
-    private: // IReporter
-
-        virtual bool shouldRedirectStdout() const {
-            return true;
-        }
-
-        virtual void StartTesting() {
-            m_xml = XmlWriter( m_config.stream );
-            m_xml.startElement( "Catch" );
-            if( !m_config.name.empty() )
-                m_xml.writeAttribute( "name", m_config.name );
-        }
-
-        virtual void EndTesting( const Totals& totals ) {
-            m_xml.scopedElement( "OverallResults" )
-                .writeAttribute( "successes", totals.assertions.passed )
-                .writeAttribute( "failures", totals.assertions.failed );
-            m_xml.endElement();
-        }
-
-        virtual void StartGroup( const std::string& groupName ) {
-            m_xml.startElement( "Group" )
-                .writeAttribute( "name", groupName );
-        }
-
-        virtual void EndGroup( const std::string&, const Totals& totals ) {
-            m_xml.scopedElement( "OverallResults" )
-                .writeAttribute( "successes", totals.assertions.passed )
-                .writeAttribute( "failures", totals.assertions.failed );
-            m_xml.endElement();
-        }
-
-        virtual void StartSection( const std::string& sectionName, const std::string& description ) {
-            m_xml.startElement( "Section" )
-                .writeAttribute( "name", sectionName )
-                .writeAttribute( "description", description );
-        }
-        virtual void NoAssertionsInSection( const std::string& ) {}
-        virtual void NoAssertionsInTestCase( const std::string& ) {}
-
-        virtual void EndSection( const std::string& /*sectionName*/, const Counts& assertions ) {
-            m_xml.scopedElement( "OverallResults" )
-                .writeAttribute( "successes", assertions.passed )
-                .writeAttribute( "failures", assertions.failed );
-            m_xml.endElement();
-        }
-
-        virtual void StartTestCase( const Catch::TestCaseInfo& testInfo ) {
-            m_xml.startElement( "TestCase" ).writeAttribute( "name", testInfo.getName() );
-            m_currentTestSuccess = true;
-        }
-
-        virtual void Result( const Catch::AssertionResult& assertionResult ) {
-            if( !m_config.includeSuccessfulResults && assertionResult.getResultType() == ResultWas::Ok )
-                return;
-
-            if( assertionResult.hasExpression() ) {
-                m_xml.startElement( "Expression" )
-                    .writeAttribute( "success", assertionResult.succeeded() )
-                    .writeAttribute( "filename", assertionResult.getSourceInfo().file )
-                    .writeAttribute( "line", assertionResult.getSourceInfo().line );
-
-                m_xml.scopedElement( "Original" )
-                    .writeText( assertionResult.getExpression() );
-                m_xml.scopedElement( "Expanded" )
-                    .writeText( assertionResult.getExpandedExpression() );
-                m_currentTestSuccess &= assertionResult.succeeded();
-            }
-
-            switch( assertionResult.getResultType() ) {
-                case ResultWas::ThrewException:
-                    m_xml.scopedElement( "Exception" )
-                        .writeAttribute( "filename", assertionResult.getSourceInfo().file )
-                        .writeAttribute( "line", assertionResult.getSourceInfo().line )
-                        .writeText( assertionResult.getMessage() );
-                    m_currentTestSuccess = false;
-                    break;
-                case ResultWas::Info:
-                    m_xml.scopedElement( "Info" )
-                        .writeText( assertionResult.getMessage() );
-                    break;
-                case ResultWas::Warning:
-                    m_xml.scopedElement( "Warning" )
-                        .writeText( assertionResult.getMessage() );
-                    break;
-                case ResultWas::ExplicitFailure:
-                    m_xml.scopedElement( "Failure" )
-                        .writeText( assertionResult.getMessage() );
-                    m_currentTestSuccess = false;
-                    break;
-                case ResultWas::Unknown:
-                case ResultWas::Ok:
-                case ResultWas::FailureBit:
-                case ResultWas::ExpressionFailed:
-                case ResultWas::Exception:
-                case ResultWas::DidntThrowException:
-                    break;
-            }
-            if( assertionResult.hasExpression() )
-                m_xml.endElement();
-        }
-
-        virtual void Aborted() {
-            // !TBD
-        }
-
-        virtual void EndTestCase( const Catch::TestCaseInfo&, const Totals&, const std::string&, const std::string& ) {
-            m_xml.scopedElement( "OverallResult" ).writeAttribute( "success", m_currentTestSuccess );
-            m_xml.endElement();
-        }
-
-    private:
-        ReporterConfig m_config;
-        bool m_currentTestSuccess;
-        XmlWriter m_xml;
-    };
-
-} // end namespace Catch
-
-// #included from: ../reporters/catch_reporter_junit.hpp
-#define TWOBLUECUBES_CATCH_REPORTER_JUNIT_HPP_INCLUDED
-
-namespace Catch {
-
-    class JunitReporter : public SharedImpl<IReporter> {
-
-        struct TestStats {
-            std::string m_element;
-            std::string m_resultType;
-            std::string m_message;
-            std::string m_content;
-        };
-
-        struct TestCaseStats {
-
-            TestCaseStats( const std::string& className, const std::string& name )
-            :   m_className( className ),
-                m_name( name )
-            {}
-
-            double      m_timeInSeconds;
-            std::string m_status;
-            std::string m_className;
-            std::string m_name;
-            std::vector<TestStats> m_testStats;
-        };
-
-        struct Stats {
-
-            Stats( const std::string& name = std::string() )
-            :   m_testsCount( 0 ),
-                m_failuresCount( 0 ),
-                m_disabledCount( 0 ),
-                m_errorsCount( 0 ),
-                m_timeInSeconds( 0 ),
-                m_name( name )
-            {}
-
-            std::size_t m_testsCount;
-            std::size_t m_failuresCount;
-            std::size_t m_disabledCount;
-            std::size_t m_errorsCount;
-            double      m_timeInSeconds;
-            std::string m_name;
-
-            std::vector<TestCaseStats> m_testCaseStats;
-        };
-
-    public:
-        JunitReporter( const ReporterConfig& config )
-        :   m_config( config ),
-            m_testSuiteStats( "AllTests" ),
-            m_currentStats( &m_testSuiteStats )
-        {}
-        virtual ~JunitReporter();
-
-        static std::string getDescription() {
-            return "Reports test results in an XML format that looks like Ant's junitreport target";
-        }
-
-    private: // IReporter
-
-        virtual bool shouldRedirectStdout() const {
-            return true;
-        }
-
-        virtual void StartTesting(){}
-
-        virtual void StartGroup( const std::string& groupName ) {
-            m_statsForSuites.push_back( Stats( groupName ) );
-            m_currentStats = &m_statsForSuites.back();
-        }
-
-        virtual void EndGroup( const std::string&, const Totals& totals ) {
-            m_currentStats->m_testsCount = totals.assertions.total();
-            m_currentStats = &m_testSuiteStats;
-        }
-
-        virtual void StartSection( const std::string&, const std::string& ){}
-
-        virtual void NoAssertionsInSection( const std::string& ) {}
-        virtual void NoAssertionsInTestCase( const std::string& ) {}
-
-        virtual void EndSection( const std::string&, const Counts& ) {}
-
-        virtual void StartTestCase( const Catch::TestCaseInfo& testInfo ) {
-            m_currentStats->m_testCaseStats.push_back( TestCaseStats( testInfo.getClassName(), testInfo.getName() ) );
-        }
-
-        virtual void Result( const Catch::AssertionResult& assertionResult ) {
-            if( assertionResult.getResultType() != ResultWas::Ok || m_config.includeSuccessfulResults ) {
-                TestCaseStats& testCaseStats = m_currentStats->m_testCaseStats.back();
-                TestStats stats;
-                std::ostringstream oss;
-                if( !assertionResult.getMessage().empty() )
-                    oss << assertionResult.getMessage() << " at ";
-                oss << assertionResult.getSourceInfo();
-                stats.m_content = oss.str();
-                stats.m_message = assertionResult.getExpandedExpression();
-                stats.m_resultType = assertionResult.getTestMacroName();
-
-                switch( assertionResult.getResultType() ) {
-                    case ResultWas::ThrewException:
-                        stats.m_element = "error";
-                        m_currentStats->m_errorsCount++;
-                        break;
-                    case ResultWas::Info:
-                        stats.m_element = "info"; // !TBD ?
-                        break;
-                    case ResultWas::Warning:
-                        stats.m_element = "warning"; // !TBD ?
-                        break;
-                    case ResultWas::ExplicitFailure:
-                        stats.m_element = "failure";
-                        m_currentStats->m_failuresCount++;
-                        break;
-                    case ResultWas::ExpressionFailed:
-                        stats.m_element = "failure";
-                        m_currentStats->m_failuresCount++;
-                        break;
-                    case ResultWas::Ok:
-                        stats.m_element = "success";
-                        break;
-                    case ResultWas::Unknown:
-                    case ResultWas::FailureBit:
-                    case ResultWas::Exception:
-                    case ResultWas::DidntThrowException:
-                        break;
-                }
-                testCaseStats.m_testStats.push_back( stats );
-            }
-        }
-
-        virtual void EndTestCase( const Catch::TestCaseInfo&, const Totals&, const std::string& stdOut, const std::string& stdErr ) {
-            if( !stdOut.empty() )
-                m_stdOut << stdOut << "\n";
-            if( !stdErr.empty() )
-                m_stdErr << stdErr << "\n";
-        }
-
-        virtual void Aborted() {
-            // !TBD
-        }
-
-        virtual void EndTesting( const Totals& ) {
-            std::ostream& str = m_config.stream;
-            {
-                XmlWriter xml( str );
-
-                if( m_statsForSuites.size() > 0 )
-                    xml.startElement( "testsuites" );
-
-                std::vector<Stats>::const_iterator it = m_statsForSuites.begin();
-                std::vector<Stats>::const_iterator itEnd = m_statsForSuites.end();
-
-                for(; it != itEnd; ++it ) {
-                    XmlWriter::ScopedElement e = xml.scopedElement( "testsuite" );
-                    xml.writeAttribute( "name", it->m_name );
-                    xml.writeAttribute( "errors", it->m_errorsCount );
-                    xml.writeAttribute( "failures", it->m_failuresCount );
-                    xml.writeAttribute( "tests", it->m_testsCount );
-                    xml.writeAttribute( "hostname", "tbd" );
-                    xml.writeAttribute( "time", "tbd" );
-                    xml.writeAttribute( "timestamp", "tbd" );
-
-                    OutputTestCases( xml, *it );
-                }
-
-                xml.scopedElement( "system-out" ).writeText( trim( m_stdOut.str() ) );
-                xml.scopedElement( "system-err" ).writeText( trim( m_stdErr.str() ) );
-            }
-        }
-
-        void OutputTestCases( XmlWriter& xml, const Stats& stats ) {
-            std::vector<TestCaseStats>::const_iterator it = stats.m_testCaseStats.begin();
-            std::vector<TestCaseStats>::const_iterator itEnd = stats.m_testCaseStats.end();
-            for(; it != itEnd; ++it ) {
-                xml.writeBlankLine();
-                xml.writeComment( "Test case" );
-
-                XmlWriter::ScopedElement e = xml.scopedElement( "testcase" );
-                xml.writeAttribute( "classname", it->m_className );
-                xml.writeAttribute( "name", it->m_name );
-                xml.writeAttribute( "time", "tbd" );
-
-                OutputTestResult( xml, *it );
-            }
-        }
-
-        void OutputTestResult( XmlWriter& xml, const TestCaseStats& stats ) {
-            std::vector<TestStats>::const_iterator it = stats.m_testStats.begin();
-            std::vector<TestStats>::const_iterator itEnd = stats.m_testStats.end();
-            for(; it != itEnd; ++it ) {
-                if( it->m_element != "success" ) {
-                    XmlWriter::ScopedElement e = xml.scopedElement( it->m_element );
-
-                    xml.writeAttribute( "message", it->m_message );
-                    xml.writeAttribute( "type", it->m_resultType );
-                    if( !it->m_content.empty() )
-                        xml.writeText( it->m_content );
-                }
-            }
-        }
-
-    private:
-        ReporterConfig m_config;
-        bool m_currentTestSuccess;
-
-        Stats m_testSuiteStats;
-        Stats* m_currentStats;
-        std::vector<Stats> m_statsForSuites;
-        std::ostringstream m_stdOut;
-        std::ostringstream m_stdErr;
-    };
-
-} // end namespace Catch
-
-namespace Catch {
-    NonCopyable::~NonCopyable() {}
-    IShared::~IShared() {}
-    StreamBufBase::~StreamBufBase() {}
-    IContext::~IContext() {}
-    IResultCapture::~IResultCapture() {}
-    ITestCase::~ITestCase() {}
-    ITestCaseRegistry::~ITestCaseRegistry() {}
-    IRegistryHub::~IRegistryHub() {}
-    IMutableRegistryHub::~IMutableRegistryHub() {}
-    IExceptionTranslator::~IExceptionTranslator() {}
-    IExceptionTranslatorRegistry::~IExceptionTranslatorRegistry() {}
-    IReporter::~IReporter() {}
-    IReporterFactory::~IReporterFactory() {}
-    IReporterRegistry::~IReporterRegistry() {}
-    BasicReporter::~BasicReporter() {}
-    IRunner::~IRunner() {}
-    IMutableContext::~IMutableContext() {}
-    IConfig::~IConfig() {}
-    XmlReporter::~XmlReporter() {}
-    JunitReporter::~JunitReporter() {}
-    TestRegistry::~TestRegistry() {}
-    FreeFunctionTestCase::~FreeFunctionTestCase() {}
-    IGeneratorInfo::~IGeneratorInfo() {}
-    IGeneratorsForTest::~IGeneratorsForTest() {}
-    TagParser::~TagParser() {}
-    TagExtracter::~TagExtracter() {}
-    TagExpressionParser::~TagExpressionParser() {}
-
-    Matchers::Impl::StdString::Equals::~Equals() {}
-    Matchers::Impl::StdString::Contains::~Contains() {}
-    Matchers::Impl::StdString::StartsWith::~StartsWith() {}
-    Matchers::Impl::StdString::EndsWith::~EndsWith() {}
-
-    void Config::dummy() {}
-
-    INTERNAL_CATCH_REGISTER_REPORTER( "basic", BasicReporter )
-    INTERNAL_CATCH_REGISTER_REPORTER( "xml", XmlReporter )
-    INTERNAL_CATCH_REGISTER_REPORTER( "junit", JunitReporter )
-
-}
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-#endif
-
-#ifdef CATCH_CONFIG_MAIN
-// #included from: internal/catch_default_main.hpp
-#define TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED
-
-#ifndef __OBJC__
-
-// Standard C/C++ main entry point
-int main (int argc, char * const argv[]) {
-    return Catch::Main( argc, argv );
-}
-
-#else // __OBJC__
-
-// Objective-C entry point
-int main (int argc, char * const argv[]) {
-#if !CATCH_ARC_ENABLED
-    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
-#endif
-
-    Catch::registerTestMethods();
-    int result = Catch::Main( argc, (char* const*)argv );
-
-#if !CATCH_ARC_ENABLED
-    [pool drain];
-#endif
-
-    return result;
-}
-
-#endif // __OBJC__
-
-#endif
-
-//////
-
-// If this config identifier is defined then all CATCH macros are prefixed with CATCH_
-#ifdef CATCH_CONFIG_PREFIX_ALL
-
-#define CATCH_REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE" )
-#define CATCH_REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal | Catch::ResultDisposition::NegateResult, "CATCH_REQUIRE_FALSE" )
-
-#define CATCH_REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, ..., Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS" )
-#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS_AS" )
-#define CATCH_REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_NOTHROW" )
-
-#define CATCH_CHECK( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK" )
-#define CATCH_CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::NegateResult, "CATCH_CHECK_FALSE" )
-#define CATCH_CHECKED_IF( expr ) INTERNAL_CATCH_IF( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_IF" )
-#define CATCH_CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_ELSE" )
-#define CATCH_CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CATCH_CHECK_NOFAIL" )
-
-#define CATCH_CHECK_THROWS( expr )  INTERNAL_CATCH_THROWS( expr, ..., Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS" )
-#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS_AS" )
-#define CATCH_CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_NOTHROW" )
-
-#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THAT" )
-#define CATCH_REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THAT" )
-
-#define CATCH_INFO( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Info, Catch::ResultDisposition::ContinueOnFailure, "CATCH_INFO" )
-#define CATCH_WARN( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, "CATCH_WARN" )
-#define CATCH_FAIL( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "CATCH_FAIL" )
-#define CATCH_SUCCEED( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "CATCH_SUCCEED" )
-#define CATCH_SCOPED_INFO( msg ) INTERNAL_CATCH_SCOPED_INFO( msg, "CATCH_SCOPED_INFO" )
-#define CATCH_CAPTURE( msg ) INTERNAL_CATCH_MSG( #msg " := " << msg, Catch::ResultWas::Info, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CAPTURE" )
-#define CATCH_SCOPED_CAPTURE( msg ) INTERNAL_CATCH_SCOPED_INFO( #msg " := " << msg, "CATCH_SCOPED_CAPTURE" )
-
-#define CATCH_SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description )
-
-#define CATCH_TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description )
-#define CATCH_TEST_CASE_NORETURN( name, description ) INTERNAL_CATCH_TESTCASE_NORETURN( name, description )
-#define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "Anonymous test case" )
-#define CATCH_METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description )
-
-#define CATCH_REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType )
-
-#define CATCH_GENERATE( expr) INTERNAL_CATCH_GENERATE( expr )
-
-// If CATCH_CONFIG_PREFIX_ALL is not defined then the CATCH_ prefix is not required
-#else
-
-#define REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal, "REQUIRE" )
-#define REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal | Catch::ResultDisposition::NegateResult, "REQUIRE_FALSE" )
-
-#define REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, ..., Catch::ResultDisposition::Normal, "REQUIRE_THROWS" )
-#define REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "REQUIRE_THROWS_AS" )
-#define REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::Normal, "REQUIRE_NOTHROW" )
-
-#define CHECK( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECK" )
-#define CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::NegateResult, "CHECK_FALSE" )
-#define CHECKED_IF( expr ) INTERNAL_CATCH_IF( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECKED_IF" )
-#define CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECKED_ELSE" )
-#define CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CHECK_NOFAIL" )
-
-#define CHECK_THROWS( expr )  INTERNAL_CATCH_THROWS( expr, ..., Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS" )
-#define CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS_AS" )
-#define CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECK_NOTHROW" )
-
-#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THAT" )
-#define REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::Normal, "REQUIRE_THAT" )
-
-#define INFO( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Info, Catch::ResultDisposition::ContinueOnFailure, "INFO" )
-#define WARN( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, "WARN" )
-#define FAIL( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "FAIL" )
-#define SUCCEED( msg ) INTERNAL_CATCH_MSG( msg, Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "SUCCEED" )
-#define SCOPED_INFO( msg ) INTERNAL_CATCH_SCOPED_INFO( msg, "SCOPED_INFO" )
-#define CAPTURE( msg ) INTERNAL_CATCH_MSG( #msg " := " << msg, Catch::ResultWas::Info, Catch::ResultDisposition::ContinueOnFailure, "CAPTURE" )
-#define SCOPED_CAPTURE( msg ) INTERNAL_CATCH_SCOPED_INFO( #msg " := " << msg, "SCOPED_CAPTURE" )
-
-#define SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description )
-
-#define TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description )
-#define TEST_CASE_NORETURN( name, description ) INTERNAL_CATCH_TESTCASE_NORETURN( name, description )
-#define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "Anonymous test case" )
-#define METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description )
-
-#define REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType )
-
-#define GENERATE( expr) INTERNAL_CATCH_GENERATE( expr )
-
-#endif
-
-#define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature )
-
-using Catch::Detail::Approx;
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-#endif // TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
-

+ 0 - 12
src/tests/common/CMakeLists.txt

@@ -1,12 +0,0 @@
-INCLUDE_DIRECTORIES(
-  ${PARADEVS_BINARY_DIR}/src
-  ${PARADEVS_SOURCE_DIR}/src
-  ${Boost_INCLUDE_DIRS}
-  ${GLIBMM_INCLUDE_DIRS}
-  ${LIBXML_INCLUDE_DIRS})
-
-LINK_DIRECTORIES(
-  ${GLIBMM_LIBRARY_DIRS}
-  ${LIBXML_LIBRARY_DIR})
-
-ADD_SUBDIRECTORY(scheduler)

+ 0 - 19
src/tests/common/scheduler/CMakeLists.txt

@@ -1,19 +0,0 @@
-INCLUDE_DIRECTORIES(
-  ${PARADEVS_BINARY_DIR}/src
-  ${PARADEVS_SOURCE_DIR}/src
-  ${Boost_INCLUDE_DIRS}
-  ${GLIBMM_INCLUDE_DIRS}
-  ${LIBXML_INCLUDE_DIRS})
-
-LINK_DIRECTORIES(
-  ${GLIBMM_LIBRARY_DIRS}
-  ${LIBXML_LIBRARY_DIR})
-
-ADD_EXECUTABLE(common-scheduler-tests ${COMMON_HPP} tests.cpp)
-SET_TARGET_PROPERTIES(common-scheduler-tests PROPERTIES
-  ${PARADEVS_APP_PROPERTIES})
-
-TARGET_LINK_LIBRARIES(common-scheduler-tests
-  ${GLIBMM_LIBRARIES}
-  ${LIBXML_LIBRARIES}
-  ${GTHREAD_LIBRARIES})

+ 0 - 167
src/tests/common/scheduler/tests.cpp

@@ -1,167 +0,0 @@
-/**
- * @file tests/common/scheduler/tests.cpp
- * @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/>.
- */
-
-#include <common/scheduler/HeapScheduler.hpp>
-#include <common/time/DoubleTime.hpp>
-
-#include <kernel/pdevs/Dynamics.hpp>
-#include <kernel/pdevs/Simulator.hpp>
-
-#include <chrono>
-
-#define CATCH_CONFIG_MAIN
-#include <tests/catch.hpp>
-
-using namespace paradevs::common;
-using namespace paradevs::common::scheduler;
-
-using namespace paradevs::pdevs;
-
-using namespace std::chrono;
-
-struct SchedulerHandle;
-
-typedef typename HeapScheduler < 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;
-};
-
-typedef Dynamics < DoubleTime, SchedulerHandle > MyDynamics;
-typedef paradevs::pdevs::Simulator < DoubleTime, MyDynamics,
-                                     SchedulerHandle > MySimulator;
-typedef std::vector < MySimulator* > MySimulators;
-
-const int simulator_number = 5000;
-const double simulation_duration = 1000;
-const int sample_number = 20;
-
-double unit_test(unsigned int n)
-{
-    MySimulators simulators;
-    HeapScheduler < DoubleTime, SchedulerHandle > scheduler;
-
-    for (unsigned int i = 0; i < simulator_number; ++i) {
-        std::ostringstream ss;
-
-        ss << "a" << (i + 1);
-        simulators.push_back(new MySimulator(ss.str(), NoParameters()));
-    }
-
-    std::vector < std::vector < unsigned int > > lists;
-
-    for (unsigned int t = 1; t < simulation_duration; ++t) {
-        std::vector < unsigned int > list;
-        std::vector < unsigned int > list2;
-
-        for (unsigned int i = 0; i < n; ++i) {
-            list2.push_back(i);
-        }
-        for (unsigned int i = 0; i < n; ++i) {
-            unsigned int j = rand() % list2.size();
-            unsigned int index = list2[j];
-            std::vector < unsigned int >::iterator it =
-                std::find(list2.begin(), list2.end(), index);
-
-            list.push_back(index);
-            list2.erase(it);
-        }
-        lists.push_back(list);
-    }
-
-    steady_clock::time_point t1 = steady_clock::now();
-
-    for (unsigned int i = 0; i < n; ++i) {
-        scheduler.init(0., simulators[i]);
-    }
-
-    for (unsigned int t = 1; t < simulation_duration; ++t) {
-        for (unsigned int i = 0; i < n; ++i) {
-            scheduler.put((double)t, simulators[lists[t - 1][i]]);
-        }
-    }
-
-    steady_clock::time_point t2 = steady_clock::now();
-
-    duration < double > time_span = duration_cast <
-        duration < double > >(t2 - t1);
-
-    for (MySimulators::const_iterator it = simulators.begin();
-         it != simulators.end(); ++it) {
-        delete *it;
-    }
-
-    return time_span.count();
-}
-
-void test(unsigned int n, unsigned int r)
-{
-    std::vector < double > t;
-
-    for (unsigned int i = 0; i < sample_number; ++i) {
-        t.push_back(unit_test(n));
-    }
-
-    double a = 0;
-
-    for (unsigned int i = 0; i < sample_number; ++i) {
-        a += t[i];
-    }
-    a /= sample_number;
-
-    double sd = 0;
-
-    for (unsigned int i = 0; i < sample_number; ++i) {
-        sd += (t[i] - a)*(t[i] - a);
-    }
-    sd /= sample_number;
-    sd = sqrt(sd);
-
-    std::cout << n << "\t" << a << "\t" << (a * r) << "\t"
-              << sd << "\t" << (sd * r) << std::endl;
-}
-
-TEST_CASE("common/scheduler/heap", "run")
-{
-    for (unsigned int i = 1; i <= 200; i+= 5) {
-        test(simulator_number / i, i);
-    }
-}

+ 0 - 23
src/tests/corsen/CMakeLists.txt

@@ -1,23 +0,0 @@
-INCLUDE_DIRECTORIES(
-  ${PARADEVS_BINARY_DIR}/src
-  ${PARADEVS_SOURCE_DIR}/src
-  ${Boost_INCLUDE_DIRS}
-  ${GLIBMM_INCLUDE_DIRS}
-  ${LIBXML_INCLUDE_DIRS})
-
-LINK_DIRECTORIES(
-  ${GLIBMM_LIBRARY_DIRS}
-  ${LIBXML_LIBRARY_DIR})
-
-# corsen tests
-ADD_EXECUTABLE(corsen-tests ${COMMON_HPP} ${COMMON_SCHEDULER_HPP} ${PDEVS_HPP}
-  tests.cpp)
-SET_TARGET_PROPERTIES(corsen-tests PROPERTIES ${PARADEVS_APP_PROPERTIES})
-
-TARGET_LINK_LIBRARIES(corsen-tests corsen
-  ${Boost_LIBRARIES}
-  ${GLIBMM_LIBRARIES}
-  ${LIBXML_LIBRARIES}
-  ${GTHREAD_LIBRARIES})
-
-ADD_SUBDIRECTORY(lib)

+ 0 - 27
src/tests/corsen/lib/CMakeLists.txt

@@ -1,27 +0,0 @@
-INCLUDE_DIRECTORIES(
-  ${PARADEVS_BINARY_DIR}/src
-  ${PARADEVS_SOURCE_DIR}/src
-  ${PARADEVS_SOURCE_DIR}/src/tests/corsen/lib
-  ${Boost_INCLUDE_DIRS}
-  ${GLIBMM_INCLUDE_DIRS}
-  ${LIBXML_INCLUDE_DIRS})
-
-LINK_DIRECTORIES(
-  ${GLIBMM_LIBRARY_DIRS}
-  ${LIBXML_LIBRARY_DIR})
-
-SET(CORSEN_HPP Constantes.h Coordinates.h ElevationFileStream.h Functions.h
-  LayersFileStream.h OutletFileStream.h Parameters.h SoilFileStream.h
-  ContextData.h Corsen.hpp Exception.h Graph.hpp LayersTextFileStream.h Outlet.h
-  Singleton.h Vertex.h ContextFileReader.h DrainFileStream.h FileStream.h
-  Layer.h Node.h ParametersFileStream.h SlopeFileStream.h XmlReader.h)
-
-SET(CORSEN_CPP Corsen.cpp Functions.cpp Graph.cpp)
-
-ADD_LIBRARY(corsen SHARED ${CORSEN_HPP};${CORSEN_CPP})
-
-TARGET_LINK_LIBRARIES(corsen
-  ${Boost_LIBRARIES}
-  ${GLIBMM_LIBRARIES}
-  ${LIBXML_LIBRARIES}
-  ${GTHREAD_LIBRARIES})

+ 0 - 149
src/tests/corsen/lib/Constantes.h

@@ -1,149 +0,0 @@
-/**
- *
- * \file Constantes.h
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- * \date 30 mai 2013
- * \brief regroupe toutes les constantes du programme.
- */
-
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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 CONSTANTES_H_
-#define CONSTANTES_H_
-
-//#define DEBUG
-#define SUJET 0
-#define OBJET 1
-#define VRAI 1
-#define FAUX 0
-#define LIG_KEY 1
-#define COL_KEY 2
-#define ALTITUDE 1
-#define COULEUR 2
-#define BASSIN 3
-#define DRAIN 4
-#define MNT 5
-#define NODE 6
-#define DERIVE 7
-#define IMAGE 8
-#define LAYER 9
-#define RESEAU 10
-#define EXUTOIRE 11
-#define HAIE 12
-#define EXTREMITE 13
-#define ZHANG 14
-#define NETW625 15
-#define MASK 16
-#define DRAIN_INI 17
-#define MUR 18
-
-#define RIEN -1
-#define ASCII 99
-#define NODATA -9999
-
-#define ALT 0
-#define SBV 1
-#define DBV 2
-#define LOD 3
-#define LON 3
-#define SML 4
-#define LZD 4
-#define CVX 4
-#define PEN 5
-#define BEV 6
-#define PAV 7
-#define MRT 8
-#define CFL 9
-#define DLT 9
-#define EXP 10
-#define DAR 10
-#define APL 10
-#define COV 11
-#define PRM 11
-#define DAS 11
-#define LOV 11
-#define DVV 11
-#define CNT 12
-#define IMA 12
-#define RAY 15
-#define MCX 15
-#define	BASE 0
-#define	ZOOM 1
-#define	INFO 2
-#define	AFFI 3
-#define	SELE 4
-#define	MAJ 5
-#define	SUPP 6
-#define	PROM1 7
-#define	PROM2 8
-#define	COUPE 9
-#define RACCORD 10
-#define MAJSBV 11
-#define MAJMDD 12
-#define MAJMUR 13
-
-#define NORD 1
-#define NORDOUEST 2
-#define OUEST 3
-#define SUDOUEST 4
-#define SUD 5
-#define SUDEST 6
-#define EST 7
-#define NORDEST 8
-#define PLATEAU 9
-#define EXUTOIRE_BORD 10
-#define EXUTOIRE_MER 11
-#define TROU 12
-
-#define ARCINFO 0
-#define DESCARTES 1
-#define MAPINFO  2
-#define ARCVIEW 3
-
-
-#define LONGUEUR_LABEL_MAX 60
-#define LONGUEUR_LIGNE_INDEX_VAR_MAX 129
-#define NB_COUCHE_MAX 32
-#define POUR_FREQUENCE 99
-#define POUR_COUCHE 2
-
-#define MAP 0
-/* si 1: Affichage des elements de mise au point */
-
-#define NB_DERIVES_MAX 50
-#define RESEAU_HYDRO 1
-#define CONTOUR_BASSIN 2
-#define CONTOUR_IMAGE_BINAIRE 3
-#define EXUTOIRES 4
-#define AUTRES 5
-#define NOMBRE_DE_CLASSE 1000
-#define DEFAULT_COLORS 16
-#define NB_FORMAT 5
-#define NB_COULEURS_DYNAMIC 90
-#define RAPPORT_SURFACE 10000
-#define TROU_TOLERE 1
-#define FACT 1000
-#define EPSALT 0.00001
-#define chemin_appli
-#define LONGMAILLE 50.
-#define ALTMER 0.1
-
-#endif /* CONSTANTES_H_ */

+ 0 - 112
src/tests/corsen/lib/ContextData.h

@@ -1,112 +0,0 @@
-/*!
- * \file ContextData.h
- * \brief Stocke les données du fichier context.
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- */
-
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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 CONTEXTDATA_H_
-#define CONTEXTDATA_H_
-
-#include <string>
-#include "Singleton.h"
-
-/*! \class ContextData
- *
- * \brief regroupe les données du fichier context.
- *
- */
-
-class ContextData : public Singleton<ContextData>
-{
-	friend class Singleton<ContextData>;
-
-public :
-
-	/**
-	 * \struct mesh_chrono_t
-	 * \brief structure pour gestion des sorties.
-	 */
-	struct mesh_chrono_t
-	{
-		int line;       /*!< numéro de ligne */
-		int column;       /*!< numéro de colonne */
-		FILE * ptf;  /*!< pointeur vers fichier sorties */
-
-		mesh_chrono_t() : line(0), column(0), ptf(NULL) {}
-	};
-
-
-	typedef int day_t ;
-
-	/**
-	 * \struct date_t
-	 * \brief structure pour représentation des dates.
-	 */
-	struct date_t
-	{
-		unsigned day; /*!< numéro jour */
-		unsigned month; /*!< numéro mois */
-		unsigned year; /*!< numéro année */
-
-		date_t():day(0), month(0),year(0) {}
-	};
-
-	std::string _pathToData; /*!< chemin vers le répertoire contenant les fichiers de données */
-	int _soilNumber; /*!< numéro de la couche sur laquelle on travaille */
-	char * _absolutePath; /*!< chemin absolu vers le répertoire principal d'un projet TNT */
-	double _defaultNetworkSlope; /*!< pente par défaut du réseau */
-	std::string _soilFileName; /*!< nom du fichier de couches */
-	double _pptionAccess; /*!< prop_acces_eau */
-	mesh_chrono_t _outletsCoordinates[15]; /*!< Coordonnées exutoire */
-	day_t _numberDays; /*!< Durée en jours de la simulation */
-	date_t _simulationStartDate; /*!< Date du premier jour */
-
-private :
-
-	/*!
-	 *  \brief Constructeur
-	 *
-	 *  Constructeur de la classe ContextData.
-	 *
-	 *  Initialise les attributs.
-	 *
-	 */
-
-	ContextData()
-{
-		_soilNumber = 0;
-		_absolutePath = NULL;
-		_defaultNetworkSlope = 0.;
-		_pptionAccess = 0.;
-		_numberDays = 0;
-}
-	/*!
-	 *  \brief Destructeur
-	 *
-	 *  Destructeur de la classe ContextData
-	 */
-
-	~ContextData(){}
-};
-
-#endif /* CONTEXTDATA_H_ */

+ 0 - 234
src/tests/corsen/lib/ContextFileReader.h

@@ -1,234 +0,0 @@
-/*!
- * \file ContextFileReader.h
- * \brief Lecteur de fichier de type context.
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- */
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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 CONTEXTFILEREADER_H_
-#define CONTEXTFILEREADER_H_
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <iostream>
-#include "ContextData.h"
-#include "XmlReader.h"
-#include "Functions.h"
-
-#define LINSIZE 1024
-
-/*! \class ContextFileReader
- * \brief représente le lecteur de fichier de type context.
- *
- */
-
-class ContextFileReader
-{
-public :
-
-	/*!
-	 *  \brief Lecture.
-	 *
-	 *  Lit le fichier des paramètres d'entrées.
-	 *
-	 *  \param docname : le nom du du document à lire et analyser.
-	 *  \param numberDays : Durée en jours de la simulation.
-	 *  \param simulationStartDate : Date du premier jour.
-	 *  \param outletsCoordinates : Coordonnées exutoires.
-	 *  \return EXIT_SUCCESS - Fin normal de la méthode.
-	 */
-
-
-	static int read(const char * docname,  ContextData::day_t & numberDays, ContextData::date_t & simulationStartDate, ContextData::mesh_chrono_t outletsCoordinates[])
-	{
-		xmlDocPtr doc_context = XmlReader::parseDoc(docname);
-
-		/* Coordonnées exutoire */
-
-		getOutletCoordinates(doc_context, outletsCoordinates);
-
-		/* Durée en jours de la simulation */
-
-		numberDays = XmlReader::getIntParamValue(doc_context,"duree_simulation");
-
-		ContextData * ctxtD = ContextData::getInstance();
-
-		/* Date du premier jour */
-		simulationStartDate = getDate(((char *)XmlReader::getStringParamValue(doc_context,"debut-simulation")));
-
-		ctxtD->_soilNumber = XmlReader::getIntParamValue(doc_context,"nb_sols");
-
-		ctxtD->_soilFileName = (char*)XmlReader::getStringParamValue(doc_context,"file_sol_loc");
-
-		ctxtD->_defaultNetworkSlope = XmlReader::getFloatParamValue(doc_context,"defaut_pente_reseau");
-
-		ctxtD->_pptionAccess = XmlReader::getFloatParamValue(doc_context,"prop_acces_eau");
-
-		xmlFreeDoc(doc_context);
-		xmlCleanupParser();
-		xmlMemoryDump();
-
-		return EXIT_SUCCESS;
-	}
-
-	/*!
-	 *  \brief Obtenir date.
-	 *
-	 *  Transforme une représentation chaînée d'une date en une structure date.
-	 *
-	 *  \param dateStr : représentation chaînée d'une date au format jj/mm/aaaa.
-	 *  \return structure date avec un attribut pour le jour, le mois et l'année.
-	 */
-
-private :
-
-	static ContextData::date_t getDate(char dateStr[11])
-	{
-		ContextData::date_t date;
-		char c1,c2;
-
-		if(sscanf(dateStr,"%2d%c%2d%c%4d", &date.day,&c1,&date.month,&c2,&date.year)!=5)
-			printf("\n Erreur dans la lecture de date sur la chaine %s",dateStr);
-
-		return date;
-	}
-
-	/*!
-	 *  \brief Obtenir coordonnées exutoire.
-	 *
-	 *  Récupère les coordonnées de l'exutoire dans le document XML.
-	 *
-	 *  \param doc_context : document dans lequel se trouve l'information.
-	 *  \param outletsCoordinates : structure dans laquelle les données trouvées seront sauvegardées.
-	 *  \return void.
-	 */
-
-	static void getOutletCoordinates(xmlDocPtr doc_context, ContextData::mesh_chrono_t outletsCoordinates[])
-	{
-		xmlNodePtr cur_node = NULL;
-		xmlChar *value_x;
-		xmlChar *value_y;
-
-		cur_node = XmlReader::findNodeWithTagAndAttrName(doc_context, "mesh", "exutoire");
-		if (cur_node!=NULL)
-		{
-			value_x = xmlGetProp(cur_node,(const xmlChar*)"x-value");
-			value_y = xmlGetProp(cur_node,(const xmlChar*)"y-value");
-			outletsCoordinates[0].line= atoi((const char*) value_x );
-			outletsCoordinates[0].column= atoi((const char*) value_y );
-			xmlFree(value_x);
-			xmlFree(value_y);
-		}
-		else
-		{
-			std::cerr <<"Error  : Outlet coordinate not defined\n";
-			exit(0);
-		}
-	}
-};
-
-#endif /* CONTEXTFILEREADER_H_ */
-
-
-
-
-
-
-
-
-
-
-
-/*---------------------------------------------------------------------------*/
-/*  lecture_fichier_contexte :                                               */
-/* Entree : nomfich                                               			 */
-/*          fichier renfermant les parametres d'entrees                 	 */
-/*---------------------------------------------------------------------------*/
-/*void lecture_fichier_contexte (char *nomfich, jour_t & nbjours, struct_date_t & date_deb_simu, struct_maille_chrono_t TabMailles [])
-{
-    FILE *fpnomfich = NULL;
-    char tbuf[LINSIZE];
-    int afmsg;
-
- *tbuf = 0;
-
-    if( !nomfich) {
-        printf("\nVeuillez taper le nom du fichier contexte, puis appuyez sur ENTREE [CR/LF]");
-        printf("\n ou appuyez sur ENTREE pour entrer les valeurs a partir du 'clavier'\n");
-
-        putchar('?');
-
-        fgets(tbuf, LINSIZE, stdin);  Demande le nom du fichier contexte
-        putchar('\n');
-        Util::ignorelf(tbuf);
-         Si le nom du fichier contexte est donne
-        if( tbuf[0]) {
-            int i = -1;  determine sa longueur et
-            while( tbuf[++i]) {}
-
-            if((nomfich = (char *)malloc(i+1)) == NULL)
-                Util::traiterreur(tbuf);
-            else     --  copie-le dans la variable nomfich --
-            {
-                i = -1;
-                while ((nomfich[++i] = tbuf[i]))
-                {
-
-                }
-
-            }
-        }
-    }
-
-     Si le nom de fichier contexte n'est pas donne
-       ou si on a pas pu l'ouvrir,
-       On lit les valeurs initiales au clavier [entree standard]
-
-    afmsg = (nomfich == NULL) ? 1 : 0;
-
-    if( ! afmsg) {
-         Essaie d'ouvrir le fichier, en cas d'impossiblite dis pourquoi
-        if( !(fpnomfich = fopen (nomfich,"r"))) {
-        	Util::traiterreur(nomfich);
-            afmsg = 1;
-        }
-    }
-
-     Les param d'entree doivent etre donnes dans un fichier
-     et ne peuvent plus etre lus au clavier
-    if( !fpnomfich) {
-        fpnomfich = stdin;
-        printf("VOUS DEVEZ DONNER LE NOM DU FICHIER DES PARAMETRES D'ENTREE !!");
-        exit(0);
-    }
-
-    //exutoire = NULL;
-
-    appel de la fonction qui va lire le fichier des parametres d'entree
-
-    read_context_file(nomfich, nbjours, date_deb_simu, TabMailles);
-
-
-    fclose(fpnomfich);
-}*/
-
-

+ 0 - 319
src/tests/corsen/lib/Coordinates.h

@@ -1,319 +0,0 @@
-/*!
- * \file Coordinates.h
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- * \date 3 juin 2013
- */
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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 COORDINATES_H_
-#define COORDINATES_H_
-
-#include <iostream>
-#include <sstream>
-#include <fstream>
-#include "Parameters.h"
-
-/*! \class Coordinates
- * \brief représente les coordonnées en 2D d'un point du bassin versant.
- */
-
-class Coordinates
-{
-private :
-	short _line; /*!< numéro de ligne */
-	short _column; /*!< numéro de colonne */
-
-public :
-	static int _columnsNumber; /*!< nombre de colonnes */
-	/*!
-	 *  \brief Constructeur
-	 *
-	 *  Constructeur par défaut de la classe Coordinates.
-	 *  Initialise les attributs à 0.
-	 *
-	 *  \return void.
-	 */
-
-	Coordinates(): _line(0), _column(0) {};
-
-	/*!
-	 *  \brief Constructeur
-	 *
-	 *  Constructeur avec paramètres de la classe Coordinates.
-	 *
-	 *  \param line : numéro de la ligne.
-	 *  \param column : : numéro de la colonne.
-	 *  \return void.
-	 */
-
-	Coordinates(short line, short column) : _line(line),_column(column) {}
-
-	/*!
-	 *  \brief Constructeur
-	 *
-	 *  Constructeur par copie de la classe Coordinates.
-	 *
-	 *  \param c : Instance de la classe Coordonnées à copier.
-	 *  \return void.
-	 */
-
-	Coordinates(const Coordinates &c): _line(c.getLine()), _column(c.getColumn()){}
-
-	/*!
-	 *  \brief Constructeur
-	 *
-	 *  Constructeur avec paramètres de la classe Coordinates.
-	 *
-	 *  \param nodeCoordinates : Coordonnées de base indispensable pour le calcul de la coordonnée voisine.
-	 *  \param identifiantVoisin : détermine la position du voisin par rapport à la coordonnées de base.
-	 *  \return void.
-	 */
-
-	Coordinates(const Coordinates & nodeCoordinates, char identifiantVoisin)
-	{
-		switch (identifiantVoisin)
-		{
-		case '1' :
-			_line = nodeCoordinates.getLine() - 1 ;
-			_column = nodeCoordinates.getColumn() ;
-			break ;
-		case '2' :
-			_line = nodeCoordinates.getLine() - 1 ;
-			_column = nodeCoordinates.getColumn() + 1 ;
-			break ;
-
-		case '3':
-			_line = nodeCoordinates.getLine() ;
-			_column = nodeCoordinates.getColumn() + 1 ;
-			break ;
-
-		case '4' :
-			_line = nodeCoordinates.getLine() + 1 ;
-			_column = nodeCoordinates.getColumn() + 1 ;
-			break ;
-
-		case '5' :
-			_line = nodeCoordinates.getLine() + 1 ;
-			_column = nodeCoordinates.getColumn() ;
-			break ;
-
-		case '6' :
-			_line = nodeCoordinates.getLine() + 1 ;
-			_column = nodeCoordinates.getColumn() - 1 ;
-			break ;
-
-		case '7' :
-			_line = nodeCoordinates.getLine() ;
-			_column = nodeCoordinates.getColumn() - 1 ;
-			break ;
-
-		case '8' :
-			_line = nodeCoordinates.getLine() - 1 ;
-			_column = nodeCoordinates.getColumn() - 1 ;
-			break ;
-		}
-	}
-
-
-	void operator = (const Coordinates& c)
-	{
-		_line = c.getLine();
-		_column = c.getColumn();
-	}
-
-	/*!
-	 *  \brief Destructeur
-	 *
-	 *  Destructeur de la classe Coordinates
-	 */
-
-	virtual ~Coordinates()
-	{
-
-	}
-
-	short getColumn() const
-	{
-		return _column;
-	}
-
-	void setColumn(short colonne)
-	{
-		this->_column = colonne;
-	}
-
-	short getLine() const
-	{
-		return _line;
-	}
-
-	void setLine(int ligne)
-	{
-		this->_line = ligne;
-	}
-
-	/*!
-	 * \brief Transformer en chaîne.
-	 *
-	 * Représentation chaînée de l'objet
-	 *
-	 * \param void
-	 * \return string
-	 */
-
-	const std::string toString() const
-	{
-		std::stringstream ss;
-		ss<<"Ligne "<<_line<<" Colonne "<<_column<<" ";
-		return ss.str();
-	}
-
-	/*!
-	 * \brief clé.
-	 *
-	 * Génère un identifiant unique (sans doublons) en fonction du numéro de la ligne et de la colonne et du nombre de colonnes.
-	 *
-	 * \param void
-	 * \return identifiant de la coordonnées.
-	 *
-	 */
-	int key() const
-	{ return (_line * _columnsNumber + _column); }
-
-	virtual bool operator==(const Coordinates& coordinates) const
-					{ return key() == coordinates.key(); }
-
-	virtual bool operator!=(const Coordinates& coordinates) const
-					{return key() != coordinates.key();}
-
-	virtual bool operator<(const Coordinates& coordinates) const
-	{ return key() < coordinates.key(); }
-
-	/*!
-	 * \brief est valide ?
-	 *
-	 * Vérifie que la coordonnées correspond bien à un point du bassin versant.
-	 * \param p : paramètres du programme et du bassin versant.
-	 * \return true si elle est située dans le bassin versant, false sinon.
-	 *
-	 */
-
-	bool isValid (Parameters * p)
-	{
-		return (_line>=0 && _line <p->_linesNumber && _column>=0 && _column < p->_columnsNumber) ;
-	}
-
-	/*!
-	 * \brief est sur la même ligne ?
-	 *
-	 * Vérifie que si les lignes sont identiques.
-	 * \param line : numéro de la ligne.
-	 * \return true si elles sont identiques, false sinon.
-	 *
-	 */
-
-	bool isSameLine(short line) const
-	{
-		return (_line == line);
-	}
-
-	/*!
-	 * \brief est sur la même colonne ?
-	 *
-	 * Vérifie que si les colonnes sont identiques.
-	 * \param column : numéro de la colonne.
-	 * \return true si elles sont identiques, false sinon.
-	 *
-	 */
-	bool isSameColumn(short column) const
-	{
-		return (_column == column);
-	}
-
-	/*!
-	 * \brief est sur la même ligne ?
-	 *
-	 * Vérifie que si les lignes sont identiques.
-	 * \param c : Coordonnées à tester.
-	 * \return true si elles sont identiques, false sinon.
-	 *
-	 */
-
-	bool isSameLine(const Coordinates & c) const
-	{
-		return (_line == c.getLine());
-	}
-
-	/*!
-	 * \brief est sur la même colonne ?
-	 *
-	 * Vérifie que si les colonnes sont identiques.
-	 * \param c : Coordonnées à tester.
-	 * \return true si elles sont identiques, false sinon.
-	 *
-	 */
-
-	bool isSameColumn(const Coordinates & c) const
-	{
-		return (_column == c.getColumn());
-	}
-
-	/*!
-	 * \brief est sur le contour ?
-	 *
-	 * Vérifie si la coordonnées se situe sur le contour du bassin versant.
-	 * \param p : paramètres du programme et du bassin versant.
-	 * \return true si elle est située sur le contour du bassin versant, false sinon.
-	 *
-	 */
-	bool isOnShore(const Parameters * p) const
-	{
-		if (_line == 0)
-			return true;
-		else if( _column == 0)
-			return true;
-		else if(_line == p->_linesNumber - 1)
-			return true;
-		else if (_column == p->_columnsNumber - 1)
-			return true;
-		else
-			return false;
-	}
-
-	/*!
-	 * \brief Envoyer vers fichier binaire
-	 *
-	 * Écrit l'objet dans un fichier binaire.
-	 * \param file : fichier ou écrire les données.
-	 * \return void.
-	 *
-	 */
-
-
-	void toBinaryFile(std::ofstream & file)
-	{
-		file.write(reinterpret_cast<char *>(&_line),sizeof(short));
-		file.write(reinterpret_cast<char *>(&_column),sizeof(short));
-	}
-
-};
-
-#endif /* COORDINATES_H_ */

+ 0 - 193
src/tests/corsen/lib/Corsen.cpp

@@ -1,193 +0,0 @@
-/*!
- * \file Corsen.cpp
- * \brief Charge les différents fichiers en mémoire et lance la
- * génération du graphe.
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- */
-
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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/>.
- */
-
-#include "Corsen.hpp"
-
-int Coordinates::_columnsNumber = 0;
-
-Corsen::Corsen() : _graph()
-{
-    _pfs = NULL;
-    _efs = NULL;
-    _ofs = NULL;
-    _gfs = NULL;
-    _lfs = NULL;
-    _sfs = NULL;
-    _dfs = NULL;
-    _elevationMatrixBv = NULL;
-    _outlet = NULL;
-    _soilMatrix = NULL;
-    _gradientMatrix = NULL;
-    _elevationMatrix = NULL;
-    _outlets = NULL;
-    _param = NULL;
-    _layers = NULL;
-}
-
-void Corsen::read(std::vector < std::string* > & files,
-                  std::string& absolutePath) throw (FileNotFound, ReadError,
-                                                    InvalidFileFormat,
-                                                    std::invalid_argument)
-{
-    std::stringstream ss;
-
-    _pfs = new ParametersFileStream(*files.at(0), *files.at(1));
-    _efs = new ElevationFileStream(*files.at(2));
-    _ofs = new OutletFileStream(*files.at(3));
-    _gfs = new SlopeFileStream(*files.at(4));
-    _dfs = new DrainFileStream<corsenContainers::vecS, float>(*files.at(4));
-
-    ContextData * ctxtD = ContextData::getInstance();
-
-    ContextFileReader::read((*files.at(5)).c_str(), ctxtD->_numberDays,
-                            ctxtD->_simulationStartDate,
-                            ctxtD->_outletsCoordinates);
-    _sfs = new SoilFileStream(absolutePath + ctxtD->_soilFileName);
-
-    _layers = new std::vector<Layer>();
-    _layers->push_back(Layer(std::string("Reseau Hydrographique"), 0, 0,
-                             RESEAU_HYDRO, false));
-
-    _param = _pfs->read();
-    Coordinates::_columnsNumber = _param->_columnsNumber;
-
-    _soilMatrix = _sfs->read();
-    _gradientMatrix = _gfs->read();
-    _elevationMatrix = _efs->read();
-    _outlets = _ofs->read();
-
-    int layerNumber = Layer::find(*_layers, RESEAU_HYDRO);
-
-    if(layerNumber == -1)
-        throw std::invalid_argument(
-            "Impossible de trouver l'élément dans le tableau de couches");
-
-    ss << *files.at(6) << layerNumber;
-    _lfs = new LayersFileStream(ss.str(), _param);
-    _layers->at(layerNumber).setData(_lfs->read());
-}
-
-void Corsen::buildGraph()
-{
-    Coordinates c(ContextData::getInstance()->_outletsCoordinates[0].line, ContextData::getInstance()->_outletsCoordinates[0].column);
-    for(std::list<Outlet *>::const_iterator it = _outlets->begin(); it!=_outlets->end();it++)
-    {
-        if((*it)->getCoord() == c)
-        {
-            _outlet = *it;
-            _outlet->setBrother(NULL);
-            break;
-        }
-        _outlet = (*it)->searchChildNode(c);
-        if (_outlet != NULL)
-        {
-            _outlet->setBrother(NULL);
-            break;
-        }
-    }
-
-    _layers->at(Layer::find(*_layers, RESEAU_HYDRO)).matbiton(_outlet->getCoord(), _param);
-
-    _efs->write(*_elevationMatrix, std::string(".sav"));
-    std::stack<Node *> stack;
-
-    stack.push(_outlet);
-    _elevationMatrixBv = new std::vector<float>(_elevationMatrix->size());
-
-    while (not stack.empty())
-    {
-        Node * s = stack.top();
-        unsigned int index = s->getCoord().getLine() * _param->_columnsNumber + s->getCoord().getColumn();
-
-        _elevationMatrixBv->at(index) = _elevationMatrix->at(index);
-        stack.pop();
-        if (s->getBrother())
-            stack.push(s->getBrother());
-        if (s->getChild())
-            stack.push(s->getChild());
-    }
-
-    _graph.build(_elevationMatrixBv, _param);
-}
-
-void Corsen::display()
-{
-    std::cout<<"Les paramètres du programme sont :"<<_param->toString()<<std::endl;
-    std::cout<<"Liste d'adjacence :"<<std::endl;
-    _graph.display();
-#ifdef DEBUG
-    std::cout<<"Tableau de couches :"<<std::endl;
-    for(std::vector<Layer>::const_iterator it = _layers->begin(); it!=_layers->end(); it++)
-        it->display(_param);
-#endif
-
-}
-
-Corsen::~Corsen()
-{
-    if(_outlets !=NULL)
-    {
-        for(std::list<Outlet *>::iterator it = _outlets->begin(); it!=_outlets->end(); it++)
-        {
-            delete (*it);
-            *it = NULL;
-        }
-    }
-
-    if(_soilMatrix != NULL)
-        delete _soilMatrix;
-    if(_gradientMatrix !=NULL)
-        delete _gradientMatrix;
-    if(_param !=NULL)
-        delete _param;
-    if(_outlets !=NULL)
-        delete _outlets;
-    if(_elevationMatrix !=NULL)
-        delete _elevationMatrix;
-    if(_pfs != NULL)
-        delete _pfs;
-    if(_efs != NULL)
-        delete _efs;
-    if(_ofs != NULL)
-        delete _ofs;
-    if(_gfs != NULL)
-        delete _gfs;
-    if(_sfs != NULL)
-        delete _sfs;
-    if(_lfs != NULL)
-        delete _lfs;
-    if(_layers != NULL)
-        delete _layers;
-    if(_elevationMatrixBv != NULL)
-        delete _elevationMatrixBv;
-    if(_dfs != NULL)
-        delete _dfs;
-    ContextData::kill();
-#ifdef DEBUG
-    std::cout<<"destruction achevée \n";
-#endif
-}

+ 0 - 157
src/tests/corsen/lib/Corsen.hpp

@@ -1,157 +0,0 @@
-/*!
- * \file Corsen.h
- * \brief Charge les différents fichiers en mémoire et lance la génération du graphe.
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- */
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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 CORSEN_H_
-#define CORSEN_H_
-#define BOOST_TEST_DYN_LINK
-
-#include <fstream>
-#include <sstream>
-#include <cstdio>
-#include <stack>
-#include <boost/foreach.hpp>
-#include "ElevationFileStream.h"
-#include "ParametersFileStream.h"
-#include "LayersFileStream.h"
-#include "OutletFileStream.h"
-#include "SlopeFileStream.h"
-#include "SoilFileStream.h"
-#include "DrainFileStream.h"
-#include "LayersTextFileStream.h"
-#include "ContextFileReader.h"
-#include "ContextData.h"
-#include "Constantes.h"
-#include "Functions.h"
-#include "Graph.hpp"
-
-/*! \class Corsen
- * \brief est la classe centrale de la bibliothèque.
- *
- *  La classe gère la lecture, l'ecriture des différents fichiers de données
- *  pour un bassin versant. Elle génère le boost graph correspondant aux
- *  données.
- */
-
-class Corsen
-{
-public:
-  /*!
-   *  \brief Constructeur
-   *
-   *  Constructeur de la classe Corsen.
-   */
-  Corsen();
-
-  /*!
-   *  \brief Lecture
-   *
-   *  Lecture des fichiers de données du bassin versant.
-   *
-   *  \param files : liste des fichiers à lire.
-   *  \param absolutePath : emplacement des fichiers à lire.
-   */
-  void read(std::vector<std::string* >& files,
-	    std::string& absolutePath) throw (FileNotFound, ReadError,
-					      InvalidFileFormat,
-					      std::invalid_argument);
-
-  /*!
-   *  \brief Construire graphe
-   *
-   *	génère le boostGraph
-   */
-  void buildGraph();
-
-  /*!
-   *  \brief Affichage
-   *
-   *  Affiche le contenu des attributs.
-   */
-  void display();
-
-  const std::vector<float> * getElevationMatrix() const
-  {
-    return _elevationMatrix;
-  }
-
-  const Graph& getGraph() const {
-    return _graph;
-  }
-
-  const std::vector<Layer> * getLayers() const {
-    return _layers;
-  }
-
-  const std::list<Outlet*> * getOutlets() const {
-    return _outlets;
-  }
-
-  const Parameters * getParam() const {
-    return _param;
-  }
-
-  const Node * getExutoire() const {
-    return _outlet;
-  }
-
-  const std::vector<float> * getGradientMatrix() const {
-    return _gradientMatrix;
-  }
-
-  const std::vector<float> * getSoilMatrix() const {
-    return _soilMatrix;
-  }
-
-  const std::vector<float> * getElevationMatrixBv() const {
-    return _elevationMatrixBv;
-  }
-
-  /*!
-   *  \brief Destructeur
-   *
-   *  Destructeur de la classe Corsen
-   */
-  virtual ~Corsen();
-
-private:
-
-	Graph _graph;
-	ParametersFileStream * _pfs; /*!< Flux fichier paramètres */
-	ElevationFileStream * _efs; /*!< Flux fichier des données d'altitudes */
-	OutletFileStream * _ofs; /*!< Flux fichier des arbres de drainage */
-	SlopeFileStream * _gfs; /*!< Flux fichier des pentes */
-	SoilFileStream * _sfs;
-	LayersFileStream * _lfs; /*!< Flux fichier des couches*/
-	DrainFileStream<corsenContainers::vecS, float> * _dfs;
-	std::vector<float> * _gradientMatrix ;/*!< données pentes */
-	std::vector<float> * _soilMatrix;
-	std::vector<float> * _elevationMatrix;/*!< données altitudes */
-	std::list<Outlet *> * _outlets;/*!< liste des exutoires */
-	std::vector<Layer> *  _layers; /*!< liste des couches */
-	Parameters * _param; /*!< paramètres du programme */
-	Node * _outlet; /*!< noeud exutoire */
-	std::vector<float> * _elevationMatrixBv;
-};
-
-#endif /* CORSEN_H_ */

+ 0 - 126
src/tests/corsen/lib/DrainFileStream.h

@@ -1,126 +0,0 @@
-/*!
- * \file DrainFileStream.h
- * \brief Flux binaire sur fichier contenant toutes les données de l'arborescence de MntSurf.
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- * \date 13 juin 2013
- */
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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 DRAINFILESTREAM_H_
-#define DRAINFILESTREAM_H_
-
-#include "FileStream.h"
-#include "Coordinates.h"
-#include <typeinfo>
-#include <vector>
-
-/*! \class DrainFileStream
- *
- * \brief gère un flux binaire en lecture et écriture sur le fichier de drain.
- */
-
-
-template <class X, class Y, class T = FileStream<X,Y> >
-class DrainFileStream : public T
-{
-public :
-	DrainFileStream(std::string & filePath) : T(filePath)
-	{
-
-
-	}
-	~DrainFileStream() {}
-
-	typename T::returnType * read() const throw (FileNotFound, ReadError, InvalidFileFormat, std::bad_alloc)
-	{
-		std::ifstream drainFile(T::_filePath.c_str(),std::ios::binary);
-
-		if(not drainFile)
-			throw FileNotFound("Exception opening file\n: "+ T:: _filePath);
-
-		if(T::_format.compare("") == 0)
-			return readStandardFormat(drainFile);
-
-		throw InvalidFileFormat("Exception Unknown file format "+T::_filePath+"\n");
-
-	}
-
-	void write(const typename T::returnType & object, const std::string & extension) const
-	{
-	/*	std::string filePath(_filePath);
-		filePath.append(extension);
-		std::ofstream drainFile(filePath.c_str(), std::ios::trunc);
-
-		if(not drainFile)
-			throw FileNotFound("Exception opening file "+ filePath +"\n");
-
-		if(_format.compare("") == 0)
-			return writeStandardFormat(drainFile, object);
-
-		throw InvalidFileFormat("Exception Unknown file format "+ filePath +"\n");
-*/
-	}
-
-private :
-
-	typename T::returnType * readStandardFormat(std::ifstream & file) const throw(ReadError, std::bad_alloc)
-	{
-		try
-		{
-			typename T::returnType * tmpVec = new  typename T::returnType();
-			Y tmp;
-			do
-			{
-				file.read(reinterpret_cast<char *>(&tmp), sizeof(Y));
-				if(not file.eof() and not file.bad())
-					tmpVec->push_back(tmp);
-
-			}
-			while(file.good());
-			if(file.bad() or not file.eof())
-			{
-				file.close();
-				throw ReadError("Exception Reading data"+ T::_filePath);
-			}
-			file.close();
-			return tmpVec;
-		}
-		catch(std::bad_alloc & e)
-		{
-			throw;
-		}
-	}
-
-
-	void writeStandardFormat(std::ofstream & file, const typename T::returnType & object) const
-	{
-		Y tmp;
-		for(int i  = 0; i < object.size() ; i++)
-		{
-			tmp = object.at(i);
-			file.write(reinterpret_cast<char *>(&tmp), sizeof(Y));
-		}
-		file.close();
-	}
-};
-
-
-#endif /* DRAINFILESTREAM_H_ */

+ 0 - 141
src/tests/corsen/lib/ElevationFileStream.h

@@ -1,141 +0,0 @@
-/*!
- * \file ElevationFileStream.h
- * \brief Flux sur le fichier d'altitudes.
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- * \date 11 juin 2013
- */
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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 ELEVATIONFILESTREAM_H_
-#define ELEVATIONFILESTREAM_H_
-
-#include "FileStream.h"
-
-/*! \class ElevationFileStream
- *
- * \brief gère un flux en lecture et écriture  sur le fichier d'altitudes.
- */
-
-class ElevationFileStream: public FileStream<corsenContainers::vecS,float>
-{
-public :
-	ElevationFileStream(const std::string & filePath) : FileStream<corsenContainers::vecS,float>(filePath) {}
-	virtual ~ElevationFileStream(){}
-
-	returnType * read() const throw (FileNotFound, ReadError, InvalidFileFormat, std::bad_alloc)
-	{
-		std::ifstream altFile(_filePath.c_str(),std::ios::binary);
-		if(not altFile)
-			throw FileNotFound("Exception opening file\n "+_filePath);
-
-		if(_format.compare("") == 0)
-			return readStandardFormat(altFile);
-
-		throw InvalidFileFormat("Exception Unknown file format "+_filePath+"\n");
-	}
-
-	returnType * read(const std::string & extension) const throw (FileNotFound, ReadError, InvalidFileFormat, std::bad_alloc)
-	{
-		std::string filePath(_filePath);
-		filePath.append(extension);
-
-		std::ifstream altFile(filePath.c_str(),std::ios::binary);
-		if(not altFile)
-			throw FileNotFound("Exception opening file "+filePath+"\n");
-
-		if(extension.compare(".sav") == 0)
-			return readStandardFormat(altFile);
-
-		throw InvalidFileFormat("Exception Unknown file format "+filePath+"\n");
-	}
-
-
-	void write(const returnType & object, const std::string & extension) const throw (FileNotFound, InvalidFileFormat)
-	{
-		std::string filePath(_filePath);
-		filePath.append(extension);
-		std::ofstream altFile(filePath.c_str(), std::ios::trunc);
-
-		if(not altFile)
-			throw FileNotFound("Exception opening file "+ filePath +"\n");
-
-		if(_format.compare("") == 0)
-			return writeStandardFormat(altFile, object);
-
-		throw InvalidFileFormat("Exception Unknown file format "+ filePath +"\n");
-	}
-
-private :
-	returnType * readStandardFormat(std::ifstream & file) const throw (ReadError, std::bad_alloc)
-	{
-		// get length of file:
-		file.seekg (0, file.end);
-		int length = file.tellg();
-		file.seekg (0, file.beg);
-
-		try
-		{
-			returnType * tmpVec = new returnType();
-			/* double tailleeffective = static_cast<double>(length) / static_cast<double>(sizeof(float)); */
-#ifdef DEBUG
-			std::cout<<"------ ElevationFileStream --------- \n";
-			std::cout<<"Taille en octets : "<<length <<"\nTaille du type de retour : "<<sizeof(float)<<"\nTaille du vec d'élévation : "<<length/sizeof(returnType)
-										<<"\nTaille effective : "<< tailleeffective <<std::endl;
-			std::cout<<"------ ElevationFileStream --------- \n";
-#endif
-			float tmp;
-			do
-			{
-				file.read(reinterpret_cast<char *>(&tmp), sizeof(float));
-				if(not file.eof() and not file.bad())
-					tmpVec->push_back(tmp);
-
-			}
-			while(file.good());
-			if(file.bad() or not file.eof())
-			{
-				file.close();
-				throw ReadError("Exception Reading data"+ _filePath);
-			}
-			file.close();
-			return tmpVec;
-		}
-		catch(std::bad_alloc & e)
-		{
-			throw;
-		}
-
-	}
-
-	void writeStandardFormat(std::ofstream & file, const returnType & object) const throw (std::exception)
-	{
-		float tmp;
-		for(returnType::const_iterator it = object.begin(); it!= object.end() ; ++it)
-		{
-			tmp = *it;
-			file.write(reinterpret_cast<char *>(&tmp), sizeof(float));
-		}
-		file.close();
-	}
-};
-
-
-#endif /* ELEVATIONFILESTREAM_H_ */

+ 0 - 77
src/tests/corsen/lib/Exception.h

@@ -1,77 +0,0 @@
-/*!
- * \file Exception.h
- * \brief Exceptions du programme Corsen.
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- * \date 4 juin 2013
- */
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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 EXCEPTION_H_
-#define EXCEPTION_H_
-
-#include <iostream>
-#include <string>
-#include <stdexcept>
-
-/*! \class FileNotFound
- * \brief Exception - Fichier non trouvé.
- *
- *   Déclenché par le programme pour vous signifier que le fichier recherché n'a pas été trouvé.
- */
-
-class FileNotFound : public std::runtime_error
-{
-public:
-	FileNotFound(const std::string& argv = std::string()) :
-        std::runtime_error(argv)
-    { }
-};
-
-/*! \class ReadError
- * \brief Exception - Erreur de lecture.
- *
- * Déclenché par le programme pour vous signifier qu'une erreur de lecture dans un fichier a été rencontrée.
- */
-
-class ReadError : public std::runtime_error
-{
-public :
-	ReadError(const std::string& argv = std::string()):
-		std::runtime_error(argv)
-	{ }
-};
-
-/*! \class InvalidFileFormat
- * \brief Exception - Format de fichier invalide.
- *
- * Déclenché par le programme pour vous signifier que le format du fichier ne peut pas être interprété par les méthodes de la bibliothèque.
- */
-
-class InvalidFileFormat : public std::runtime_error
-{
-public :
-	InvalidFileFormat(const std::string& argv = std::string()):
-		std::runtime_error(argv)
-	{ }
-};
-
-
-#endif /* EXCEPTION_H_ */

+ 0 - 209
src/tests/corsen/lib/FileStream.h

@@ -1,209 +0,0 @@
-/*!
- * \file FileStream.h
- * \brief modèle de flux sur fichiers applicable à n'importe quelle classe.
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- * \date 11 juin 2013
- */
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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 FILESTREAM_H_
-#define FILESTREAM_H_
-#include <iostream>
-#include <fstream>
-#include <vector>
-#include <boost/algorithm/string.hpp>
-#include "Exception.h"
-#include "Constantes.h"
-
-
-namespace corsenContainers
-{
-struct vecS{};
-struct listS{};
-struct CType {};
-template <class Selector, class ValueType>
-struct container_gen { };
-
-template <class ValueType>
-struct container_gen<vecS, ValueType> {
-	typedef std::vector<ValueType> type;
-};
-template <class ValueType>
-struct container_gen<CType, ValueType> {
-	typedef ValueType type;
-};
-template <class ValueType>
-struct container_gen<listS, ValueType> {
-	typedef std::list<ValueType> type;
-};
-}
-
-template<class container, class valuetype>
-
-/*! \class FileStream
- *
- * \brief est une classe abstraite, elle sert de modèle aux différents lecteurs de fichiers.
- *
- *  La classe gère la lecture et l'ecriture au format standard.
- */
-
-class FileStream
-{
-protected :
-	std::string _filePath; /*!< chemin du fichier*/
-	std::string _format; /*!< format du fichier*/
-public :
-
-	/*!
-	 *  \brief Constructeur
-	 *
-	 *  Constructeur de la classe FileReader, analyse le chemin du fichier afin de déterminer son format.
-	 *
-	 *  \param filePath : chemin du fichier.
-	 *  \return void
-	 */
-
-	FileStream(const std::string & filePath)
-{
-		_filePath = filePath;
-		_format = findFormat(filePath);
-}
-	typedef typename corsenContainers::container_gen<container,valuetype>::type returnType;
-
-	/*!
-	 *  \brief Lecture
-	 *
-	 *  Analyse le format du fichier et lance la méthode de lecture adaptée.
-	 *
-	 *  \return un objet contenant les informations lues.
-	 */
-	virtual returnType * read() const = 0;
-
-	/*!
-	 *  \brief écriture
-	 *
-	 *  Analyse le format du fichier et lance la méthode d'écriture adaptée.
-	 *
-	 *   \param object : objet contenant les informations à écrire
-	 *   \param extension : format du fichier pour la sauvegarde
-	 *   \return void
-	 */
-
-	virtual void write(const returnType & object, const std::string & extension) const = 0;
-
-	/*!
-	 *  \brief Destructeur
-	 *
-	 *  Destructeur de la classe FileStream
-	 */
-	virtual ~FileStream(){}
-
-	const std::string& getFilePath() const
-	{
-		return _filePath;
-	}
-
-	void setFilePath(const std::string& filePath)
-	{
-		_filePath = filePath;
-		_format = findFormat(filePath);
-	}
-
-protected :
-
-	const std::string findFormat(const std::string & filePath) const
-	{
-		std::string format("");
-
-		std::vector<std::string>Vec;
-		std::string reversefilePath(filePath.rbegin(), filePath.rend());
-		boost::split(Vec,reversefilePath,boost::is_any_of("\\/"));
-		if(Vec.size() !=0)
-		{
-			std::string filePathEnd(Vec.at(0).rbegin(),Vec.at(0).rend());
-			Vec.clear();
-			boost::split(Vec, filePathEnd, boost::is_any_of("."));
-			if(isHiddenFile(filePathEnd))
-			{
-				for(unsigned int i = 2; i<Vec.size();i++)
-					format+="."+Vec.at(i);
-			}
-			else
-			{
-				for(unsigned int i = 1; i<Vec.size();i++)
-					format+="."+Vec.at(i);
-			}
-		}
-		else
-		{
-			boost::split(Vec, _filePath, boost::is_any_of("."));
-			if(isHiddenFile(_filePath))
-			{
-				for(unsigned int i = 2; i<Vec.size();i++)
-					format+="."+Vec.at(i);
-			}
-			else
-			{
-				for(unsigned int i = 1; i<Vec.size();i++)
-					format+="."+Vec.at(i);
-			}
-		}
-
-		return format;
-	}
-
-	bool isHiddenFile(const std::string & filePath) const
-	{
-		if(filePath.substr(0,1).compare(".") == 0)
-			return true;
-
-		return false;
-	}
-
-private:
-
-
-	/*!
-	 *  \brief Lecture au format standard
-	 *
-	 *  Lecture des données du fichier selon un formatage particulier .
-	 *
-	 * \param file fichier dans lequel lire les données.
-	 *  \return l'objet contenant les informations lues.
-	 */
-
-	virtual returnType * readStandardFormat(std::ifstream & file) const = 0;
-	/*!
-	 *  \brief écriture au format standard
-	 *
-	 *  Écriture des données dans le fichier selon un formatage particulier.
-	 *
-	 *  \param file fichier dans lequel écrire les données.
-	 *  \param object l'objet contenant les informations à écrire.
-	 *  \return void
-	 */
-
-	virtual void writeStandardFormat(std::ofstream & file, const returnType & object) const = 0;
-
-};
-
-
-#endif /* FILESTREAM_H_ */

+ 0 - 173
src/tests/corsen/lib/Functions.cpp

@@ -1,173 +0,0 @@
-/*!
- * \file Functions.cpp
- * \brief
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- */
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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/>.
- */
-
-#include <ctype.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include "Functions.h"
-
-#define COMMENTC     '#'
-
-char * programName;
-char * workingDirectory;
-
-void Functions::fatalError(const char* s, int erreurcode)
-{
-     fprintf( stderr,"Erreur fatale: %s > arret de %s\n", s?s:"", programName);
-
-     /*  avant de retourner  dans le repertoire d'ou TNT est appele */
-     if (workingDirectory)
-          chdir(workingDirectory);
-     exit(erreurcode);
-}
-
-
-//void Functions::handleError(const char* s)
-//{
-//     switch(errno) {
-//     case 0:  /* il n'y a pas d'erreur,   */
-//          fprintf(stderr,"%s: CECI NE DEVRAIT PAS ARRIVER il n'y a pas d'erreur!!\n",s?s:"");
-//          break;
-//
-//     case EPERM:  /*non super" utilisateur */
-//          fprintf( stderr,"%s: acces refuse: il faut etre Super Utilisateur pour ce faire!\n",s?s:"");
-//          break;
-//
-//     case 	ENOENT:		/* No such file or directory	*/
-//          fprintf( stderr," %s: Fichier/Repertoire inexistant\n", s?s:"");
-//          break;
-//
-//     case 	ENOMEM:		/* No enough memory 	*/
-//          fatalError("pas assez de memoire", errno);
-//          break;
-//
-//     case 	ENXIO:	/* No such device or address */
-//          fprintf( stderr,"%s: adresse/peripherique inexistant\n", s?s:"");
-//          break;
-//
-//     case 	EAGAIN : /* Resource temporarily unavailable*/
-//          fprintf( stderr,"%s: ressources momentanement indisponibles\n",s?s:"");
-//          break;
-//
-//     case 	EACCES : /* Permission denied	*/
-//          fprintf( stderr,"%s: acces refuse, vos droits sont limites\n", s?s:"");
-//          break;
-//
-//     case 	EEXIST :  /* File exists	*/
-//          fprintf( stderr,"%s : fichier/repertoire deja existant\n",s?s:"");
-//          break;
-//
-//     case 	ENODEV : /* No such device	*/
-//          fprintf( stderr,"%s: peripherique inexistant\n", s?s:"");
-//          break;
-//
-//     case 	ENOTDIR: /* Not a directory	*/
-//          fprintf( stderr,"%s: n'est pas un repertoire\n", s?s:"");
-//          break;
-//
-//     case 	EISDIR : /* Is a directory	*/
-//          fprintf( stderr,"%s: est un repertoire\n", s?s:"");
-//          break;
-//
-//     case 	EINVAL : /* Invalid argument	*/
-//          fprintf( stderr,"%s : valeur de l'argument passe  inacceptable\n",s?s:"");
-//          break;
-//
-//     case 	ENOTTY : /* Inappropriate ioctl for device */
-//          fprintf( stderr,"%s : fonction inadaptee pour ce peripherique\n",s?s:"");
-//          break;
-//
-//     case 	EFBIG  : /* File too large	*/
-//          fprintf( stderr,"%s : fichier trop grand\n",s?s:"");
-//          break;
-//
-//     case 	ENOSPC : /* No space left on device	*/
-//          fprintf( stderr,"%s: plus de place disponible sur le peripherique\n",s?s:"");
-//          break;
-//
-//     case 	EROFS  : /* Read only file system	*/
-//          fprintf( stderr,"%s : systeme de fichier monte en mode lecture seule\n",s?s:"");
-//          break;
-//
-//     case 	EDOM   : /* Math arg out of domain of func*/
-//          fprintf(stderr,"%s: argument hors du domaine de definition fonc. math\n",s?s:"");
-//          break;
-//
-//     case 	ERANGE : /* Math result not representable*/
-//          fprintf( stderr,"%s : resultat non significatif\n",s?s:"");
-//          break;
-//
-//     case 	EOVERFLOW : /* vue too large to be stored in data type */
-//          fprintf( stderr,"%s : Resultat hors gabarit, trop grand\n",s?s:"");
-//          break;
-//
-//     default :
-//          fprintf( stderr,"Une erreur non geree par %s est survenue. errno = %d\n",programName, errno);
-//          break;
-//     }
-//}
-//
-//void Functions::ignorelf( char *s)
-//{
-//     char *p = s-1;
-//
-//     while(*++p && (*p != '\r' && *p != '\n')) {}
-//     *p ='\0';
-//}
-
-//bool Functions::isComment(char *s)
-//{
-//     char *p = s;
-//
-//     ignorelf(s);   /* ignore le caractere fin-de-ligne LF ou CR*/
-//     /* ignore les espaces d'en-tete */
-//     while(*p and isspace(*p)) {
-//          ++p;
-//     }
-//
-//     return *p == COMMENTC or *p == '\0';
-//}
-
-//FILE* Functions::openFile(const char* nom, const char* mode)
-//{
-//     FILE * fp;
-//
-//     if ((fp = fopen (nom,mode)) == NULL) {
-//          handleError(nom);
-//          fatalError(nom, errno);
-//     }
-//     return(fp);
-//}
-
-//bool is_reseau(int lig, int col)
-//{
-//     return getmatbit(Mcouche[numero_couche_riviere], lig, col);
-//}
-
-
-
-

+ 0 - 86
src/tests/corsen/lib/Functions.h

@@ -1,86 +0,0 @@
-/*!
- * \file Functions.h
- * \brief
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- */
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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 FUNCTIONS_H_
-#define FUNCTIONS_H_
-
-#include <stdio.h>
-#include "Parameters.h"
-#include "Coordinates.h"
-
-class Functions {
-
-public :
-
-
-	/*!
-	 *  \brief Retourner un bit d'un entier.
-	 *
-	 * \param n : Entier ou chercher le bit .
-	 * \param b : Nombre de décalage binaire à effectuer.
-	 * \return la valeur du bit b du nombre n.
-	 */
-
-	static int getvalbit (int n, unsigned b)
-	{
-		return ((n>>b) & 1) ;
-	}
-
-	/*!
-	 *  \brief Affecte la valeur 1 au bit b du nombre pointé par n.
-	 *
-	 * \param n : Entier à modifier .
-	 * \param b : Nombre de décalage binaire à effectuer.
-	 * \return void.
-	 */
-
-	static void valbiton (int * n, unsigned b)
-	{
-		*n |= 1<<b ;
-	}
-
-	/*!
-	 *  \brief Affecte la valeur 0 au bit b du nombre pointé par n.
-	 *
-	 * \param n : Entier à modifier .
-	 * \param b : Nombre de décalage binaire à effectuer.
-	 * \return void.
-	 */
-
-	static void valbitoff (int *n, unsigned b)
-	{
-		*n &= ~(1<<b) ;
-	}
-
-	static void fatalError(const char* s, int erreurcode);
-	//static void ignorelf(char *s);
-	//static bool isComment(char *s);
-	//static bool isNetwork(int lig, int col);
-	//static FILE* openFile(const char *nom, const char *mode);
-	//static void handleError(const char* s);
-
-};
-
-#endif /* FUNCTIONS_H_ */

+ 0 - 230
src/tests/corsen/lib/Graph.cpp

@@ -1,230 +0,0 @@
-/**
- *
- * \file Graph.cpp
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- * \date 30 mai 2013
- * \brief Générateur du graphe représentant un bassin versant.
- */
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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/>.
- */
-
-#include "Graph.hpp"
-
-Graph::Graph(): _isolatedVertices(0), _param(NULL)
-{ }
-
-void Graph::build(std::vector<float> * elevationMatrix, Parameters * p)
-{
-    _param = p;
-
-    int counter = 0;
-    for (int i = 0 ; i < p->_linesNumber; i++) {
-        for (int j = 0 ; j < p->_columnsNumber ; j++) {
-            if (elevationMatrix->at(i*p->_columnsNumber+j) > ALTMER) {
-                _vertices[i * p->_columnsNumber + j] =
-                    Vertex(i * p->_columnsNumber + j,
-                           Coordinates(i, j),
-                           elevationMatrix->at(i * p->_columnsNumber + j));
-                counter++;
-            }
-        }
-    }
-
-    std::vector < Vertex* > tmpVertices;
-
-    for(std::map < int, Vertex >::iterator it = _vertices.begin();
-        it!=_vertices.end(); it++) {
-        for (int i = it->second.getCoord().getLine() - 1 ;
-             i <= it->second.getCoord().getLine() +1 ; i++) {
-            for (int j = it->second.getCoord().getColumn() - 1 ;
-                 j <= it->second.getCoord().getColumn()  + 1 ; j++) {
-                if (Coordinates(i,j).isValid(p) &&
-                    (not it->second.getCoord().isSameLine(i) ||
-                     not it->second.getCoord().isSameColumn(j))) {
-                    tmpVertices.push_back(
-                        &_vertices[i * p->_columnsNumber + j]);
-                }
-            }
-        }
-        it->second.setNeighbours(tmpVertices);
-        tmpVertices.clear();
-    }
-    buildMesh();
-    buildTablelandsMeshes() ;
-}
-
-void Graph::display()
-{
-    //const char* name = "ABCDEF";
-    int tablelandsCounter = 0;
-
-    //std::cout << "vertex set: ";
-    //boost::print_vertices(_gno, name);
-    //std::cout << std::endl;
-    //
-    //std::cout << "edge set: ";
-    //boost::print_edges(_gno, name);
-    //std::cout << std::endl;
-    //
-    //std::cout << "incident edges: " << std::endl;
-    //boost::print_graph(_gno, name);
-    //std::cout << std::endl;
-
-    for (std::map < int, Vertex >::iterator it = _vertices.begin();
-         it != _vertices.end(); it++) {
-        if (it->second.getMp() == 'v')
-            tablelandsCounter++ ;
-    }
-
-    DirectedGraph::vertex_iterator beginV, endV;
-    DirectedGraph::adjacency_iterator beginA, endA;
-
-    std::cout << "edge set: \n";
-    boost::tie(beginV, endV) = boost::vertices(_go);
-    for(; beginV!=endV; beginV++)
-    {
-        std::cout<<*beginV<<" -> ";
-        boost::tie(beginA,endA) = boost::adjacent_vertices(*beginV,_go);
-        for(; beginA!=endA; beginA++)
-        {
-            std::cout<<*beginA<<" ";
-        }
-        std::cout<<"\n";
-    }
-
-    std::cout<<"vertices number : "<<boost::num_vertices(_go)<<"\n";
-    std::cout<<"edges number : "<<boost::num_edges(_go)<<"\n";
-    std::cout<<"meshes number of tableland type :"<<tablelandsCounter<<std::endl;
-}
-
-void Graph::buildMesh()
-{
-    std::vector<Vertex *>tmpNeighbours;
-
-    for(std::map<int,Vertex>::iterator it = _vertices.begin(); it!=_vertices.end();it++)
-    {
-        if(it->second.getElevation() > ALTMER)
-        {
-            if(it->second.sigma(Vertex::elevation) <= EPSALT && not it->second.getCoord().isOnShore(_param) && not it->second.isOnSeaside())
-                it->second.setMp('p');
-            else
-            {
-                createVertex(it->second);
-                tmpNeighbours = it->second.getNeighbours();
-                for(std::vector<Vertex *>::iterator itNeighbours = tmpNeighbours.begin(); itNeighbours != tmpNeighbours.end(); itNeighbours++)
-                {
-                    if ((*itNeighbours)->getElevation() > ALTMER && ((it->second.getElevation() - (*itNeighbours)->getElevation()) > EPSALT))
-                    {
-                        createVertex(**itNeighbours);
-                        createEdge((*itNeighbours), it->second,  (*itNeighbours)->tanBxL(&it->second, Vertex::elevation) / it->second.sigma(Vertex::elevation)) ;
-                    }
-                }
-            }
-        }
-    }
-}
-
-void Graph::buildTablelandsMeshes()
-{
-    int nbi;
-
-    for(std::map<int, Vertex>::iterator it = _vertices.begin(); it!=_vertices.end(); it++)
-    {
-        if (it->second.getMp() == 'p')
-        {
-            it->second.setMp('v');
-            nbi = 0;
-            searchOutlet (it->second, nbi) ;
-            // if ( nbi == 0)
-                // std::cerr<<"\n"<<_isolatedVertices++ <<" Impossible de sortir du plateau "<<it->second.toString()<<"\t"<<" and "<< nbi <<"issue(s)."<<std::endl;
-
-            computeGeodesic() ;
-            addTablelandsEdges() ;
-            for(std::vector<Vertex *>::iterator it = _tablelandVertices.begin(); it!=_tablelandVertices.end(); it++)
-                (**it).setDerive(-999999.0);
-            _tablelandVertices.clear();
-        }
-    }
-}
-
-void Graph::searchOutlet(Vertex & m, int nbi)
-{
-    std::vector<Vertex *>tmpNeighbours = m.getNeighbours();
-
-    for(std::vector<Vertex *>::iterator itNeighbours = tmpNeighbours.begin(); itNeighbours != tmpNeighbours.end(); itNeighbours++)
-    {
-        if (fabs((**itNeighbours).getElevation() - m.getElevation()) < 0.0001)
-        {
-            if ((**itNeighbours).getMp() == 'p')
-            {
-                (**itNeighbours).setMp('v');
-                searchOutlet(**itNeighbours, nbi) ;
-            }
-            else if ((**itNeighbours).getMp() == 'n')
-            {
-                (**itNeighbours).setDerive(1.);
-                nbi++;
-                (**itNeighbours).setMp('i');
-                _tablelandVertices.push_back((*itNeighbours));
-            }
-        }
-    }
-}
-
-void Graph::computeGeodesic()
-{
-    std::vector<Vertex *>tmpNeighbours;
-    int i = 0;
-    while(_tablelandVertices.begin() + i != _tablelandVertices.end())
-    {
-        tmpNeighbours = _tablelandVertices.at(i)->getNeighbours();
-
-        for(std::vector<Vertex *>::iterator itNeighbours = tmpNeighbours.begin(); itNeighbours != tmpNeighbours.end(); itNeighbours++)
-        {
-            if ((**itNeighbours).getMp() == 'v')
-            {
-                (**itNeighbours).setDerive(_tablelandVertices.at(i)->getDerive() + 1.);
-                (**itNeighbours).setMp('g');
-                _tablelandVertices.push_back(*itNeighbours);
-            }
-        }
-        i++;
-    }
-}
-
-void Graph::addTablelandsEdges()
-{
-    std::vector<Vertex *>tmpNeighbours;
-
-    for (std::vector<Vertex *>::iterator it = _tablelandVertices.begin(); it!=_tablelandVertices.end(); ++it)
-    {
-        createVertex(**it);
-        tmpNeighbours = (**it).getNeighbours();
-
-        for(std::vector<Vertex *>::iterator itNeighbours = tmpNeighbours.begin(); itNeighbours != tmpNeighbours.end(); itNeighbours++)
-        {
-            if ((**itNeighbours).getDerive() > ALTMER && (**itNeighbours).getDerive() < (**it).getDerive())
-            {
-                createVertex(**itNeighbours);
-                createEdge((*itNeighbours), **it,  (*itNeighbours)->tanBxL(*it, Vertex::derive) / (*it)->sigma(Vertex::derive)) ;
-            }
-        }
-    }
-}

+ 0 - 200
src/tests/corsen/lib/Graph.hpp

@@ -1,200 +0,0 @@
-/**
- *
- * \file Graph.hpp
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- * \date 30 mai 2013
- * \brief Générateur du graphe représentant un bassin versant.
- */
-
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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 GRAPH_HPP_
-#define GRAPH_HPP_ 1
-
-#include <iostream>
-#include <fstream>
-#include <stack>
-#include <utility>
-#include <unistd.h>
-#include <cstdio>
-#include <iterator>
-#include <list>
-#include <vector>
-#include <map>
-#include <string>
-#include <algorithm>
-#include <boost/array.hpp>
-#include <boost/format.hpp>
-#include "boost/graph/topological_sort.hpp"
-#include <boost/graph/adjacency_list.hpp>
-#include <boost/graph/graph_utility.hpp>
-#include <boost/version.hpp>
-#include <boost/graph/graph_traits.hpp>
-#include <boost/graph/graph_concepts.hpp>
-#include <boost/concept/assert.hpp>
-#include <boost/graph/adjacency_iterator.hpp>
-#include <boost/config.hpp>
-#include <boost/limits.hpp>
-#include "Constantes.h"
-#include "Vertex.h"
-#include "Exception.h"
-#include "Parameters.h"
-
-/*! \class Graph
- * \brief représente un bassin versant sous forme de graphe.
- *
- *  La classe détermine le maillage du bassin versant. Pour effectuer
- *  cela, la classe crée un objet de type boost::graph et le complète
- *  en y ajoutant des sommets et des arcs.
- */
-
-class Graph
-{
-public:
-
-    /*!
-     *  \brief Constructeur
-     *
-     *  initialisation de certains attributs.
-     */
-    Graph();
-
-    virtual ~Graph()
-    { }
-
-    /*!
-     *  \brief Construction du graphe.
-     *
-     *  Méthode qui crée les sommets et génère le boost::graph en fonction des
-     *  données contenues dans ceux-ci.
-     *
-     *  \param elevationMatrix : données d'altitudes du bassin versant
-     *  \param p : paramètres du programme.
-     */
-    void build(std::vector<float> * elevationMatrix, Parameters * p);
-
-    const DirectedGraph& graph() const
-    { return _go; }
-
-    /*!
-     * \brief Afficher
-     *
-     *  Affiche les sommets, les arêtes et les arêtes incidentes.
-     */
-    void display();
-
-private:
-
-    /*!
-     * \brief Créer arc.
-     *
-     * Crée un nouvel arc entre deux sommets, il sera ajouté au
-     * vecteur d'arcs du boost Graph.
-     * \param Source : arc sortant
-     * \param Dest : arc entrant
-     * \param pourcent : ratio entre le poids du sommet et la somme
-     * des poids de ses sommets voisins.
-     */
-    void createEdge(Vertex * src , Vertex & dst, float pourcent)
-    {
-        boost::add_edge(src->getBoostGraphIdentifier(),
-                        dst.getBoostGraphIdentifier(),
-                        EdgeProperties(0., 0., pourcent),_go);
-    }
-
-    /*!
-     * \brief Créer sommet.
-     *
-     * Crée un nouveau sommet si inexistant, il sera ajouté au vecteur
-     * de sommets du boost Graph.
-     *
-     */
-    void createVertex(Vertex & m)
-    {
-        if (m.getBoostGraphIdentifier() == 4294967295)
-            m.setBoostGraphIdentifier(
-                boost::add_vertex(VertexProperties(
-                                      (boost::format("p_%1%") %
-                                       (m.getIdentifier())).str(),
-                                      m.getIdentifier(),
-                                      m.getCoord()),_go));
-    }
-
-    /*!
-     * \brief Construire maillage.
-     *
-     * 	Classement des sommets du bassin versant selon leur dénivellation.
-     * 	Ajout d'arcs au graphe selon plusieurs critères :
-     * 	 - La positionnement des sommets.
-     * 	 - La dénivellation entre les sommets.
-     */
-    void buildMesh();
-
-    /*!
-     * \brief Construire maillages plateaux
-     *
-     * Ajout d'arcs au graphe selon plusieurs critères :
-     *  - Le positionnement des sommets.
-     * 	- L'absence ou la faible dénivellation entre les sommets.
-     */
-    void buildTablelandsMeshes();
-
-    /*!
-     * \brief Rechercher exutoire
-     *
-     * Ajout dans la liste les sommets dits 'exutoire' du plateau étudié.
-     *
-     */
-    void searchOutlet(Vertex & m, int nbi);
-
-    /*!
-     * \brief Calculer géodésique.
-     *
-     *  Calcule le chemin le plus court, ou l'un des plus courts
-     *  chemins s'il en existe plusieurs, entre deux sommets du bassin versant.
-     */
-
-    void computeGeodesic();
-
-    /*!
-     * \brief Ajouter des arcs au maillage plateau.
-     *
-     * Ajout d'arcs au graphe reliant les sommets entre eux selon
-     * plusieurs critères :
-     *  - Leur positionnement.
-     * 	- L'absence ou la faible dénivellation entre eux.
-     */
-
-    void addTablelandsEdges();
-
-    DirectedGraph            _go; /*!< Graphe Orienté */
-    std::map < int, Vertex > _vertices; /*!< Sommets du bassin versant */
-    std::vector < Vertex* >  _tablelandVertices; /*!< Ensemble de
-                                                  * sommets du bassin
-                                                  * versant qui une
-                                                  * fois reliés forme
-                                                  * un maillage 'plateau' */
-    int                      _isolatedVertices; /*!< Nombre de sommets sans
-                                                 * exutoire du bassin versant */
-    const Parameters*        _param; /*!< Paramètres du programme */
-};
-
-#endif /* GRAPHE_HPP_ */

+ 0 - 282
src/tests/corsen/lib/Layer.h

@@ -1,282 +0,0 @@
-/**
- *
- * \file Layer.h
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- * \date 3 juin 2013
- */
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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 LAYER_H_
-#define LAYER_H_
-
-#include <iostream>
-#include <fstream>
-#include <boost/lexical_cast.hpp>
-#include <boost/algorithm/string.hpp>
-#include <boost/tokenizer.hpp>
-#include "Constantes.h"
-#include "Exception.h"
-#include "Functions.h"
-
-class Layer
-{
-private :
-
-	std::string _label ;
-	int _color ;
-	int _active ;
-	int _type ;
-	bool _modified ;
-	unsigned char * _data; /*!< données sur couches */
-
-public :
-	Layer():_label(""),_color(0),_active(0),_type(0),_modified(0), _data(NULL){}
-	Layer(std::string label, int color,int active,int type, bool modified)
-	{
-		_label = label;
-		_color = color;
-		_active = active;
-		_type = type;
-		_modified = modified;
-		_data = NULL;
-	}
-
-	Layer(std::string & label, int color,int active,int type, bool modified)
-	{
-		_label = label;
-		_color = color;
-		_active = active;
-		_type = type;
-		_modified = modified;
-		_data = NULL;
-	}
-	Layer(const Layer & c)
-	{
-		_label = c.getLabel();
-		_color = c.getColor();
-		_active = c.getActive();
-		_type = c.getType();
-		_modified = c.isModified();
-		_data = c.getData();
-	}
-	/*!
-	 *
-	 * \brief Constructeur
-	 *
-	 * Constructeur avec paramètres de la classe Layer, remplit les attributs de la classe avec les données de 'ligne'.
-	 *
-	 * \param ligne : chaîne de caractères contenant des informations pour la classe
-	 * \return void
-	 */
-
-	Layer(const std::string & line)
-	{
-		_data = NULL ;
-
-		using boost::lexical_cast ;
-		using boost::bad_lexical_cast ;
-
-		boost::char_separator<char> sep("\"");
-		boost::tokenizer <boost::char_separator<char> >tokens(line,sep);
-
-		boost::tokenizer<boost::char_separator<char> >::iterator it = tokens.begin();
-		_label = *it;
-		++it;
-
-		try
-		{
-			_color = lexical_cast<int>(*it);
-			_active =  lexical_cast<int>(*it);
-			_type = lexical_cast<int>(*it);
-		}
-
-		catch(const bad_lexical_cast & e)
-		{
-			std::cerr<<e.what();
-		}
-
-		_modified = false ;
-	}
-
-	bool operator==(const Layer& layer) const
-							{ return (_type == layer.getType() and (_type == CONTOUR_BASSIN or _type == RESEAU_HYDRO or _type == EXUTOIRES));}
-
-	void toTextFile(std::ofstream & file) const
-	{
-		file<<"\""<<_label<<"\""<<" "<<_color<<" "<<_active<<" "<<_type<<"\n";
-	}
-
-	~Layer()
-	{
-		if(_data !=NULL)
-			delete [] _data;
-	}
-
-	int getActive() const
-	{
-		return _active;
-	}
-
-	int getColor() const
-	{
-		return _color;
-	}
-
-	const std::string& getLabel() const
-	{
-		return _label;
-	}
-
-	bool isModified() const
-	{
-		return _modified;
-	}
-
-	int getType() const
-	{
-		return _type;
-	}
-
-	void setLabel(const std::string& label) {
-		_label = label;
-	}
-
-	void setColor(int couleur) {
-#ifdef IHM
-		_color = couleur;
-#endif
-	}
-
-	void setActive(int active)
-	{
-		_active = active;
-	}
-
-	void setType(int type)
-	{
-		_type = type;
-	}
-
-	static void fill(std::vector<Layer> & layers)
-	{
-		layers.push_back(Layer(std::string("Reseau Hydrographique"), 0,0,RESEAU_HYDRO,false));
-		layers.push_back(Layer(std::string("Contour des Bassins Versants"), 0,0,CONTOUR_BASSIN,false));
-		layers.push_back(Layer(std::string(""), 0,0,CONTOUR_IMAGE_BINAIRE,false));
-		layers.push_back(Layer(std::string("Exutoires du Reseau Hydro"), 0,0,EXUTOIRES,false));
-	}
-
-	static int find(std::vector<Layer> & layers, int type)
-	{
-		for(unsigned short int  i = 0; i < layers.size(); i++)
-		{
-			if(layers.at(i).getType() == type && (type == CONTOUR_BASSIN || type == RESEAU_HYDRO || type == EXUTOIRES))
-				return i;
-		}
-
-		return -1 ;
-	}
-
-	const std::string toString() const
-	{
-		std::stringstream ss;
-		ss <<"label "<<_label <<" couleur "<<_color<<" active "<<_active<<" type"<<_type;
-		return ss.str();
-	}
-
-	void display(Parameters * p) const
-	{
-		std::cout<<toString()<<std::endl;
-
-		std::cout<<"Données Couches "<<std::endl;
-
-		for(int i = 0; i< p->_linesNumber; i++)
-		{
-			for(int j = 0; j< p->_columnsNumber; j++)
-			{
-				std::cout<<isNetwork(Coordinates(p->_linesNumber - 1 - i , j),p )<<std::endl;
-			}
-			std::cout<<"\n";
-		}
-	}
-
-	unsigned char* getData() const
-	{
-		return _data;
-	}
-
-	void setData(unsigned char* data)
-	{
-		_data = data;
-	}
-
-	/*!
-	 *  \brief Retourner le bit de coordonnées i, j d'une matrice
-	 *
-	 * \param m : matrice des couches.
-	 * \param c : Coordonnées 2D afin de se situer dans la matrice.
-	 * \param p : Paramètres du bassin versant.
-	 * \return la valeur du bit correspondant au pixel i, j dans la matrice m.
-	 */
-
-	bool getmatbit (const Coordinates & c, const Parameters * p) const
-	{
-		return (((*( _data + (c.getLine() *p->_charColumnsNumber+(c.getColumn()>>3))))>>(c.getColumn()&7)) & 1);
-	}
-
-	/*!
-	 *  \brief Affecte la valeur 1 au bit correspondant au pixel i, j dans la matrice m.
-	 *
-	 * \param m : Matrice des couches.
-	 * \param c : Coordonnées 2D afin de se situer dans la matrice.
-	 * \param p : Paramètres du bassin versant.
-	 * \return void.
-	 */
-
-	void matbiton (const Coordinates & c, const Parameters * p)
-	{
-		*(_data + (c.getLine() * p->_charColumnsNumber +(c.getColumn()>>3))) |= 1<<(c.getColumn()&7);
-	}
-
-
-	/*!
-	 *  \brief Affecte la valeur 0 au bit correspondant au pixel i, j dans la matrice m.
-	 *
-	 * \param m : Matrice des couches.
-	 * \param c : Coordonnées 2D afin de se situer dans la matrice.
-	 * \param p : Paramètres du bassin versant.
-	 * \return void.
-	 */
-
-	void matbitoff (Coordinates &c, const Parameters * p)
-	{
-		*(_data + (c.getLine() * p->_charColumnsNumber + (c.getColumn()>>3))) &= ~(1<<(c.getColumn()&7)) ;
-	}
-
-
-	bool isNetwork(const Coordinates & c, const Parameters * p) const
-	{
-		return getmatbit(c, p);
-	}
-};
-
-
-
-#endif /* LAYER_H_ */

+ 0 - 121
src/tests/corsen/lib/LayersFileStream.h

@@ -1,121 +0,0 @@
-/*!
- * \file LayersFileStream.h
- * \brief Flux binaire sur le fichier de couches.
- * \author The VLE Development Team
- *  See the AUTHORS or Authors.txt file
- * \version 2.0
- * \date 3 juin 2013
- */
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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 LAYERSFILESTREAM_H_
-#define LAYERSFILESTREAM_H_
-
-#include <sstream>
-#include "FileStream.h"
-#include "Parameters.h"
-
-/*! \class LayersFileStream
- *
- * \brief gère un flux en lecture et écriture sur le fichier de couches.
- *
- */
-
-class LayersFileStream : public FileStream<corsenContainers::CType,unsigned char>
-{
-private :
-	Parameters * _param;
-
-
-public :
-	LayersFileStream(const std::string & filePath, Parameters * param) : FileStream<corsenContainers::CType,unsigned char>(filePath)
-	{
-		_param = param;
-
-	}
-
-	returnType * read() const throw (FileNotFound, ReadError, InvalidFileFormat, std::bad_alloc)
-	{
-
-		std::ifstream layersFile(_filePath.c_str() ,std::ios::binary);
-		if(!layersFile)
-			throw FileNotFound("Exception opening File : "+_filePath);
-
-		if(_format.compare("") == 0 )
-			return readStandardFormat(layersFile);
-
-		throw InvalidFileFormat("Exception Unknown file format "+ _filePath +"\n");
-	}
-
-	void write(const returnType & /* object */,
-		   const std::string & /* extension */) const
-	{
-
-	}
-
-	virtual ~LayersFileStream()
-	{
-
-	}
-
-
-private :
-	returnType * readStandardFormat(std::ifstream & file) const throw (ReadError, std::bad_alloc)
-	{
-		unsigned char * c;
-		try
-		{
-			c = new unsigned char[_param->_linesNumber * _param->_charColumnsNumber + 1];
-		}
-		catch(std::bad_alloc & e)
-		{
-			throw;
-		}
-		int i =0;
-		do
-		{
-			file.read(reinterpret_cast<char *>(&c[i]),sizeof(unsigned char));
-			i++;
-		}
-		while(i != (_param->_linesNumber * _param->_charColumnsNumber));
-
-		if(file.bad() /*or not file.eof()*/)
-		{
-			std::stringstream ss;
-			ss << file.gcount();
-			file.close();
-			throw ReadError("Exception Reading data only "+ss.str()+" could be read "+_filePath);
-		}
-#ifdef DEBUG
-		std::cout << "LayersFileStream : all characters read successfully.\n";
-#endif
-		file.close();
-		c[_param->_linesNumber * _param->_charColumnsNumber] = '\0';
-		return c;
-	}
-
-	void writeStandardFormat(std::ofstream & /* file */,
-				 const returnType & /* object */) const
-	{
-
-	}
-};
-
-
-#endif /* LAYERSFILESTREAM_H_ */

+ 0 - 141
src/tests/corsen/lib/LayersTextFileStream.h

@@ -1,141 +0,0 @@
-/**
- * \file LayersTextFileStream.h
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- * \date 3 juin 2013
- * \brief Flux texte sur fichier de couches.
- */
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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 LAYERSTEXTFILESTREAM_H_
-#define LAYERSTEXTFILESTREAM_H_
-
-#include <iostream>
-#include <vector>
-#include <list>
-#include <cstdlib>
-#include <cstdio>
-#include <stdbool.h>
-#include <string>
-#include <sstream>
-#include "FileStream.h"
-#include "Layer.h"
-#include "Constantes.h"
-
-/*! \class LayersTextFileStream
- *
- * \brief gère un flux texte en lecture et écriture sur le fichier de couches.
- */
-
-class LayersTextFileStream : public FileStream<corsenContainers::vecS,Layer>
-{
-
-public :
-	LayersTextFileStream(std::string & filePath)  : FileStream<corsenContainers::vecS,Layer>(filePath) {}
-	virtual ~LayersTextFileStream() {}
-
-public :
-
-	/*!
-	 * \brief Lecture
-	 *
-	 * Ouvre le fichier de couches et lance la méthode de lecture adaptée.
-	 * \param void
-	 * \return l'objet contenant les données lues.
-	 */
-
-	returnType * read() const throw (FileNotFound, InvalidFileFormat)
-	{
-		std::ifstream file(_filePath.c_str(),std::ios::in);
-
-		if(not file)
-			throw FileNotFound("Exception opening file\n "+_filePath);
-
-		if(_format.compare("") == 0)
-			return readStandardFormat(file);
-
-		throw InvalidFileFormat("Exception Unknown file format "+_filePath+"\n");
-	}
-
-	/*!
-	 * \brief Écriture
-	 *  Ouvre le fichier de couches et lance la méthode d'écriture adaptée.
-	 *  \param object : objet contenant les informations à écrire
-	 *  \param extension : format du fichier pour la sauvegarde
-	 *  \return void
-	 */
-
-	void write(const returnType & object, const std::string & extension) const throw (FileNotFound, InvalidFileFormat)
-	{
-		std::string filePath(_filePath);
-		filePath.append(extension);
-		std::ofstream file(filePath.c_str() ,std::ios::app);
-
-		if(not file)
-			throw ("Exception opening file\n "+ filePath);
-
-		if(_format.compare("") == 0)
-			return writeStandardFormat(file, object);
-
-		throw InvalidFileFormat("Exception Unknown file format "+ filePath + "\n");
-	}
-
-private:
-
-	/*!
-	 * \brief Lecture au format standard
-	 *
-	 * Lit dans le fichier '_filePath' le label et la couleur des couches de segments raster.
-	 * \param file fichier dans lequel lire les données.
-	 * \return l'objet contenant les données lues.
-	 */
-
-	returnType * readStandardFormat(std::ifstream & file) const
-	{
-		std::string line;
-		std::vector<Layer> * layers = new std::vector<Layer>();
-
-		while(std::getline(file,line))
-			layers->push_back(Layer(line));
-
-		file.close();
-
-		return layers;
-	}
-
-	/*!
-	 * \brief Écriture au format standard
-	 *
-	 * Écrit dans le fichier '_filePath' le label et la la couleur des couches de segments raster.
-	 * \param file fichier dans lequel écrire les données.
-	 * \param object l'objet contenant les informations à écrire.
-	 * \return void
-	 */
-
-	void writeStandardFormat(std::ofstream & file, const returnType & object) const
-	{
-		for (std::vector<Layer>::const_iterator it = object.begin(); it!= object.end(); it++)
-			it->toTextFile(file);
-	}
-
-};
-
-
-#endif /* LAYERSTEXTFILESTREAM_H_ */

+ 0 - 149
src/tests/corsen/lib/Node.h

@@ -1,149 +0,0 @@
-/*!
- * \file Node.h
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- * \date 3 juin 2013
- */
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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 NODE_H_
-#define NODE_H_
-
-#include "Coordinates.h"
-#include <list>
-class Node
-{
-protected :
-	Coordinates _coord;
-	Node * _father;
-	Node * _child;
-	Node * _brother;
-
-public :
-
-	Node(): _coord()
-{
-		_father = NULL;
-		_child = NULL;
-		_brother = NULL;
-}
-
-	Node(const Node & n)
-	{
-		_coord = n.getCoord();
-		_father = n.getFather();
-		_child = n.getChild();
-		_brother = n.getBrother();
-	}
-
-	Node(const Coordinates & c, Node * father) :_coord(c)
-	{
-		_father = father;
-		_child = NULL;
-		_brother = NULL;
-	}
-
-	virtual ~Node(){}
-
-	void setPere(Node * pere)
-	{
-		_father = pere;
-	}
-
-	void setCoord(const Coordinates& coord)
-	{
-		_coord = coord;
-	}
-
-	const Coordinates& getCoord() const
-	{
-		return _coord;
-	}
-
-	Node * getChild() const
-	{
-		return _child;
-	}
-
-	Node * getBrother() const
-	{
-		return _brother;
-	}
-
-	Node * getFather() const
-	{
-		return _father;
-	}
-
-	void setChild(Node *  child)
-	{
-		_child = child;
-	}
-
-	void setBrother(Node *  brother)
-	{
-		_brother = brother;
-	}
-
-	const std::string toString() const
-	{
-		std::stringstream ss;
-
-		ss <<"coordonnes du noeud : "<<_coord.toString()<<"\n";
-
-		if(_child !=NULL)
-			ss<<"coordonnes du fils : "<<_child->getCoord().toString()<<"\n";
-
-		if(_brother !=NULL)
-			ss<<"coordonnes du frere : "<<_brother->getCoord().toString()<<"\n";
-
-		return ss.str();
-	}
-
-	char getNeighbourId(const Node * n) const
-	{
-		char c ='X';
-		short diffi = _coord.getLine() - n->getCoord().getLine() ;
-		short diffj = _coord.getColumn() - n->getCoord().getColumn();
-
-		if (diffi == 1 && diffj == 0)
-			c ='1';
-		else if (diffi == 1 && diffj == -1)
-			c = '2' ;
-		else if(diffi == 0 && diffj == -1)
-			c = '3' ;
-		else if (diffi == -1 && diffj == -1)
-			c = '4' ;
-		else if (diffi == -1 && diffj == 0)
-			c = '5' ;
-		else if (diffi == -1 && diffj == 1)
-			c = '6' ;
-		else if (diffi == 0 && diffj == 1)
-			c = '7' ;
-		else if (diffi == 1 && diffj == 1)
-			c = '8' ;
-
-		return c;
-	}
-
-
-};
-
-#endif /* NODE_H_ */

+ 0 - 179
src/tests/corsen/lib/Outlet.h

@@ -1,179 +0,0 @@
-/*!
- * \file Outlet.h
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- * \date 3 juin 2013
- */
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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 OUTLET_H_
-#define OUTLET_H_
-
-#include "Node.h"
-#include <vector>
-#include <map>
-
-
-class Outlet : public Node
-{
-
-public :
-	short getFlag() const {
-		return _flag;
-	}
-
-	short getMx() const {
-		return _mx;
-	}
-
-	short getGmx() const {
-		return _Mx;
-	}
-
-	short getMy() const {
-		return _my;
-	}
-
-	short getGmy() const {
-		return _My;
-	}
-
-	int getNumber() const {
-		return _number;
-	}
-
-	short getOrder() const {
-		return _order;
-	}
-
-	void setFlag(short flag)
-	{
-		_flag = flag;
-	}
-
-	void setMx(short mx)
-	{
-		_mx = mx;
-	}
-
-	void setGMx(short mx)
-	{
-		_Mx = mx;
-	}
-
-	void setMy(short my)
-	{
-		_my = my;
-	}
-
-	void setGMy(short my)
-	{
-		_My = my;
-	}
-
-	void setNumber(int number)
-	{
-		_number = number;
-	}
-
-	void setOrder(short order)
-	{
-		_order = order;
-	}
-
-	Outlet() : Node()
-	{
-		_flag = 0;
-		_order = 0;
-		_mx = 0;
-		_my = 0;
-		_Mx = 0;
-		_My = 0;
-		_number = 0;
-	}
-
-	Outlet(const Outlet & o) : Node(o.getCoord(), o.getFather())
-	{
-		_father = o.getFather();
-		_brother = o.getBrother();
-		_child = o.getChild();
-		_flag = o.getFlag();
-		_number = o.getNumber() ;
-		_order = o.getOrder();
-		_mx = o.getMx();
-		_my = o.getMy();
-		_Mx = o.getGmx();
-		_My = o.getGmy();
-
-	}
-
-	Outlet(const Coordinates & c, short flag, int outletsNumber) : Node(c, NULL)
-	{
-		_child = NULL;
-		_brother = NULL;
-		_flag = flag;
-		_number = outletsNumber ;
-		_order = 0;
-		_mx = 0;
-		_my = 0;
-		_Mx = 0;
-		_My = 0;
-
-	}
-	~Outlet()
-	{
-		for(std::map<Coordinates, Node *>::iterator it = _childrenNodes.begin(); it!=_childrenNodes.end();it++)
-			delete it->second;
-	}
-
-	void setNodes(const std::map<Coordinates, Node*>& nodes)
-	{
-		this->_childrenNodes = nodes;
-	}
-
-	const std::string toString() const
-	{
-		std::stringstream ss;
-		ss<<"Outlet : "<<_coord.toString()<<"flag "<<_flag<<" numero "<<_number<<std::endl;
-
-		ss <<"All nodes : \n";
-		for(std::map<Coordinates, Node *>::const_iterator it = _childrenNodes.begin(); it!=_childrenNodes.end();it++)
-			ss << it->second->toString()<<"\n:";
-
-		return ss.str();
-	}
-
-	 Node * searchChildNode(const Coordinates & coord) const
-	{
-		if(_childrenNodes.count(coord))
-			return _childrenNodes.find(coord)->second;
-
-		return NULL;
-	}
-
-private :
-	std::map<Coordinates, Node *>_childrenNodes;
-	short _flag;
-	short _order;
-	short _mx, _my, _Mx, _My ;
-	int _number ;
-};
-
-#endif /* OUTLET_H_ */

+ 0 - 242
src/tests/corsen/lib/OutletFileStream.h

@@ -1,242 +0,0 @@
-/*!
- * \file OutletFileStream.h
- * \brief Flux binaire sur fichier contenant toutes les données de l'arborescence de MntSurf.
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- * \date 13 juin 2013
- */
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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 OUTLETFILESTREAM_H_
-#define OUTLETFILESTREAM_H_
-
-#include "FileStream.h"
-#include "Outlet.h"
-#include "Coordinates.h"
-#include <list>
-
-/*! \class OutletFileStream
- *
- * \brief gère un flux binaire en lecture et écriture sur le fichier contenant l'arborescence de MntSurf.
- */
-
-class OutletFileStream : public FileStream<corsenContainers::listS,Outlet *>
-{
-public :
-	enum returnTypeTree {recursiveOff, recursiveOn , eof};
-	OutletFileStream(std::string & filePath) : FileStream<corsenContainers::listS,Outlet *>(filePath) { }
-	~OutletFileStream() {}
-
-	returnType * read() const throw (FileNotFound, ReadError, InvalidFileFormat, std::bad_alloc)
-	{
-		std::ifstream outletFile(_filePath.c_str(),std::ios::binary);
-
-		if(not outletFile)
-			throw FileNotFound("Exception opening file\n: "+ _filePath);
-
-		if(_format.compare("") == 0)
-			return readStandardFormat(outletFile);
-
-		throw InvalidFileFormat("Exception Unknown file format "+_filePath+"\n");
-
-	}
-
-	void write(const returnType & object, const std::string & extension) const
-	{
-		std::string filePath(_filePath);
-		filePath.append(extension);
-		std::ofstream altFile(filePath.c_str(), std::ios::trunc);
-
-		if(not altFile)
-			throw FileNotFound("Exception opening file "+ filePath +"\n");
-
-		if(_format.compare("") == 0)
-			return writeStandardFormat(altFile, object);
-
-		throw InvalidFileFormat("Exception Unknown file format "+ filePath +"\n");
-
-	}
-
-private :
-
-	void fillMap(Node * n, std::map<Coordinates, Node *> & tmpNodes) const
-	{
-		if (n != NULL)
-		{
-			tmpNodes[n->getCoord()] = n;
-			fillMap(n->getChild(),tmpNodes);
-			fillMap(n->getBrother(),tmpNodes);
-		}
-	}
-
-
-	returnType * readStandardFormat(std::ifstream & file) const throw(ReadError, std::bad_alloc)
-	{
-		try
-		{
-			std::list<Outlet *> * tmp = new std::list<Outlet *>();
-			std::map<Coordinates, Node *> tmpNodes;
-			Outlet * olt = NULL;
-			short ligne, colonne;
-			int outletsNum = 100000 ;
-
-			do
-			{
-				outletsNum -= 1 ;
-				file.read(reinterpret_cast<char *>(&ligne), sizeof(short));
-				file.read(reinterpret_cast<char *>(&colonne), sizeof(short));
-				olt = new Outlet(Coordinates(ligne,colonne),0,outletsNum);
-
-				if (readTree(file, olt, NULL) == eof)
-				{
-					delete olt;
-					break;
-				}
-
-				fillMap(olt->getChild(), tmpNodes);
-				olt->setNodes(tmpNodes);
-				tmpNodes.clear();
-				(*tmp).push_front(olt);
-			}
-			while(file.good());
-			if(file.bad() or not file.eof())
-			{
-				file.close();
-				throw ReadError("Exception reading file "+ _filePath);
-			}
-
-			file.close();
-			return tmp;
-		}
-		catch(std::bad_alloc & e)
-		{
-			throw;
-		}
-
-	}
-
-	/*!
-	 *  \brief Lecture arbre
-	 *
-	 *  - Lit le fichier arbre.
-	 *  - Stocke dans une liste les exutoires de réseau de drainage,
-	 *  chaque exutoire contient la racine d'un arbre binaire.
-	 *
-	 *  \param file : fichier ou est stocké l'arborescence du réseau de drainage.
-	 *  \param n : Noeud fils
-	 *  \param p : Noeud père
-	 *  \return recursiveoff : arrêt du parcours de l'arbre ou de la branche.
-	 *  		recursiveon  : continuer parcours des branches de l'arbre.
-	 *  		eof : fin du fichier atteinte.
-	 */
-
-
-	returnTypeTree readTree(std::ifstream & file, Node * n, Node * p) const
-	{
-		char c;
-
-		file.read(reinterpret_cast<char *>(&c),sizeof(char));
-
-		if(file.eof())
-			return eof;
-
-		switch (c)
-		{
-		case '(' :
-
-			file.read(reinterpret_cast<char *>(&c),sizeof(char));
-
-			if (c == ')')
-				return recursiveOff ;
-
-			n->setChild(new Node(Coordinates(n->getCoord(), c), n));
-
-			if (readTree(file, (n->getChild()), n) == recursiveOn)
-				return (readTree(file, n, p));
-
-			break ;
-
-		case ')' :
-			n->setBrother(NULL);
-			if (p->getFather() !=NULL)
-				return recursiveOn ;
-			else
-				return recursiveOff ;
-
-		default :
-			n->setBrother(new Node(Coordinates(p->getCoord(),c), p));
-			return (readTree(file, n->getBrother(), p)) ;
-		}
-
-		return recursiveOn;
-	}
-
-
-	void writeStandardFormat(std::ofstream & file, const returnType & object) const
-	{
-
-#ifdef DEBUG
-		std::cout<<"Sauvegarde de l'arbre.\n";
-#endif
-		if (object.size() == 0)
-			return ;
-
-		for (returnType::const_reverse_iterator it = object.rbegin(); it!=object.rend() ; it++)
-		{
-			Coordinates outletCoordinates((*it)->getCoord());
-			outletCoordinates.toBinaryFile(file);
-
-			file.put('(');
-
-			if ((*it)->getChild() != NULL)
-				writeTree(file, *it, (*it)->getChild()) ;
-			else
-				file.put(')') ;
-		}
-
-		file.close();
-	}
-
-	void writeTree(std::ofstream & file, const Node * father, const Node * child) const
-	{
-		if(child != NULL)
-		{
-			file.put(father->getNeighbourId(child));
-
-			if (child->getChild() !=NULL)
-			{
-				file.put('(') ;
-				writeTree(file, child, child->getChild()) ;
-			}
-
-			if (child->getBrother() != NULL)
-				writeTree(file, father, child->getBrother());
-			else
-				file.put(')');
-		}
-
-	}
-
-};
-
-
-
-
-#endif /* OUTLETFILESTREAM_H_ */

+ 0 - 87
src/tests/corsen/lib/Parameters.h

@@ -1,87 +0,0 @@
-/*!
- * \file Parameters.h
- * \brief paramètres du programme et du bassin versant.
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- * \date 12 juin 2013
- */
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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 PARAMETERS_H_
-#define PARAMETERS_H_
-
-#include <iostream>
-#include <sstream>
-
-/*! \class Parameters
- *
- * \brief Regroupe les paramètres du programme et du bassin versant.
- *
- */
-
-class Parameters
-{
-public :
-	int _gap;
-	bool _meshMode;
-	int _riverLevel;
-	int _displaySea;
-	int _nodesPerLine;
-	int _nodesPerColumn;
-	int _linesNumber;
-	int _columnsNumber;
-	float _meshSize;
-	float _horizontalMeshStep;
-	float _verticalMeshStep;
-	float _meshArea;
-	float _colorColumnsNumber;
-	int _charColumnsNumber;
-	float lx0;
-	float ly0;
-	float lx1;
-	float ly1;
-	float lx2;
-	float ly2;
-	float lx3;
-	float ly3;
-	bool _lambertCadre;
-
-	/*!
-	 * \brief Transformer en chaîne.
-	 *
-	 * Représentation chaînée de l'objet.
-	 *
-	 * \param void
-	 * \return string
-	 */
-
-	const std::string toString() const
-	{
-		std::stringstream s;
-
-		s << "\n - trou " <<((_gap == 0 ) ? "non" : "oui")<<"\n - modeMaille "<<((_meshMode == false ) ? "non" : "oui")<<"\n - afficherMer "<<((_displaySea == 0 ) ? "non" : "oui") <<"\n - nbNoeudLig "<<_nodesPerLine<<"\n - nbNoeudCol "<<_nodesPerColumn
-				<<"\n - nbLig "<<_linesNumber<<"\n - nbCol "<<_columnsNumber<<"\n - tailleMaille "<<_meshSize<<"\n - pasMailleX "<<_horizontalMeshStep<<"\n - pasMailleY "<<_verticalMeshStep<<"\n - aireMaille "<<_meshArea<<
-				"\n - colorColumnsNumber "<<_colorColumnsNumber<<"\n - nbColCar "<<_charColumnsNumber<<"\n - lx0 "<<lx0<<"\n - ly0 "<<ly0<<"\n - lx1 "<<lx1<<"\n - ly1 "<<ly1<<"\n - lx2 "<<lx2<<"\n - ly2 "<<ly2<<"\n - lx3 "<<lx3<<"\n - ly3 "<<ly3<<"\n - cadreLambert "<<((_lambertCadre == false ) ? "non" : "oui");
-		return s.str();
-	}
-};
-
-
-#endif /* PARAMETERS_H_ */

+ 0 - 255
src/tests/corsen/lib/ParametersFileStream.h

@@ -1,255 +0,0 @@
-/*!
- * \file ParametersFileStream.h
- * \brief Flux texte sur le fichier de paramètres du programme et du bassin versant.
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- * \date 12 juin 2013
- */
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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 PARAMETERSFILESTREAM_H_
-#define PARAMETERSFILESTREAM_H_
-
-#include "FileStream.h"
-#include "Parameters.h"
-#include <boost/lexical_cast.hpp>
-#include <boost/shared_ptr.hpp>
-
-/*! \class ParametersFileStream
- *
- * \brief gère un flux texte en lecture et écriture sur le fichier de paramètres.
- */
-
-class ParametersFileStream : public FileStream<corsenContainers::CType, Parameters>
-{
-public:
-	std::string _modeFilePath;
-	std::string _modeFileFormat;
-
-	ParametersFileStream(std::string & parametersFilePath, std::string & modeFilePath) : FileStream<corsenContainers::CType, Parameters>(parametersFilePath)
-	{
-		_modeFilePath = modeFilePath;
-		_modeFileFormat = findFormat(modeFilePath);
-	}
-
-	virtual ~ParametersFileStream(){}
-
-	returnType * read() const throw (FileNotFound, InvalidFileFormat)
-	{
-		std::ifstream parFile(_filePath.c_str(),std::ios::in);
-		std::ifstream modeFile(_modeFilePath.c_str(),std::ios::in);
-		Parameters * p = NULL;
-
-		if(not parFile)
-			throw FileNotFound("Exception opening file : "+ _filePath);
-
-		if(not modeFile)
-			throw FileNotFound("Exception opening file : "+ _modeFilePath);
-
-		if(_format.compare(".txt") == 0)
-			p = readStandardFormat(parFile);
-		else if(_format.compare(".def") == 0)
-			p = readDefaultValues(parFile);
-		else
-			throw InvalidFileFormat("Exception Unknown file format "+_format+"\n");
-
-		if(_modeFileFormat.compare("") == 0)
-			readStandardModeFormat(modeFile, p);
-		else
-		{
-			if(p != NULL)
-				delete p;
-
-			throw InvalidFileFormat("Exception Unknown file format "+_modeFileFormat+"\n");
-		}
-
-		return p;
-	}
-
-
-	void write(const returnType & object, const std::string & /* extension */) const throw (FileNotFound, InvalidFileFormat)
-	{
-		std::ofstream parFile(_filePath.c_str(), std::ios::trunc) ;
-
-		if(not parFile)
-			throw FileNotFound("Exception opening file: "+ _filePath);
-
-		if(_format.compare(".txt") == 0)
-			return writeStandardFormat(parFile, object);
-
-		throw InvalidFileFormat("Exception Unknown file format "+_filePath+"\n");
-	}
-
-private :
-
-	void readStandardModeFormat(std::ifstream & file, Parameters * p) const throw (FileNotFound, boost::bad_lexical_cast)
-	{
-		using boost::lexical_cast;
-		std::string line;
-		std::vector<std::string> parameters;
-
-		std::getline(file, line);
-		boost::split(parameters,line,boost::is_any_of(" "));
-		p->_meshMode = lexical_cast<bool>(parameters.at(0));
-		p->_gap = lexical_cast<int>(parameters.at(1));
-
-		file.close();
-	}
-
-	returnType * readDefaultValues(std::ifstream & file) const throw (ReadError)
-	{
-		Parameters * param = new Parameters();
-		file.read(reinterpret_cast<char *>(&(param->_riverLevel)), sizeof(int));
-		file.read(reinterpret_cast<char *>(&(param->_displaySea)), sizeof(int));
-		if(file.bad() or not file.eof())
-		{
-			file.close();
-			throw ReadError("Exception reading file "+ _filePath);
-		}
-#ifdef DEBUG
-		std::cout<<"Seuil de rivière: "<<param->_riverLevel<<" ha"<<std::endl;
-		std::cout<<"Afficher la  mer: "<<param->_displaySea<<std::endl
-#endif
-		file.close();
-		return param;
-}
-
-	returnType * readStandardFormat(std::ifstream & file) const
-	{
-		using boost::lexical_cast;
-		using boost::bad_lexical_cast ;
-		Parameters * param = new Parameters();
-		std::string line;
-		std::vector<std::string> parameters;
-
-		std::getline(file,line);
-		boost::split(parameters, line, boost::is_any_of(" "));
-		try
-		{
-			param->_nodesPerLine = lexical_cast<int>(parameters.at(0));
-			param->_nodesPerColumn = lexical_cast <int>(parameters.at(1));
-
-			if(param->_meshMode)
-			{
-				param->_linesNumber = param->_nodesPerLine;
-				param->_columnsNumber = param->_nodesPerColumn;
-			}
-			else
-			{
-				param->_linesNumber = param->_nodesPerLine - 1 ;
-				param->_columnsNumber = param->_nodesPerColumn - 1 ;
-			}
-#ifdef DEBUG
-			std::cout<<"Matrice Altitude : "<<param->_linesNumber<<" lignes et "<<param->_columnsNumber<<" colonnes \n"<<"mnt "<<param->_nodesPerLine<<" X "<<param->_nodesPerColumn<<std::endl;
-#endif
-		}
-		catch (const bad_lexical_cast & e)
-		{
-			std::cerr<<e.what();
-		}
-		if(parameters.size() >= 3)
-		{
-			param->_horizontalMeshStep = lexical_cast<double>(parameters.at(2));
-
-			if (parameters.size() >=4 )
-			{
-				param->_verticalMeshStep = lexical_cast<double>(parameters.at(3));
-				param->_lambertCadre = false ;
-
-				if (parameters.size() == 12)
-				{
-					param->_lambertCadre = true ;
-					param->lx0 = lexical_cast<double>(parameters.at(4));
-					param->ly0 = lexical_cast<double>(parameters.at(5));
-					param->lx1 = lexical_cast<double>(parameters.at(6));
-					param->ly1 = lexical_cast<double>(parameters.at(7));
-					param->lx2 = lexical_cast<double>(parameters.at(8));
-					param->ly2 = lexical_cast<double>(parameters.at(9));
-					param->lx3 = lexical_cast<double>(parameters.at(10));
-					param->ly3 = lexical_cast<double>(parameters.at(11));
-				}
-
-			}
-			else
-				param->_verticalMeshStep = param->_horizontalMeshStep;
-
-			param->_meshSize = param->_horizontalMeshStep  ;
-
-		}
-		else
-		{
-			param->_horizontalMeshStep =  50. ;
-			param->_verticalMeshStep = 50.;
-			param->_meshSize = 50.;
-		}
-
-		param->_meshArea = param->_horizontalMeshStep * param->_verticalMeshStep ;
-		param->_colorColumnsNumber = (( param->_columnsNumber / 32 ) + 1 ) * 32 ;
-		param->_charColumnsNumber = (int) ceil ( (double) param->_columnsNumber / 8. ) ;
-
-#ifdef DEBUG
-		std::cout<<"Pas de la maille en x : "<<param->_horizontalMeshStep<<" mètres \n" ;
-		std::cout<<"Pas de la maille en y : "<<param->_verticalMeshStep<<" mètres \n\n";
-		std::cout<<param->_colorColumnsNumber<<" colonnes couleur\n\n";
-		std::cout<<param->_charColumnsNumber<<" colonnes caractère (codage binaire)\n\n";
-#endif
-		if(not param->_lambertCadre)
-		{
-			param->lx0 = 0. ;
-			param->ly0 = 0. ;
-			param->lx1 = 0. ;
-			param->ly1 = param->_verticalMeshStep * param->_nodesPerColumn / 1000. ;
-			param->lx2 = param->_verticalMeshStep * param->_nodesPerLine / 1000. ;
-			param->ly2 = 0. ;
-			param->lx3 = param->_verticalMeshStep * param->_nodesPerLine / 1000. ;
-			param->ly3 = param->_verticalMeshStep * param->_nodesPerColumn / 1000. ;
-			param->_lambertCadre = true ;
-		}
-
-		file.close();
-		return param;
-	}
-
-	void writeStandardFormat(std::ofstream & file, const returnType & object) const throw (FileNotFound)
-	{
-		std::ofstream modeFile(_modeFilePath, std::ios::trunc);
-		if(not modeFile)
-			throw FileNotFound("Exception opening file: "+ _modeFilePath);
-
-		modeFile<<object._meshMode<<" "<<object._gap;;
-		modeFile.close();
-
-		file<<object._linesNumber<<" ";
-		file<<object._columnsNumber<<" ";
-		file<<object._horizontalMeshStep<<" ";
-		file<<object._verticalMeshStep<<" ";
-		file<<object.lx0<<" ";
-		file<<object.ly0<<" ";
-		file<<object.lx1<<" ";
-		file<<object.ly1<<" ";
-		file<<object.lx2<<" ";
-		file<<object._charColumnsNumber<<" ";
-		file<<object.lx3<<" ";
-		file<<object.ly3<<"\n";
-		file.close();
-	}
-};
-
-#endif /* PARAMETERSFILESTREAM_H_ */

+ 0 - 123
src/tests/corsen/lib/Singleton.h

@@ -1,123 +0,0 @@
-/*!
- * \file Singleton.h
- * \brief modèle de singleton applicable à n'importe quelle classe.
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- * \date 6 juin 2013
- */
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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 SINGLETON_H_
-#define SINGLETON_H_
-
-#include <iostream>
-#include "Constantes.h"
-
-/*! \class Singleton
- *
- * \brief est un design pattern dont l'objet est de restreindre l'instanciation d'une classe à un seul objet.
- */
-
-template <typename T>
-class Singleton
-{
-protected:
-
-	/*!
-	 *  \brief Constructeur
-	 *
-	 *  Constructeur de la classe Singleton.
-	 *  \param void
-	 *  \return void
-	 *
-	 */
-
-	Singleton () { }
-
-	/*!
-	 *  \brief Destructeur
-	 *
-	 *  Destructeur de la classe Singleton.
-	 */
-
-	~Singleton ()
-	{
-#ifdef DEBUG
-		std::cout << "destroying singleton." << std::endl;
-#endif
-	}
-
-public:
-
-	/*!
-	 *  \brief Retourner instance.
-	 *
-	 *  Méthode qui crée l'unique instance de la classe si elle n'existe pas encore puis la retourne.
-	 *
-	 * \param void
-	 * \return Singleton
-	 */
-
-	static T * getInstance ()
-	{
-		if (NULL == _instance)
-		{
-#ifdef DEBUG
-			std::cout << "creating singleton." << std::endl;
-#endif
-			_instance = new T;
-		}
-		else
-		{
-#ifdef DEBUG
-			std::cout << "singleton already created!" << std::endl;
-#endif
-		}
-
-		return (static_cast<T*> (_instance));
-	}
-
-	/*!
-	 *  \brief Supprimer instance.
-	 *
-	 *  Méthode qui supprime l'unique instance de la classe si elle existe.
-	 *
-	 * \param void
-	 * \return void
-	 */
-
-	static void kill ()
-	{
-		if (_instance != NULL)
-		{
-			delete _instance;
-			_instance = NULL;
-		}
-	}
-
-private:
-	static T *_instance; /*!< Unique instance */
-};
-
-template <typename T>
-T *Singleton<T>::_instance = NULL;
-
-
-#endif /* SINGLETON_H_ */

+ 0 - 114
src/tests/corsen/lib/SlopeFileStream.h

@@ -1,114 +0,0 @@
-/*!
- * \file SlopeFileStream.h
- * \brief Flux binaire sur fichier de pentes.
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- * \date 20 juin 2013
- */
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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 SLOPEFILESTREAM_H_
-#define SLOPEFILESTREAM_H_
-
-// read a file and save it into memory
-
-#include <sstream>
-#include "FileStream.h"
-
-
-/*! \class SlopeFileStream
- * \brief gère un flux binaire en lecture et écriture sur le fichier de pentes.
- *
- */
-
-class SlopeFileStream: public FileStream<corsenContainers::vecS,float>
-{
-public :
-	SlopeFileStream(const std::string & filePath) : FileStream<corsenContainers::vecS,float>(filePath) {}
-	virtual ~SlopeFileStream(){}
-
-	returnType * read() const throw (FileNotFound, ReadError, InvalidFileFormat, std::bad_alloc)
-	{
-		std::ifstream gradientFile(_filePath.c_str(),std::ios::binary);
-		if(not gradientFile)
-			throw FileNotFound("Exception opening file\n "+_filePath);
-
-		if(_format.compare("") == 0)
-			return readStandardFormat(gradientFile);
-
-		throw InvalidFileFormat("Exception Unknown file format "+_filePath+"\n");
-	}
-
-	void write(const returnType & /* object */, const std::string & /* extension */) const
-	{
-
-	}
-
-	returnType * readStandardFormat(std::ifstream & file) const throw (ReadError, std::bad_alloc)
-	{
-		int i = 0;
-		float tmp;
-		try
-		{
-			returnType *  gradientVec = new returnType();
-
-			do
-			{
-				file.read(reinterpret_cast<char *>(&tmp), sizeof(float));
-				if(file.eof())
-				{
-					file.close();
-#ifdef DEBUG
-					std::cout<<"SlopeFileStream : all characters read successfully.\n";
-#endif
-					break;
-				}
-				else if(file.bad())
-				{
-					file.close();
-					std::stringstream ss;
-					ss << i * sizeof(float);
-					throw ReadError("Exception Reading file, only " + ss.str() + " bytes could be read");
-				}
-				else
-				{
-					gradientVec->push_back(tmp);
-					i++;
-				}
-			}
-			while(file.good());
-
-			return gradientVec;
-		}
-		catch(std::bad_alloc & e)
-		{
-			throw;
-		}
-	}
-
-	void writeStandardFormat(std::ofstream & /* file */,
-				 const returnType & /* object */) const
-	{
-	}
-
-};
-
-
-#endif /* SLOPEFILESTREAM_H_ */

+ 0 - 98
src/tests/corsen/lib/SoilFileStream.h

@@ -1,98 +0,0 @@
-/*!
- * \file SoilFileStream.h
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- * \date 12 juin 2013
- */
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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 SOILFILESTREAM_H_
-#define SOILFILESTREAM_H_
-
-#include "FileStream.h"
-#include <sstream>
-
-class SoilFileStream : public FileStream<corsenContainers::vecS,float>
-{
-public :
-
-	SoilFileStream(const std::string & filePath) : FileStream<corsenContainers::vecS,float>(filePath) {}
-	virtual ~SoilFileStream(){}
-
-	returnType * read() const throw (FileNotFound, ReadError, InvalidFileFormat)
-	{
-		std::ifstream gradientFile(_filePath.c_str(),std::ios::binary);
-		if(not gradientFile)
-			throw FileNotFound("Exception opening file\n "+_filePath);
-
-		if(_format.compare("") == 0)
-			return readStandardFormat(gradientFile);
-
-		throw InvalidFileFormat("Exception Unknown file format "+_filePath+"\n");
-	}
-
-
-	void write(const returnType & /* object */, const std::string & /* extension */) const
-	{
-
-	}
-
-private :
-	returnType * readStandardFormat(std::ifstream & file) const throw (ReadError)
-	{
-			int i = 0;
-			int tmp;
-			returnType * soilVec = new returnType();
-			do
-			{
-				file.read(reinterpret_cast<char *>(&tmp), sizeof(float));
-				if(file.eof())
-				{
-					file.close();
-#ifdef DEBUG
-					std::cout << "SoilFileStream : all characters read successfully. \n";
-#endif
-					break;
-				}
-				else if(file.bad())
-				{
-					file.close();
-					std::stringstream ss;
-					ss << i * sizeof(float);
-					throw ReadError("Exception Reading file, only " + ss.str() + " bytes could be read");
-				}
-				else
-				{
-					soilVec->push_back(tmp) ;
-					i++;
-				}
-			}
-			while(file.good());
-
-			return soilVec;
-	}
-
-	void writeStandardFormat(std::ofstream & /* file */, const returnType & /* object */) const
-	{
-	}
-
-};
-
-#endif

+ 0 - 295
src/tests/corsen/lib/Vertex.h

@@ -1,295 +0,0 @@
-/*!
- * \file Vertex.h
- * \brief les types de données nécessaires aux sommets.
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- */
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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 VERTEX_H_
-#define VERTEX_H_
-
-#include <sstream>
-#include <boost/graph/adjacency_list.hpp>
-#include <boost/graph/graph_utility.hpp>
-#include <boost/graph/graph_traits.hpp>
-#include "Parameters.h"
-#include "Coordinates.h"
-#include "Constantes.h"
-
-
-/**
- * \struct VertexProperties
- * \brief structure représentant un sommet dans le boost::Graph.
- */
-struct VertexProperties
-{
-	std::string name; /*!< nom du sommet*/
-	int identifier; /*!< identifiant du sommet*/
-	Coordinates c; /*!< Coordonnées du sommet*/
-	VertexProperties() : name(""), identifier(0), c() {} /*!< Constructeur par defaut*/
-	VertexProperties(std::string const& n, int i, const Coordinates & coord) : name(n), identifier(i), c(coord)  {} /*!< Constructeur avec paramètres*/
-};
-
-/**
- * \struct EdgeProperties
- * \brief structure représentant un arc dans le boost::Graph.
- */
-struct EdgeProperties
-{
-	double weight;
-	double distance;
-	float pourcent;
-	EdgeProperties() : weight(0.), distance(0.), pourcent(0.) {}
-	EdgeProperties(double w, double d, float p) : weight(w), distance(d), pourcent(p) {}
-};
-
-
-typedef boost::adjacency_list< boost::vecS, boost::vecS, boost::directedS, VertexProperties, EdgeProperties > DirectedGraph; /*!< Liste d'adjacence */
-
-//Some typedefs for simplicity
-typedef boost::graph_traits<DirectedGraph>::vertex_descriptor vertex_t; /*!< Simplification descripteur de sommet de la liste d'adjacence accessible via la classe de traits graph_traits */
-typedef boost::graph_traits<DirectedGraph>::edge_descriptor edge_t; /*!< Simplification descripteur d'un arc de la liste d'adjacence accessible via la classe de traits graph_traits */
-
-
-/*! \class Vertex
- * \brief représente un point du bassin versant.
- */
-
-class Vertex
-{
-private :
-	vertex_t _boostGraphIdentifier; /*!< identifiant boostGraph liant une instance de cette classe à un sommet du boostGraph */
-	char _mp; /*!< Type */
-	int _identifier; /*!< Identifiant*/
-	Coordinates _coordinates; /*!< Coordonnées en 2D */
-	float _elevation /*!< Altitude */;
-	std::vector<Vertex *>_neighbours; /*!< liste voisins */
-	float _derive; /*!< derive */
-
-public :
-
-	enum dataType {elevation, derive};
-
-	/*!
-	 *  \brief Constructeur par défaut
-	 *
-	 *  Constructeur de la classe Vertex
-	 *
-	 */
-
-	Vertex() :_coordinates()
-	{
-		_mp = 'n';
-		_identifier = 0;
-		_elevation = 0.;
-		_derive = 0.;
-		_boostGraphIdentifier = 4294967295;
-	}
-
-	/*!
-	 *  \brief Constructeur
-	 *
-	 *  Constructeur avec paramètres de la classe Vertex
-	 *
-	 * \param id : identifiant
-	 * \param c : Coordonnées
-	 * \param elevation : altitude
-	 */
-
-	Vertex(int id, const Coordinates & c, float elevation)
-	{
-		_derive = -999999.0;
-		_boostGraphIdentifier = 4294967295;
-		_mp = 'n';
-		_identifier = id;
-		_coordinates = c;
-		this->_elevation = elevation;
-	}
-
-	/*!
-	 *  \brief Constructeur
-	 *
-	 *  Constructeur par recopie de la classe Vertex
-	 *
-	 * \param v : sommet à copier.
-	 */
-
-	Vertex(const Vertex & v)
-	{
-		_mp = v.getMp();
-		_identifier = v.getIdentifier();
-		_coordinates = v.getCoord();
-		_elevation = v.getElevation();
-		_boostGraphIdentifier = v.getBoostGraphIdentifier();
-		_derive = v.getDerive();
-		_neighbours = v.getNeighbours();
-	}
-
-	virtual ~Vertex(){}
-
-	const std::vector<Vertex*> & getNeighbours() const
-			{
-		return _neighbours;
-			}
-
-	void setNeighbours(const std::vector<Vertex*> & neighbours)
-	{
-		this->_neighbours = neighbours;
-	}
-
-	const Coordinates& getCoord() const
-	{
-		return _coordinates;
-	}
-
-
-	/*!
-	 * \brief Transformer en chaîne.
-	 *
-	 * Représentation chaînée de l'objet
-	 *
-	 * \param void
-	 * \return string
-	 */
-
-
-	const std::string toString() const
-	{
-		std::stringstream s;
-		s <<"mp :"<<_mp <<" coordonnées : "<<_coordinates.toString()<<" altitude : "<<_elevation<<" identifiant : "<<_identifier<<" sommet : "<<_boostGraphIdentifier<<" derive : "<<_derive;
-		return s.str();
-	}
-
-
-	float getElevation() const
-	{
-		return _elevation;
-	}
-
-	vertex_t getBoostGraphIdentifier() const
-	{
-		return _boostGraphIdentifier;
-	}
-
-	void setBoostGraphIdentifier(vertex_t vertex)
-	{
-		this->_boostGraphIdentifier = vertex;
-	}
-
-	int getIdentifier() const {
-		return _identifier;
-	}
-
-	void setDerive(float derive) {
-		this->_derive = derive;
-	}
-
-	float getDerive() const
-	{
-		return _derive;
-	}
-
-	/*!
-	 *  \brief sigma
-	 *  \param dt : précise l'attribut avec lequel effectuer le calcul.
-	 *  \return la somme des poids des sommets voisins du sommet
-	 */
-
-	float sigma(dataType dt) const
-	{
-		float somme = 0. ;
-
-		if(dt == elevation)
-		{
-			for(std::vector<Vertex *>::const_iterator itVoisins = _neighbours.begin();itVoisins!=_neighbours.end();itVoisins++)
-			{
-				if ((**itVoisins).getElevation() > ALTMER)
-					somme += (*itVoisins)->tanBxL(getInstance(), elevation) ;
-			}
-		}
-		else
-		{
-			for(std::vector<Vertex *>::const_iterator itVoisins = _neighbours.begin();itVoisins!=_neighbours.end();itVoisins++)
-			{
-				if ((**itVoisins).getDerive() > ALTMER)
-					somme += (*itVoisins)->tanBxL(getInstance(), derive);
-			}
-		}
-		return somme ;
-	}
-
-	/*!
-	 * \brief teste la position de la maille.
-	 * \return true si la maille testée se situe sur le bord_de_mer, faux sinon
-	 */
-
-	bool isOnSeaside()
-	{
-		for (std::vector<Vertex *>::const_iterator it = _neighbours.begin(); it !=_neighbours.end(); it++)
-		{
-			if ((*it)->getElevation() <= ALTMER)
-				return true;
-		}
-		return false;
-	}
-
-	/*!
-	 * \brief tanBxL
-	 * \param v : le sommet avec laquelle effectuer le calcul.
-	 * \param dt : précise l'attribut avec lequel effectuer le calcul.
-	 * \return le poids du sommet dans la diffusion de la surface contributive vers la maille v.
-	 */
-
-	float tanBxL(const Vertex * v, dataType dt ) const
-	{
-		float delta;
-
-		if(dt == elevation)
-			delta = v->getElevation() -_elevation;
-		else
-			delta = v->getDerive() -_derive;
-
-		if (delta > 0.)
-			return ((_coordinates.isSameLine(v->getCoord()) || _coordinates.isSameColumn(v->getCoord())) ? delta*0.5 : delta*0.354) ;
-		else
-			return 0. ;
-	}
-
-	char getMp() const
-	{
-		return _mp;
-	}
-
-	void setMp(char mp)
-	{
-		this->_mp = mp;
-	}
-
-	const Vertex * getInstance() const
-	{
-		return this;
-	}
-
-
-};
-
-
-#endif /* VERTEX_H_ */

+ 0 - 350
src/tests/corsen/lib/XmlReader.h

@@ -1,350 +0,0 @@
-/*!
- * \file XmlReader.h
- * \brief Lecteur XML de base
- * \author The VLE Development Team
- * See the AUTHORS or Authors.txt file
- * \version 2.0
- */
-/*
- * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
- * Copyright (C) 2012-2013 INRA http://www.inra.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 XMLREADER_H_
-#define XMLREADER_H_
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <libxml/xmlmemory.h>
-#include <libxml/parser.h>
-#include <string>
-#include <sstream>
-
-/*! \class XmlReader
- *
- * \brief permet d'analyser un fichier XML
- *
- */
-
-
-class XmlReader
-{
-public :
-
-	static xmlNodePtr findNodeWithTagAttributAndAttrValue(xmlDocPtr doc, const char* tagName, const char* attributeName, const char* attributeValue)
-	{
-		xmlNodePtr cur = NULL;
-		//xmlChar *name;
-		std::string name;
-
-		cur = xmlDocGetRootElement(doc);
-
-		if (cur == NULL) {
-			fprintf(stderr,"Empty document\n");
-			xmlFreeDoc(doc);
-			exit(EXIT_FAILURE);
-		}
-
-		cur = cur->xmlChildrenNode;
-		while (cur != NULL) {
-			if ((!xmlStrcmp(cur->name, (const xmlChar *)tagName))) {
-				if (getAttributeAndTest(cur,attributeName,attributeValue)) {
-					break;
-				}
-			}
-			cur = cur->next;
-		}
-
-		if (cur==NULL) {
-			fprintf(stderr,"\n Tag name %s with attribute %s=%s is not defined\n ",tagName, attributeName,attributeValue);
-			exit(EXIT_FAILURE);
-		}
-		return cur;
-
-	}
-
-	/*!
-	 *  \brief trouver un noeud
-	 *
-	 *  Méthode qui permet de trouver un noeud avec le nom d'une balise  et le nom d'un attribut.
-	 *
-	 *  \param doc : le document dans lequel chercher.
-	 *  \param tagName : le nom de la balise .
-	 *  \param attributeName : le nom de l'attribut.
-	 *  \return un pointeur sur le noeud.
-	 */
-
-	static xmlNodePtr findNodeWithTagAndAttrName(xmlDocPtr doc, const char* tagName, const char* attributeName)
-	{
-		xmlNodePtr cur =NULL;
-		cur = findNode(doc,tagName,attributeName);
-
-		if (cur==NULL) {
-			fprintf(stderr,"\n Tag name %s with attribute %s is not defined\n ",tagName, attributeName);
-			//exit(EXIT_FAILURE);
-		}
-		return cur;
-
-	}
-	/*!
-	 *  \brief trouver valeur d'un attribut à partir du document.
-	 *
-	 *  Méthode qui permet de trouver la valeur d'un attribut avec le nom d'un attribut.
-	 *
-	 *  \param paramName : nom de l'attribut. On considère qu'il n'y a pas de doublons.
-	 *  \param doc : le document dans lequel chercher.
-	 *  \return la valeur de l'attribut sous forme de chaîne de caractères, NULL sinon
-	 */
-
-	static xmlChar* getStringParamValue(xmlDocPtr doc, const char* paramName)
-	{
-		xmlChar *value;
-
-		value = getParamValue(doc,paramName);
-		if (value==NULL) {
-			fprintf(stderr,"Value of parameter %s is not defined",paramName);
-			exit(EXIT_FAILURE);
-		} else {
-			return value;
-		}
-	}
-
-
-	/*!
-	 *  \brief trouver valeur d'un attribut à partir d'un noeud du document.
-	 *
-	 *  Méthode qui permet de trouver la valeur d'un attribut avec le nom d'un attribut.
-	 *
-	 *
-	 *  \param paramName : nom de l'attribut. On considère qu'il n'y a pas de doublons.
-	 *  \param node : le noeud dans lequel chercher.
-	 *  \return la valeur de l'attribut sous forme de chaîne de caractères, NULL sinon
-	 */
-
-
-	static xmlChar* getStringParamValueFromNode(xmlNodePtr node, const char* paramName)
-	{
-		xmlChar *value;
-
-		value = getParamValueFromNode(node,paramName);
-		if (value==NULL) {
-			fprintf(stderr,"Value of parameter %s is not defined",paramName);
-			exit(EXIT_FAILURE);
-		} else {
-			return value;
-		}
-
-	}
-
-	/*!
-	 *  \brief trouver valeur d'un attribut à partir du document.
-	 *
-	 *  Méthode qui permet de trouver la valeur d'un attribut avec le nom d'un attribut.
-	 *
-	 *
-	 *  \param paramName : nom de l'attribut. On considère qu'il n'y a pas de doublons.
-	 *  \param doc : le document dans lequel chercher.
-	 *  \return la valeur de l'attribut sous forme de réel, NULL sinon
-	 */
-
-	static float getFloatParamValue(xmlDocPtr doc, const char* paramName)
-	{
-		xmlChar *value;
-		float valueFloat;
-		value = getParamValue(doc,paramName);
-		if (value==NULL) {
-			fprintf(stderr,"Value of parameter %s is not defined",paramName);
-			exit(EXIT_FAILURE);
-		} else {
-			std::istringstream stringValue((char *) value);
-			stringValue>>valueFloat;
-			return valueFloat;
-		}
-
-	}
-
-	/*!
-	 *  \brief trouver valeur d'un attribut à partir d'un noeud du document.
-	 *
-	 *  Méthode qui permet de trouver la valeur d'un attribut avec le nom d'un attribut.
-	 *
-	 *
-	 *  \param paramName : nom de l'attribut. On considère qu'il n'y a pas de doublons.
-	 *  \param node : le noeud dans lequel chercher.
-	 *  \return la valeur de l'attribut sous la forme d'un réel, NULL sinon
-	 */
-
-
-	static float getFloatParamValueFromNode(xmlNodePtr node, const char* paramName)
-	{
-		xmlChar *value;
-		float valueFloat;
-
-		value = getParamValueFromNode(node,paramName);
-		if (value==NULL) {
-			fprintf(stderr,"Value of parameter %s is not defined",paramName);
-			exit(EXIT_FAILURE);
-		} else {
-			std::istringstream stringValue((char *) value);
-			stringValue>>valueFloat;
-			return valueFloat;
-		}
-
-	}
-
-	/*!
-	 *  \brief trouver valeur d'un attribut à partir du document.
-	 *
-	 *  Méthode qui permet de trouver la valeur d'un attribut avec le nom d'un attribut.
-	 *
-	 *
-	 *  \param paramName : nom de l'attribut. On considère qu'il n'y a pas de doublons.
-	 *  \param doc : le document dans lequel chercher.
-	 *  \return la valeur de l'attribut sous la forme d'un entier, NULL sinon
-	 */
-
-	static int getIntParamValue(xmlDocPtr doc, const char* paramName)
-	{
-		xmlChar *value;
-		int intValue;
-
-		value = getParamValue(doc,paramName);
-		if (value==NULL) {
-			//fprintf(stderr,"Value of parameter %s is not defined\n",paramName);
-			return 0;
-		} else {
-			std::istringstream stringValue((char *) value);
-			stringValue>>intValue;
-			return intValue;
-		}
-
-	}
-
-	static xmlChar *getParamValue(xmlDocPtr doc, const char* paramName)
-	{
-		xmlNodePtr cur;
-
-		cur = xmlDocGetRootElement(doc);
-
-		if (cur == NULL) {
-			fprintf(stderr,"Empty document\n");
-			xmlFreeDoc(doc);
-			exit(EXIT_FAILURE);
-		}
-
-		if (xmlStrcmp(cur->name, (const xmlChar *) "context")) {
-			fprintf(stderr,"Document of the wrong type, root node != context");
-			xmlFreeDoc(doc);
-			exit(EXIT_FAILURE);
-		}
-		return getParamValueFromNode(cur,paramName);
-
-
-	}
-
-	static xmlDocPtr parseDoc(const char *docname)
-	{
-		xmlDocPtr xmlDoc = xmlParseFile(docname);
-
-		/* Lecture et analyse du document XML contenu dans docname */
-		if (xmlDoc == NULL) {
-			fprintf(stderr,"Document %s not parsed successfully. \n",docname);
-			exit(EXIT_FAILURE);
-		}
-		return xmlDoc;
-	}
-
-	static std::string getAttribute(xmlNodePtr cur, const char* attr)
-	{
-		const xmlChar* attrName = (const xmlChar *)attr;
-		xmlChar* prop = xmlGetProp(cur, attrName);
-		std::string s((const char*)prop);
-		xmlFree(prop);
-		return s;
-
-	}
-
-	static bool getAttributeAndTest(xmlNodePtr cur, const char* attr, const char* attrValue)
-	{
-		bool isGoodAttr = false;
-		const xmlChar* attrName = (const xmlChar *)attr;
-		xmlChar* prop = xmlGetProp(cur, attrName);
-
-		if (prop != NULL) {
-			std::string s((const char*)prop);
-
-			if (s.compare(attrValue)==0) {
-				isGoodAttr = true;
-			}
-			xmlFree(prop);
-		}
-		return isGoodAttr;
-
-	}
-
-private :
-
-	static xmlNodePtr findNode(xmlDocPtr doc, const char* tagName, const char* attributeName)
-	{
-		xmlNodePtr cur = NULL;
-
-		cur = xmlDocGetRootElement(doc);
-
-		if (cur == NULL) {
-			fprintf(stderr,"Empty document\n");
-			xmlFreeDoc(doc);
-			exit(EXIT_FAILURE);
-		}
-
-		cur = cur->xmlChildrenNode;
-		while (cur != NULL) {
-			if ((!xmlStrcmp(cur->name, (const xmlChar *)tagName))) {
-				//name = (xmlChar *)xmlGetProp(cur, ( const xmlChar* )"name");
-				if (getAttributeAndTest(cur,"name",attributeName)) {
-					break;
-				}
-			}
-			cur = cur->next;
-		}
-
-		if (cur==NULL) {
-			fprintf(stderr,"\n Tag name %s with attribute %s is not defined\n ",tagName, attributeName);
-			//exit(EXIT_FAILURE);
-		}
-
-		return cur;
-	}
-
-
-	static xmlChar *getParamValueFromNode(xmlNodePtr cur, const char* paramName)
-	{
-		cur = cur->xmlChildrenNode;
-		while (cur != NULL) {
-			if ((!xmlStrcmp(cur->name, (const xmlChar *)"param"))) {
-				if (getAttributeAndTest(cur, "name", paramName)) {
-					//printf("%s \n",getAttribute(cur,"value").c_str());
-					return (xmlChar *)(getAttribute(cur,"value").c_str());
-				}
-			}
-			cur = cur->next;
-		}
-		return NULL;
-	}
-};
-
-#endif /* XMLREADER_H_ */

+ 0 - 117
src/tests/corsen/tests.cpp

@@ -1,117 +0,0 @@
-/**
- * @file tests/corsen/tests.cpp
- * @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/>.
- */
-
-#include "lib/Corsen.hpp"
-
-/**
- * \fn void modifyFilesPath(string & absolutePath, vector<string *> & files)
- * \brief Modifie le chemin par défaut des fichiers.
- * \param absolutePath : chemin absolu ou sont stockés les fichiers
- * \param files : tableau contenant les chemins vers les fichiers .
- */
-
-void modifyFilesPath(std::string& absolutePath,
-                     std::vector < std::string* >& files)
-{
-    for (std::vector < std::string* >::iterator it = files.begin();
-        it != files.end(); it++) {
-        (*it)->insert(0, absolutePath);
-    }
-}
-
-int main(int argc, char** argv)
-{
-    bool defaultFilePath = true;
-    std::string absolutePath("");
-    std::string modeFile(".mode"), parametersFile("par.txt"),
-        elevationFile("alt"), outletFile("arbre"), layersFile("couche"),
-        contextFile("contexte_agro_prairie.xml") ,slopeFile("pav");
-    std::vector<std::string *> files;
-
-    files.push_back(&parametersFile);
-    files.push_back(&modeFile);
-    files.push_back(&elevationFile);
-    files.push_back(&outletFile);
-    files.push_back(&slopeFile);
-    files.push_back(&contextFile);
-    files.push_back(&layersFile);
-
-    /* Lecture des paramètres en ligne de commande */
-    if(argc > 1) {
-        int i = 1;
-        char* option;
-
-        while (i < argc) {
-            option = argv[i++];
-            if (strcmp(option,"-h") == 0) {
-                std::cerr << "Utilisation : " << argv[0]
-                          << "[-h] [-a absolute path]" << std::endl;
-                std::cerr << " -a : chemin absolu" << std::endl;
-                std::cerr << " -c : nom du fichier xml" << std::endl;
-                std::cerr << " -h : cette aide" << std::endl;
-                exit(0);
-            } else if (strcmp(option, "-a") == 0) {
-                if (i == argc) {
-                    std::cerr << "il manque le chemin absolu" << std::endl;
-                    exit(0);
-                }
-                defaultFilePath = false;
-                absolutePath.append(argv[i++]);
-                if(absolutePath.c_str()[absolutePath.size()- 1] != '/') {
-                    absolutePath+="/";
-                }
-                modifyFilesPath(absolutePath,files);
-            } else if  (strcmp(option,"-c")==0) {
-                if (i == argc) {
-                    std::cerr << "il manque le nom du fichier xml" << std::endl;
-                    exit(0);
-                }
-                contextFile.clear();
-                contextFile.append(argv[i++]);
-                std::vector<std::string *>context;
-                context.push_back(&contextFile);
-                modifyFilesPath(absolutePath,context);
-            } else {
-                std::cerr << "Option non reconnue essayez -h" << std::endl;
-                exit(0);
-            }
-        }
-    }
-
-    try {
-        if(defaultFilePath) {
-            std::string defaultFilePathStr("data/");
-            modifyFilesPath(defaultFilePathStr,files);
-        }
-        Corsen c;
-        c.read(files, absolutePath);
-        c.buildGraph();
-        c.display();
-    } catch(std::exception & e) {
-        std::cout<<e.what()<<std::endl;
-    }
-    return 0;
-}

+ 0 - 19
src/tests/dtss/CMakeLists.txt

@@ -1,19 +0,0 @@
-INCLUDE_DIRECTORIES(
-  ${PARADEVS_BINARY_DIR}/src
-  ${PARADEVS_SOURCE_DIR}/src
-  ${Boost_INCLUDE_DIRS}
-  ${GLIBMM_INCLUDE_DIRS}
-  ${LIBXML_INCLUDE_DIRS})
-
-LINK_DIRECTORIES(
-  ${GLIBMM_LIBRARY_DIRS}
-  ${LIBXML_LIBRARY_DIR})
-
-ADD_EXECUTABLE(dtss-tests ${COMMON_HPP} ${DTSS_HPP} graph_manager.hpp
-  models.hpp tests.cpp)
-SET_TARGET_PROPERTIES(dtss-tests PROPERTIES ${PARADEVS_APP_PROPERTIES})
-
-TARGET_LINK_LIBRARIES(dtss-tests
-  ${GLIBMM_LIBRARIES}
-  ${LIBXML_LIBRARIES}
-  ${GTHREAD_LIBRARIES})

+ 0 - 119
src/tests/dtss/graph_manager.hpp

@@ -1,119 +0,0 @@
-/**
- * @file tests/dtss/graph_manager.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 TESTS_DTSS_GRAPH_MANAGER_HPP
-#define TESTS_DTSS_GRAPH_MANAGER_HPP 1
-
-#include <kernel/dtss/Coordinator.hpp>
-#include <kernel/dtss/GraphManager.hpp>
-#include <kernel/dtss/Simulator.hpp>
-
-#include <tests/dtss/models.hpp>
-
-namespace paradevs { namespace tests { namespace dtss {
-
-template < class SchedulerHandle >
-struct Policy
-{
-    const common::Bag < common::DoubleTime, SchedulerHandle >& bag() const
-    { return _bag; }
-
-    virtual void operator()(
-        common::DoubleTime::type /* t */,
-        const common::ExternalEvent < common::DoubleTime,
-                                      SchedulerHandle >& event,
-        common::DoubleTime::type /* tl */,
-        common::DoubleTime::type /* tn */)
-    {
-        _bag.clear();
-        _bag.push_back(event);
-    }
-
-private:
-    common::Bag < common::DoubleTime, SchedulerHandle > _bag;
-};
-
-template < class SchedulerHandle >
-class OnlyOneGraphManager :
-        public paradevs::dtss::GraphManager < common::DoubleTime,
-                                              SchedulerHandle,
-                                              paradevs::common::NoParameters >
-{
-public:
-    OnlyOneGraphManager(common::Coordinator < common::DoubleTime,
-                                              SchedulerHandle >* coordinator,
-                        const paradevs::common::NoParameters& parameters) :
-        paradevs::dtss::GraphManager < common::DoubleTime, SchedulerHandle,
-                                       paradevs::common::NoParameters >(
-                                           coordinator, parameters),
-        a("a", 1, common::NoParameters())
-    {
-        OnlyOneGraphManager < SchedulerHandle >::add_child(&a);
-    }
-
-    virtual ~OnlyOneGraphManager()
-    { }
-
-private:
-    paradevs::dtss::Simulator < common::DoubleTime, A < SchedulerHandle >,
-                                SchedulerHandle > a;
-};
-
-template < class SchedulerHandle >
-class TwoGraphManager :
-        public paradevs::dtss::GraphManager < common::DoubleTime,
-                                              SchedulerHandle,
-                                              paradevs::common::NoParameters >
-{
-public:
-    TwoGraphManager(common::Coordinator < common::DoubleTime,
-                                          SchedulerHandle >* coordinator,
-                    const paradevs::common::NoParameters& parameters) :
-        paradevs::dtss::GraphManager < common::DoubleTime, SchedulerHandle,
-                                       paradevs::common::NoParameters >(
-                                           coordinator, parameters),
-        a("a", 1, common::NoParameters()), b("b", 1, common::NoParameters())
-    {
-        TwoGraphManager < SchedulerHandle >::add_child(&a);
-        TwoGraphManager < SchedulerHandle >::add_child(&b);
-        a.add_out_port("out");
-        b.add_in_port("in");
-        TwoGraphManager < SchedulerHandle >::add_link(&a, "out", &b, "in");
-    }
-
-    virtual ~TwoGraphManager()
-    { }
-
-private:
-    paradevs::dtss::Simulator < common::DoubleTime, A < SchedulerHandle >,
-                                SchedulerHandle > a;
-    paradevs::dtss::Simulator < common::DoubleTime, B < SchedulerHandle >,
-                                SchedulerHandle > b;
-};
-
-} } } // namespace paradevs tests dtss
-
-#endif

+ 0 - 195
src/tests/dtss/models.hpp

@@ -1,195 +0,0 @@
-/**
- * @file tests/dtss/models.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 TESTS_DTSS_MODELS_HPP
-#define TESTS_DTSS_MODELS_HPP 1
-
-#include <kernel/dtss/Dynamics.hpp>
-
-#include <common/time/DoubleTime.hpp>
-
-namespace paradevs { namespace tests { namespace dtss {
-
-template < class SchedulerHandle>
-class A :
-        public paradevs::dtss::Dynamics < common::DoubleTime, SchedulerHandle,
-                                          paradevs::common::NoParameters >
-{
-public:
-    A(const std::string& name,
-      const paradevs::common::NoParameters& parameters) :
-        paradevs::dtss::Dynamics < common::DoubleTime, SchedulerHandle,
-                                   paradevs::common::NoParameters >(name,
-                                                                    parameters)
-    { }
-    virtual ~A()
-    { }
-
-    void transition(const common::Bag < common::DoubleTime,
-                    SchedulerHandle >& /* x */,
-                    common::DoubleTime::type t)
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                A < SchedulerHandle >::get_name(), t,
-                common::DELTA_INT);
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-    }
-
-    common::DoubleTime::type start(common::DoubleTime::type t)
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                A < SchedulerHandle >::get_name(), t,
-                common::START);
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        return 0;
-    }
-
-    common::Bag < common::DoubleTime, SchedulerHandle > lambda(
-        common::DoubleTime::type t) const
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-
-        common::Bag < common::DoubleTime, SchedulerHandle > msgs;
-
-        msgs.push_back(common::ExternalEvent < common::DoubleTime,
-                                               SchedulerHandle >("out", 0.));
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                A < SchedulerHandle >::get_name(), t,
-                common::LAMBDA)
-            << "messages = " << msgs.to_string();
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        return msgs;
-    }
-};
-
-template < class SchedulerHandle>
-class B :
-        public paradevs::dtss::Dynamics < common::DoubleTime, SchedulerHandle,
-                                          paradevs::common::NoParameters >
-{
-public:
-    B(const std::string& name,
-      const paradevs::common::NoParameters& parameters) :
-        paradevs::dtss::Dynamics < common::DoubleTime, SchedulerHandle,
-                                   paradevs::common::NoParameters >(name,
-                                                                    parameters)
-    { }
-    virtual ~B()
-    { }
-
-    void transition(const common::Bag < common::DoubleTime,
-                    SchedulerHandle >& x,
-                    common::DoubleTime::type t)
-    {
-
-#ifndef WITH_TRACE
-        (void)x;
-        (void)t;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                B < SchedulerHandle >::get_name(), t,
-                common::DELTA_INT)
-            << "x = " << x.to_string();
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-    }
-
-    common::DoubleTime::type start(common::DoubleTime::type t)
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                B < SchedulerHandle >::get_name(), t,
-                common::START);
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        return 0;
-    }
-
-    common::Bag < common::DoubleTime, SchedulerHandle > lambda(
-        common::DoubleTime::type t) const
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-
-        common::Bag < common::DoubleTime, SchedulerHandle > msgs;
-
-        msgs.push_back(common::ExternalEvent < common::DoubleTime,
-                                               SchedulerHandle >("out", 0.));
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                B < SchedulerHandle >::get_name(), t,
-                common::LAMBDA)
-            << "messages = " << msgs.to_string();
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        return msgs;
-    }
-};
-
-} } } // namespace paradevs tests dtss
-
-#endif

+ 0 - 120
src/tests/dtss/tests.cpp

@@ -1,120 +0,0 @@
-/**
- * @file tests/dtss/tests.cpp
- * @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/>.
- */
-
-#include <common/scheduler/SchedulerHandle.hpp>
-
-#include <tests/dtss/graph_manager.hpp>
-#include <tests/dtss/models.hpp>
-
-#include <common/RootCoordinator.hpp>
-
-#define CATCH_CONFIG_MAIN
-#include <tests/catch.hpp>
-
-using namespace paradevs::tests::dtss;
-using namespace paradevs::common;
-
-TEST_CASE("dtss/only_one", "run")
-{
-
-    paradevs::common::RootCoordinator <
-        DoubleTime, paradevs::dtss::Coordinator <
-            DoubleTime,
-            Policy < paradevs::common::scheduler::NoSchedulerHandle >,
-            OnlyOneGraphManager <
-                paradevs::common::scheduler::NoSchedulerHandle >,
-            paradevs::common::scheduler::NoSchedulerHandle,
-            paradevs::dtss::Parameters < DoubleTime > >
-        > rc(0, 10, "root",
-             paradevs::dtss::Parameters < DoubleTime >(1),
-             paradevs::common::NoParameters());
-
-    paradevs::common::Trace < DoubleTime >::trace().clear();
-    rc.run();
-
-    REQUIRE(paradevs::common::Trace <
-                DoubleTime >::trace().elements().
-            filter_model_name("a").
-            filter_type(paradevs::common::START).size() == 1);
-    for (double t = 0; t <= 10; ++t) {
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a").filter_time(t).
-                filter_type(paradevs::common::DELTA_INT).size() == 1);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a").filter_time(t).
-                filter_type(paradevs::common::LAMBDA).size() == 1);
-    }
-}
-
-TEST_CASE("dtss/two", "run")
-{
-    paradevs::common::RootCoordinator <
-        DoubleTime, paradevs::dtss::Coordinator <
-            DoubleTime,
-            Policy < paradevs::common::scheduler::NoSchedulerHandle >,
-            TwoGraphManager <
-                paradevs::common::scheduler::NoSchedulerHandle >,
-            paradevs::common::scheduler::NoSchedulerHandle,
-            paradevs::dtss::Parameters < DoubleTime > >
-        > rc(0, 10, "root",
-             paradevs::dtss::Parameters < DoubleTime >(1),
-             paradevs::common::NoParameters());
-
-    paradevs::common::Trace < DoubleTime >::trace().clear();
-    rc.run();
-
-    REQUIRE(paradevs::common::Trace <
-                DoubleTime >::trace().elements().
-            filter_model_name("a").
-            filter_type(paradevs::common::START).size() == 1);
-    for (unsigned int t = 0; t <= 10; ++t) {
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a").filter_time(t).
-                filter_type(paradevs::common::DELTA_INT).size() == 1);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a").filter_time(t).
-                filter_type(paradevs::common::LAMBDA).size() == 1);
-    }
-
-    REQUIRE(paradevs::common::Trace <
-                DoubleTime >::trace().elements().
-            filter_model_name("b").
-            filter_type(paradevs::common::START).size() == 1);
-    for (unsigned int t = 0; t <= 10; ++t) {
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("b").filter_time(t).
-                filter_type(paradevs::common::DELTA_INT).size() == 1);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("b").filter_time(t).
-                filter_type(paradevs::common::LAMBDA).size() == 1);
-    }
-}

+ 0 - 21
src/tests/mixed/CMakeLists.txt

@@ -1,21 +0,0 @@
-INCLUDE_DIRECTORIES(
-  ${PARADEVS_BINARY_DIR}/src
-  ${PARADEVS_SOURCE_DIR}/src
-  ${Boost_INCLUDE_DIRS}
-  ${GLIBMM_INCLUDE_DIRS}
-  ${LIBXML_INCLUDE_DIRS})
-
-LINK_DIRECTORIES(
-  ${GLIBMM_LIBRARY_DIRS}
-  ${LIBXML_LIBRARY_DIR})
-
-SET(MIXED_TESTS_HPP graph_manager.hpp models.hpp)
-
-ADD_EXECUTABLE(mixed-tests ${COMMON_HPP} ${COMMON_SCHEDULER_HPP} ${DTSS_HPP}
-  ${PDEVS_HPP} ${MIXED_TESTS_HPP} tests.cpp)
-SET_TARGET_PROPERTIES(mixed-tests PROPERTIES ${PARADEVS_APP_PROPERTIES})
-
-TARGET_LINK_LIBRARIES(mixed-tests
-  ${GLIBMM_LIBRARIES}
-  ${LIBXML_LIBRARIES}
-  ${GTHREAD_LIBRARIES})

+ 0 - 428
src/tests/mixed/graph_manager.hpp

@@ -1,428 +0,0 @@
-/**
- * @file tests/mixed/graph_manager.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 TESTS_MIXED_GRAPH_MANAGER_HPP
-#define TESTS_MIXED_GRAPH_MANAGER_HPP 1
-
-#include <common/scheduler/VectorScheduler.hpp>
-#include <common/scheduler/HeapScheduler.hpp>
-
-#include <kernel/dtss/Coordinator.hpp>
-#include <kernel/dtss/GraphManager.hpp>
-#include <kernel/dtss/Simulator.hpp>
-
-#include <kernel/pdevs/Coordinator.hpp>
-#include <kernel/pdevs/GraphManager.hpp>
-#include <kernel/pdevs/Simulator.hpp>
-
-#include <tests/mixed/models.hpp>
-
-namespace paradevs { namespace tests { namespace mixed {
-
-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;
-};
-
-template < class SchedulerHandle >
-struct LastBagPolicy
-{
-    const common::Bag < common::DoubleTime, SchedulerHandle >& bag() const
-    { return _bag; }
-
-    virtual void operator()(
-        typename common::DoubleTime::type /* t */,
-        const common::ExternalEvent < common::DoubleTime,
-                                      SchedulerHandle >& event,
-        typename common::DoubleTime::type /* tl */,
-        typename common::DoubleTime::type /* tn */)
-    {
-        _bag.clear();
-        _bag.push_back(event);
-    }
-
-private:
-    common::Bag < common::DoubleTime, SchedulerHandle > _bag;
-};
-
-template < class SchedulerHandle >
-struct IgnorePolicy
-{
-    const common::Bag < common::DoubleTime, SchedulerHandle >& bag() const
-    { return _bag; }
-
-    virtual void operator()(
-        typename common::DoubleTime::type /* t */,
-        const common::ExternalEvent < common::DoubleTime,
-                                      SchedulerHandle >& /* event */,
-        typename common::DoubleTime::type /* tl */,
-        typename common::DoubleTime::type /* tn */)
-    { }
-
-private:
-    common::Bag < common::DoubleTime, SchedulerHandle > _bag;
-};
-
-template < class SchedulerHandle >
-class S1GraphManager :
-        public pdevs::GraphManager < common::DoubleTime, SchedulerHandle,
-                                     paradevs::common::NoParameters >
-{
-public:
-    S1GraphManager(common::Coordinator < common::DoubleTime,
-                                         SchedulerHandle >* coordinator,
-                   const paradevs::common::NoParameters& parameters) :
-        pdevs::GraphManager < common::DoubleTime, SchedulerHandle,
-                              paradevs::common::NoParameters >(
-                                  coordinator, parameters),
-        a("a1", paradevs::common::NoParameters()),
-        b("b1", paradevs::common::NoParameters())
-    {
-        S1GraphManager < SchedulerHandle >::add_child(&a);
-        S1GraphManager < SchedulerHandle >::add_child(&b);
-
-        a.add_out_port("out");
-        b.add_in_port("in");
-        b.add_out_port("out");
-        coordinator->add_out_port("out");
-
-        S1GraphManager < SchedulerHandle >::add_link(&a, "out",
-                                                     &b, "in");
-        S1GraphManager < SchedulerHandle >::add_link(&b, "out",
-                                                     coordinator, "out");
-    }
-
-    virtual ~S1GraphManager()
-    { }
-
-private:
-    pdevs::Simulator < common::DoubleTime,
-                       A1 < SchedulerHandle >,
-                       SchedulerHandle,
-                       paradevs::common::NoParameters > a;
-    pdevs::Simulator < common::DoubleTime,
-                       B1 < SchedulerHandle >,
-                       SchedulerHandle,
-                       paradevs::common::NoParameters > b;
-};
-
-template < class SchedulerHandle >
-class S2GraphManager :
-        public dtss::GraphManager < common::DoubleTime, SchedulerHandle >
-{
-public:
-    S2GraphManager(common::Coordinator < common::DoubleTime,
-                                         SchedulerHandle >* coordinator,
-                   const paradevs::common::NoParameters& parameters) :
-        dtss::GraphManager < common::DoubleTime,
-                             SchedulerHandle >(coordinator, parameters),
-        a("a2", 20, paradevs::common::NoParameters()),
-        b("b2", 20, paradevs::common::NoParameters())
-    {
-        S2GraphManager < SchedulerHandle >::add_child(&a);
-        S2GraphManager < SchedulerHandle >::add_child(&b);
-
-        a.add_in_port("in");
-        a.add_out_port("out");
-        b.add_in_port("in");
-        coordinator->add_in_port("in");
-
-        S2GraphManager < SchedulerHandle >::add_link(&a, "out", &b, "in");
-        S2GraphManager < SchedulerHandle >::add_link(coordinator, "in",
-                                                     &a, "in");
-    }
-
-    virtual ~S2GraphManager()
-    { }
-
-private:
-    dtss::Simulator < common::DoubleTime,
-                      A2 < SchedulerHandle >,
-                      SchedulerHandle
-                    > a;
-    dtss::Simulator < common::DoubleTime,
-                      B2 < SchedulerHandle >,
-                      SchedulerHandle
-                    > b;
-};
-
-class RootGraphManager :
-        public pdevs::GraphManager < common::DoubleTime, SchedulerHandle,
-                                     paradevs::common::NoParameters >
-{
-public:
-    RootGraphManager(common::Coordinator < common::DoubleTime,
-                                           SchedulerHandle >* coordinator,
-                     const paradevs::common::NoParameters& parameters) :
-        pdevs::GraphManager < common::DoubleTime, SchedulerHandle,
-                              paradevs::common::NoParameters >(
-                                  coordinator, parameters),
-        S1("S1", paradevs::common::NoParameters(),
-           paradevs::common::NoParameters()),
-        S2("S2", paradevs::dtss::Parameters < common::DoubleTime >(20),
-           paradevs::common::NoParameters())
-    {
-        add_child(&S1);
-        add_child(&S2);
-        add_link(&S1, "out", &S2, "in");
-    }
-
-    virtual ~RootGraphManager()
-    { }
-
-private:
-    paradevs::pdevs::Coordinator <
-        common::DoubleTime,
-        SchedulerType,
-        SchedulerHandle,
-        S1GraphManager < SchedulerHandle >
-    > S1;
-    paradevs::dtss::Coordinator <
-        common::DoubleTime,
-        LastBagPolicy < SchedulerHandle >,
-        S2GraphManager < SchedulerHandle >,
-        SchedulerHandle,
-        paradevs::dtss::Parameters < common::DoubleTime >
-    > S2;
-};
-
-template < int size, class SchedulerHandle >
-class LinearGraphManager :
-        public pdevs::GraphManager < common::DoubleTime, SchedulerHandle,
-                                     paradevs::common::NoParameters >
-{
-public:
-    LinearGraphManager(common::Coordinator < common::DoubleTime,
-                                             SchedulerHandle >* coordinator,
-                       const paradevs::common::NoParameters& parameters) :
-        pdevs::GraphManager < common::DoubleTime, SchedulerHandle,
-                              paradevs::common::NoParameters >(
-                                  coordinator, parameters)
-    {
-        for (unsigned int i = 1; i <= size; ++i) {
-            std::ostringstream ss;
-
-            ss << "a" << i;
-            _models.push_back(
-                new pdevs::Simulator < common::DoubleTime,
-                                       Beep < SchedulerHandle >,
-                                       SchedulerHandle,
-                                       paradevs::common::NoParameters >(
-                                           ss.str(),
-                                           paradevs::common::NoParameters()));
-        }
-        for (unsigned int i = 0; i < size; ++i) {
-            LinearGraphManager < size, SchedulerHandle >::add_child(_models[i]);
-
-            _models[i]->add_in_port("in");
-            _models[i]->add_out_port("out");
-        }
-        for (unsigned int i = 0; i < size - 1; ++i) {
-            LinearGraphManager < size,
-                                 SchedulerHandle >::add_link(_models[i],
-                                                             "out",
-                                                             _models[i + 1],
-                                                             "in");
-        }
-    }
-
-    virtual ~LinearGraphManager()
-    {
-        for (unsigned int i = 0; i < size; ++i) {
-            delete _models[i];
-        }
-    }
-
-private:
-    std::vector <
-    pdevs::Simulator < common::DoubleTime,
-                       Beep < SchedulerHandle >,
-                       SchedulerHandle,
-                       paradevs::common::NoParameters >* > _models;
-};
-
-template < class SchedulerHandle >
-class Linear2GraphManager :
-        public pdevs::GraphManager < common::DoubleTime, SchedulerHandle,
-                                     paradevs::common::NoParameters >
-{
-public:
-    Linear2GraphManager(common::Coordinator < common::DoubleTime,
-                                              SchedulerHandle >* coordinator,
-                        const paradevs::common::NoParameters& parameters) :
-        pdevs::GraphManager < common::DoubleTime, SchedulerHandle,
-                              paradevs::common::NoParameters >(
-                                  coordinator, parameters)
-    {
-        for (unsigned int i = 1; i <= 100; ++i) {
-            std::ostringstream ss;
-
-            ss << "a" << i;
-            _models.push_back(
-                new pdevs::Simulator < common::DoubleTime,
-                                       Beep < SchedulerHandle >,
-                                       SchedulerHandle,
-                                       paradevs::common::NoParameters >(
-                                           ss.str(),
-                                           paradevs::common::NoParameters()));
-        }
-        for (unsigned int i = 0; i < 100; ++i) {
-            Linear2GraphManager < SchedulerHandle >::add_child(_models[i]);
-
-            _models[i]->add_in_port("in");
-            _models[i]->add_out_port("out");
-        }
-        for (unsigned int i = 0; i < 99; ++i) {
-            Linear2GraphManager < SchedulerHandle >::add_link(_models[i], "out",
-                                                              _models[i + 1],
-                                                              "in");
-        }
-
-        coordinator->add_in_port("in");
-        coordinator->add_out_port("out");
-
-        Linear2GraphManager < SchedulerHandle >::add_link(coordinator, "in",
-                                                          _models[0], "in");
-        Linear2GraphManager < SchedulerHandle >::add_link(_models[49], "out",
-                                                          coordinator, "out");
-    }
-
-    virtual ~Linear2GraphManager()
-    {
-        for (unsigned int i = 0; i < 100; ++i) {
-            delete _models[i];
-        }
-    }
-
-private:
-    std::vector <
-        pdevs::Simulator < common::DoubleTime, Beep < SchedulerHandle >,
-                           SchedulerHandle,
-                           paradevs::common::NoParameters >* > _models;
-};
-
-class Root2GraphManager :
-        public pdevs::GraphManager < common::DoubleTime, SchedulerHandle,
-                                     paradevs::common::NoParameters >
-{
-public:
-    Root2GraphManager(common::Coordinator < common::DoubleTime,
-                                            SchedulerHandle >* coordinator,
-                      const paradevs::common::NoParameters& parameters) :
-        pdevs::GraphManager < common::DoubleTime, SchedulerHandle,
-                              paradevs::common::NoParameters >(
-                                  coordinator, parameters),
-        S1("S1", paradevs::common::NoParameters(),
-           paradevs::common::NoParameters()),
-        S2("S2", paradevs::common::NoParameters(),
-           paradevs::common::NoParameters())
-    {
-        add_child(&S1);
-        add_child(&S2);
-        add_link(&S1, "out", &S2, "in");
-    }
-
-    virtual ~Root2GraphManager()
-    { }
-
-private:
-    paradevs::pdevs::Coordinator <
-        common::DoubleTime,
-        SchedulerType,
-        SchedulerHandle,
-        Linear2GraphManager < SchedulerHandle > > S1;
-    paradevs::pdevs::Coordinator <
-        common::DoubleTime,
-        SchedulerType,
-        SchedulerHandle,
-        Linear2GraphManager < SchedulerHandle > > S2;
-};
-
-class Root3GraphManager :
-        public pdevs::GraphManager <
-            common::DoubleTime,
-            paradevs::common::scheduler::NoSchedulerHandle,
-            paradevs::common::NoParameters >
-{
-public:
-    Root3GraphManager(
-        common::Coordinator <
-            common::DoubleTime,
-            paradevs::common::scheduler::NoSchedulerHandle >* coordinator,
-        const paradevs::common::NoParameters& parameters) :
-        pdevs::GraphManager < common::DoubleTime,
-                              paradevs::common::scheduler::NoSchedulerHandle,
-                              paradevs::common::NoParameters >(
-                                  coordinator, parameters),
-        S1("S1", paradevs::common::NoParameters(),
-           paradevs::common::NoParameters()),
-        S2("S2", paradevs::common::NoParameters(),
-           paradevs::common::NoParameters())
-    {
-        add_child(&S1);
-        add_child(&S2);
-        add_link(&S1, "out", &S2, "in");
-    }
-
-    virtual ~Root3GraphManager()
-    { }
-
-private:
-    pdevs::Coordinator <
-        common::DoubleTime,
-        paradevs::common::scheduler::VectorScheduler < common::DoubleTime >,
-        paradevs::common::scheduler::NoSchedulerHandle,
-        Linear2GraphManager < paradevs::common::scheduler::NoSchedulerHandle >
-    > S1;
-    pdevs::Coordinator <
-        common::DoubleTime,
-        paradevs::common::scheduler::VectorScheduler < common::DoubleTime >,
-        paradevs::common::scheduler::NoSchedulerHandle,
-        Linear2GraphManager < paradevs::common::scheduler::NoSchedulerHandle >
-    > S2;
-};
-
-} } } // namespace paradevs tests mixed
-
-#endif

+ 0 - 622
src/tests/mixed/models.hpp

@@ -1,622 +0,0 @@
-/**
- * @file tests/mixed/models.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 TESTS_MIXED_MODELS_HPP
-#define TESTS_MIXED_MODELS_HPP 1
-
-#include <common/time/DoubleTime.hpp>
-#include <common/utils/Trace.hpp>
-
-#include <kernel/dtss/Dynamics.hpp>
-
-#include <kernel/pdevs/Dynamics.hpp>
-
-namespace paradevs { namespace tests { namespace mixed {
-
-template < class SchedulerHandle>
-class A1 :
-        public paradevs::pdevs::Dynamics < common::DoubleTime, SchedulerHandle,
-                                           paradevs::common::NoParameters >
-{
-public:
-    A1(const std::string& name,
-       const paradevs::common::NoParameters& parameters) :
-        paradevs::pdevs::Dynamics < common::DoubleTime, SchedulerHandle,
-                                    paradevs::common::NoParameters >(
-                                        name, parameters)
-    { }
-    virtual ~A1()
-    { }
-
-    void dint(typename common::DoubleTime::type t)
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace() <<
-            common::TraceElement < common::DoubleTime >(
-                A1 < SchedulerHandle >::get_name(), t, common::DELTA_INT);
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        if (_phase == SEND) {
-            _phase = WAIT;
-        }
-    }
-
-    void dext(typename common::DoubleTime::type t,
-              typename common::DoubleTime::type /* e */,
-              const common::Bag < common::DoubleTime, SchedulerHandle >& msgs)
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-        (void)msgs;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                A1 < SchedulerHandle >::get_name(), t, common::DELTA_EXT)
-            << "messages = " << msgs.to_string();
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        _phase = SEND;
-    }
-
-    void dconf(typename common::DoubleTime::type t,
-               typename common::DoubleTime::type /* e */,
-               const common::Bag < common::DoubleTime, SchedulerHandle >& msgs)
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-        (void)msgs;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                A1 < SchedulerHandle >::get_name(), t, common::DELTA_CONF)
-            << "messages = " << msgs.to_string();
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-    }
-
-    typename common::DoubleTime::type start(typename common::DoubleTime::type t)
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                A1 < SchedulerHandle >::get_name(), t, common::START);
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-        _phase = WAIT;
-        return 0;
-    }
-
-    typename common::DoubleTime::type ta(
-        typename common::DoubleTime::type t) const
-    {
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                A1 < SchedulerHandle >::get_name(), t, common::TA);
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-        if (_phase == WAIT) {
-            return 1;
-        } else {
-            return 0;
-        }
-    }
-
-    common::Bag < common::DoubleTime, SchedulerHandle > lambda(
-        typename common::DoubleTime::type t) const
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-
-        common::Bag < common::DoubleTime, SchedulerHandle > msgs;
-
-        msgs.push_back(common::ExternalEvent < common::DoubleTime,
-                                               SchedulerHandle >("out", 0.));
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                A1 < SchedulerHandle >::get_name(), t, common::LAMBDA)
-            << "messages = " << msgs.to_string();
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        return msgs;
-    }
-
-private:
-    enum Phase { WAIT, SEND };
-
-    Phase _phase;
-};
-
-template < class SchedulerHandle>
-class B1 :
-        public paradevs::pdevs::Dynamics < common::DoubleTime, SchedulerHandle,
-                                           paradevs::common::NoParameters >
-{
-public:
-    B1(const std::string& name,
-       const paradevs::common::NoParameters& parameters) :
-        paradevs::pdevs::Dynamics < common::DoubleTime, SchedulerHandle,
-                                    paradevs::common::NoParameters >(
-                                        name, parameters)
-    { }
-    virtual ~B1()
-    { }
-
-    void dint(typename common::DoubleTime::type t)
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                B1 < SchedulerHandle >::get_name(), t, common::DELTA_INT);
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        if (_phase == SEND) {
-            _phase = WAIT;
-        }
-    }
-
-    void dext(typename common::DoubleTime::type t,
-              typename common::DoubleTime::type /* e */,
-              const common::Bag < common::DoubleTime, SchedulerHandle >& msgs)
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-        (void)msgs;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                B1 < SchedulerHandle >::get_name(), t, common::DELTA_EXT)
-            << "messages = " << msgs.to_string();
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        _phase = SEND;
-    }
-
-    void dconf(typename common::DoubleTime::type t,
-               typename common::DoubleTime::type /* e */,
-               const common::Bag < common::DoubleTime, SchedulerHandle >& msgs)
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-        (void)msgs;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                B1 < SchedulerHandle >::get_name(), t, common::DELTA_CONF)
-            << "messages = " << msgs.to_string();
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-    }
-
-    typename common::DoubleTime::type start(typename common::DoubleTime::type t)
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                B1 < SchedulerHandle >::get_name(), t, common::START);
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        _phase = WAIT;
-        return std::numeric_limits < double >::max();
-    }
-
-    typename common::DoubleTime::type ta(
-        typename common::DoubleTime::type t) const
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                B1 < SchedulerHandle >::get_name(), t, common::TA);
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        if (_phase == WAIT) {
-            return std::numeric_limits < double >::max();
-        } else {
-            return 0;
-        }
-    }
-
-    common::Bag < common::DoubleTime, SchedulerHandle > lambda(
-        typename common::DoubleTime::type t) const
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-        common::Bag < common::DoubleTime, SchedulerHandle > msgs;
-
-        msgs.push_back(common::ExternalEvent < common::DoubleTime,
-                                               SchedulerHandle >("out", t));
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                B1 < SchedulerHandle >::get_name(), t, common::LAMBDA)
-            << "messages = " << msgs.to_string();
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        return msgs;
-    }
-
-private:
-    enum Phase { WAIT, SEND };
-
-    Phase _phase;
-};
-
-template < class SchedulerHandle >
-class A2 :
-        public paradevs::dtss::Dynamics < common::DoubleTime, SchedulerHandle >
-{
-public:
-    A2(const std::string& name,
-       const paradevs::common::NoParameters& parameters) :
-        paradevs::dtss::Dynamics < common::DoubleTime, SchedulerHandle,
-                                   paradevs::common::NoParameters >(
-                                       name, parameters)
-    { }
-    virtual ~A2()
-    { }
-
-    void transition(
-        const common::Bag < common::DoubleTime, SchedulerHandle >& x,
-        typename common::DoubleTime::type t)
-    {
-
-#ifndef WITH_TRACE
-        (void)x;
-        (void)t;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                A2 < SchedulerHandle >::get_name(), t, common::DELTA_INT)
-            << "x = " << x.to_string();
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-    }
-
-    typename common::DoubleTime::type start(typename common::DoubleTime::type t)
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                A2 < SchedulerHandle >::get_name(), t, common::START);
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        return 0;
-    }
-
-    common::Bag < common::DoubleTime, SchedulerHandle > lambda(
-        typename common::DoubleTime::type t) const
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-        common::Bag < common::DoubleTime, SchedulerHandle > msgs;
-
-        msgs.push_back(
-            common::ExternalEvent < common::DoubleTime,
-                                    SchedulerHandle >( "out", 0.));
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                A2 < SchedulerHandle >::get_name(), t, common::LAMBDA)
-            << "messages = " << msgs.to_string();
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        return msgs;
-    }
-};
-
-template < class SchedulerHandle >
-class B2 :
-        public paradevs::dtss::Dynamics < common::DoubleTime, SchedulerHandle >
-{
-public:
-    B2(const std::string& name,
-       const paradevs::common::NoParameters& parameters) :
-        paradevs::dtss::Dynamics < common::DoubleTime, SchedulerHandle,
-                                   paradevs::common::NoParameters >(
-                                       name, parameters)
-    { }
-    virtual ~B2()
-    { }
-
-    void transition(
-        const common::Bag < common::DoubleTime, SchedulerHandle >& x,
-        typename common::DoubleTime::type t)
-    {
-
-#ifndef WITH_TRACE
-        (void)x;
-        (void)t;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                B2 < SchedulerHandle >::get_name(), t, common::DELTA_INT)
-            << "x = " << x.to_string();
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-    }
-
-    typename common::DoubleTime::type start(typename common::DoubleTime::type t)
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                B2 < SchedulerHandle >::get_name(), t, common::START);
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        return 0;
-    }
-
-    common::Bag < common::DoubleTime, SchedulerHandle > lambda(
-        typename common::DoubleTime::type t) const
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-        common::Bag < common::DoubleTime, SchedulerHandle > msgs;
-
-        msgs.push_back(
-            common::ExternalEvent < common::DoubleTime,
-                                    SchedulerHandle >("out", 0.));
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                B2 < SchedulerHandle >::get_name(), t, common::LAMBDA)
-            << "messages = " << msgs.to_string();
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        return msgs;
-    }
-};
-
-template < class SchedulerHandle>
-class Beep :
-        public paradevs::pdevs::Dynamics < common::DoubleTime, SchedulerHandle,
-                                           paradevs::common::NoParameters >
-{
-public:
-    Beep(const std::string& name,
-         const paradevs::common::NoParameters& parameters) :
-        paradevs::pdevs::Dynamics < common::DoubleTime, SchedulerHandle,
-                                    paradevs::common::NoParameters >(name,
-                                                                     parameters)
-    { }
-    virtual ~Beep()
-    { }
-
-    void dint(typename common::DoubleTime::type t)
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace() <<
-            common::TraceElement < common::DoubleTime >(
-                Beep < SchedulerHandle >::get_name(), t, common::DELTA_INT);
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        if (_phase == SEND) {
-            _phase = WAIT;
-        }
-    }
-
-    void dext(typename common::DoubleTime::type t,
-              typename common::DoubleTime::type /* e */,
-              const common::Bag < common::DoubleTime, SchedulerHandle >& msgs)
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-        (void)msgs;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                Beep < SchedulerHandle >::get_name(), t, common::DELTA_EXT)
-            << "messages = " << msgs.to_string();
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        _phase = SEND;
-    }
-
-    void dconf(typename common::DoubleTime::type t,
-               typename common::DoubleTime::type /* e */,
-               const common::Bag < common::DoubleTime, SchedulerHandle >& msgs)
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-        (void)msgs;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                Beep < SchedulerHandle >::get_name(), t, common::DELTA_CONF)
-            << "messages = " << msgs.to_string();
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-    }
-
-    typename common::DoubleTime::type start(typename common::DoubleTime::type t)
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                Beep < SchedulerHandle >::get_name(), t, common::START);
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        _phase = WAIT;
-        return 0;
-    }
-
-    typename common::DoubleTime::type ta(
-        typename common::DoubleTime::type t) const
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                Beep < SchedulerHandle >::get_name(), t, common::TA);
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        if (_phase == WAIT) {
-            return (rand() % 100) / 10.;
-        } else {
-            return 0;
-        }
-    }
-
-    common::Bag < common::DoubleTime, SchedulerHandle > lambda(
-        typename common::DoubleTime::type t) const
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-        common::Bag < common::DoubleTime, SchedulerHandle > msgs;
-
-        msgs.push_back(common::ExternalEvent < common::DoubleTime,
-                                               SchedulerHandle >("out", 0.));
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                Beep < SchedulerHandle >::get_name(), t, common::LAMBDA)
-            << "messages = " << msgs.to_string();
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        return msgs;
-    }
-
-private:
-    enum Phase { WAIT, SEND };
-
-    Phase _phase;
-};
-
-} } } // namespace paradevs tests mixed
-
-#endif

+ 0 - 124
src/tests/mixed/tests.cpp

@@ -1,124 +0,0 @@
-/**
- * @file tests/mixed/tests.cpp
- * @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/>.
- */
-
-#include <common/RootCoordinator.hpp>
-
-#include <tests/mixed/graph_manager.hpp>
-#include <tests/mixed/models.hpp>
-
-#define CATCH_CONFIG_MAIN
-#include <tests/catch.hpp>
-
-using namespace paradevs::tests::mixed;
-using namespace paradevs::common;
-
-TEST_CASE("mixed/hierachical", "run")
-{
-    paradevs::common::RootCoordinator <
-        DoubleTime,
-        paradevs::pdevs::Coordinator <
-            DoubleTime,
-            paradevs::common::scheduler::HeapScheduler <
-                DoubleTime, SchedulerHandle >,
-            SchedulerHandle,
-            RootGraphManager >
-        > rc(0, 100, "root");
-
-    paradevs::common::Trace < DoubleTime >::trace().clear();
-    rc.run();
-
-    REQUIRE(paradevs::common::Trace < DoubleTime >::trace().elements().
-            filter_model_name("a1").
-            filter_type(paradevs::common::START).size() == 1);
-    REQUIRE(paradevs::common::Trace < DoubleTime >::trace().elements().
-            filter_model_name("b1").
-            filter_type(paradevs::common::START).size() == 1);
-    REQUIRE(paradevs::common::Trace < DoubleTime >::trace().elements().
-            filter_model_name("a2").
-            filter_type(paradevs::common::START).size() == 1);
-    REQUIRE(paradevs::common::Trace < DoubleTime >::trace().elements().
-            filter_model_name("b2").
-            filter_type(paradevs::common::START).size() == 1);
-
-    REQUIRE(paradevs::common::Trace < DoubleTime >::trace().elements().
-            filter_model_name("a1").
-            filter_type(paradevs::common::DELTA_EXT).size() == 0);
-    for (double t = 0; t <= 100; ++t) {
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a1").filter_time(t).
-                filter_type(paradevs::common::LAMBDA).size() == 1);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a1").filter_time(t).
-                filter_type(paradevs::common::DELTA_INT).size() == 1);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a1").filter_time(t).
-                filter_type(paradevs::common::TA).size() == 1);
-    }
-
-    for (double t = 0; t <= 100; ++t) {
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("b1").filter_time(t).
-                filter_type(paradevs::common::LAMBDA).size() == 1);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("b1").filter_time(t).
-                filter_type(paradevs::common::DELTA_INT).size() == 1);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("b1").filter_time(t).
-                filter_type(paradevs::common::TA).size() == 2);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("b1").filter_time(t).
-                filter_type(paradevs::common::DELTA_EXT).size() == 1);
-    }
-
-    for (unsigned int t = 0; t <= 100; t += 20) {
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a2").filter_time(t).
-                filter_type(paradevs::common::LAMBDA).size() == 1);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a2").filter_time(t).
-                filter_type(paradevs::common::DELTA_INT).size() == 1);
-    }
-
-    for (unsigned int t = 0; t <= 100; t += 20) {
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("b2").filter_time(t).
-                filter_type(paradevs::common::LAMBDA).size() == 1);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("b2").filter_time(t).
-                filter_type(paradevs::common::DELTA_INT).size() == 1);
-    }
-}

+ 0 - 19
src/tests/multithreading/CMakeLists.txt

@@ -1,19 +0,0 @@
-INCLUDE_DIRECTORIES(
-  ${PARADEVS_BINARY_DIR}/src
-  ${PARADEVS_SOURCE_DIR}/src
-  ${Boost_INCLUDE_DIRS}
-  ${GLIBMM_INCLUDE_DIRS}
-  ${LIBXML_INCLUDE_DIRS})
-
-LINK_DIRECTORIES(
-  ${GLIBMM_LIBRARY_DIRS}
-  ${LIBXML_LIBRARY_DIR})
-
-ADD_EXECUTABLE(pdevs-multithreading-tests ${COMMON_HPP} ${COMMON_SCHEDULER_HPP}
-  ${PDEVS_HPP} ${PDEVS_MULTITHREADING_HPP} graph_manager.hpp tests.cpp)
-SET_TARGET_PROPERTIES(pdevs-multithreading-tests PROPERTIES
-  ${PARADEVS_APP_PROPERTIES})
-
-TARGET_LINK_LIBRARIES(pdevs-multithreading-tests
-  ${Boost_SYSTEM_LIBRARY}
-  ${Boost_TIMER_LIBRARY})

+ 0 - 406
src/tests/multithreading/graph_manager.hpp

@@ -1,406 +0,0 @@
-/**
- * @file tests/multithreading/graph_manager.cpp
- * @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 TESTS_PDEVS_MULTITHREADING_GRAPH_MANAGER_HPP
-#define TESTS_PDEVS_MULTITHREADING_GRAPH_MANAGER_HPP 1
-
-#include <tests/pdevs/models.hpp>
-#include <tests/pdevs/graph_manager.hpp>
-
-#include <kernel/pdevs/multithreading/Coordinator.hpp>
-#include <kernel/pdevs/GraphManager.hpp>
-#include <kernel/pdevs/Simulator.hpp>
-
-namespace paradevs { namespace tests { namespace multithreading {
-
-template < class SchedulerHandle >
-class S1GraphManager :
-        public paradevs::pdevs::GraphManager < common::DoubleTime,
-                                               SchedulerHandle >
-{
-public:
-    S1GraphManager(common::Coordinator < common::DoubleTime,
-                                         SchedulerHandle >* coordinator,
-                   const paradevs::common::NoParameters& parameters) :
-        paradevs::pdevs::GraphManager < common::DoubleTime,
-                                        SchedulerHandle >(coordinator,
-                                                          parameters),
-        a("a1", common::NoParameters()), b("b1", common::NoParameters())
-    {
-        S1GraphManager < SchedulerHandle >::add_child(&a);
-        S1GraphManager < SchedulerHandle >::add_child(&b);
-
-        a.add_out_port("out");
-        b.add_in_port("in");
-        b.add_out_port("out");
-        coordinator->add_out_port("out");
-
-        S1GraphManager < SchedulerHandle >::add_link(&a, "out", &b, "in");
-        S1GraphManager < SchedulerHandle >::add_link(&b, "out",
-                                                     coordinator, "out");
-    }
-
-    void init()
-    { }
-
-    void start(common::DoubleTime::type /* t */)
-    { }
-
-    void transition(
-        const common::Models < common::DoubleTime,
-                               pdevs::SchedulerHandle >& /* receivers */,
-        common::DoubleTime::type /* t */)
-    { }
-
-    virtual ~S1GraphManager()
-    { }
-
-private:
-    paradevs::pdevs::Simulator < common::DoubleTime,
-                                 pdevs::A < SchedulerHandle >,
-                                 SchedulerHandle > a;
-    paradevs::pdevs::Simulator < common::DoubleTime,
-                                 pdevs::B < SchedulerHandle >,
-                                 SchedulerHandle > b;
-};
-
-template < class SchedulerHandle >
-class S2GraphManager :
-        public paradevs::pdevs::GraphManager < common::DoubleTime,
-                                               SchedulerHandle >
-{
-public:
-    S2GraphManager(common::Coordinator < common::DoubleTime,
-                                         SchedulerHandle >* coordinator,
-                   const paradevs::common::NoParameters& parameters) :
-        paradevs::pdevs::GraphManager < common::DoubleTime,
-                                        SchedulerHandle >(coordinator,
-                                                          parameters),
-        a("a2", common::NoParameters()), b("b2", common::NoParameters())
-    {
-        S2GraphManager < SchedulerHandle >::add_child(&a);
-        S2GraphManager < SchedulerHandle >::add_child(&b);
-
-        a.add_in_port("in");
-        a.add_out_port("out");
-        b.add_in_port("in");
-        coordinator->add_in_port("in");
-
-        S2GraphManager < SchedulerHandle >::add_link(&a, "out", &b, "in");
-        S2GraphManager < SchedulerHandle >::add_link(coordinator, "in",
-                                                     &a, "in");
-    }
-
-    void init()
-    { }
-
-    void start(common::DoubleTime::type /* t */)
-    { }
-
-    void transition(
-        const common::Models < common::DoubleTime,
-                               pdevs::SchedulerHandle >& /* receivers */,
-        common::DoubleTime::type /* t */)
-    { }
-
-    virtual ~S2GraphManager()
-    { }
-
-private:
-    paradevs::pdevs::Simulator < common::DoubleTime,
-                                 pdevs::A < SchedulerHandle >,
-                                 SchedulerHandle > a;
-    paradevs::pdevs::Simulator < common::DoubleTime,
-                                 pdevs::B < SchedulerHandle >,
-                                 SchedulerHandle > b;
-};
-
-class RootGraphManager :
-        public paradevs::pdevs::GraphManager < common::DoubleTime,
-                                               pdevs::SchedulerHandle >
-{
-public:
-    RootGraphManager(
-        common::Coordinator < common::DoubleTime,
-                              pdevs::SchedulerHandle >* coordinator,
-        const paradevs::common::NoParameters& parameters) :
-        paradevs::pdevs::GraphManager < common::DoubleTime,
-                                        pdevs::SchedulerHandle >(
-                                            coordinator, parameters),
-        S1("S1", paradevs::common::NoParameters(),
-           paradevs::common::NoParameters()),
-        S2("S2", paradevs::common::NoParameters(),
-           paradevs::common::NoParameters())
-    {
-        add_child(&S1);
-        add_child(&S2);
-
-        add_link(&S1, "out", &S2, "in");
-    }
-
-    void init()
-    {
-        S1.set_sender(
-            dynamic_cast < paradevs::pdevs::multithreading::Coordinator <
-                common::DoubleTime,
-                paradevs::common::scheduler::HeapScheduler <
-                    common::DoubleTime, pdevs::SchedulerHandle >,
-                pdevs::SchedulerHandle,
-                paradevs::tests::multithreading::RootGraphManager >*
-            >(get_coordinator())->get_sender());
-        S2.set_sender(
-            dynamic_cast < paradevs::pdevs::multithreading::Coordinator <
-                common::DoubleTime,
-                paradevs::common::scheduler::HeapScheduler <
-                    common::DoubleTime, pdevs::SchedulerHandle >,
-                pdevs::SchedulerHandle,
-                paradevs::tests::multithreading::RootGraphManager >*
-            >(get_coordinator())->get_sender());
-    }
-
-    void start(common::DoubleTime::type t)
-    {
-        S1.get_sender().send(
-            paradevs::pdevs::multithreading::start_message <
-                common::DoubleTime >(t));
-        S2.get_sender().send(
-            paradevs::pdevs::multithreading::start_message <
-                common::DoubleTime >(t));
-    }
-
-    void transition(const common::Models < common::DoubleTime,
-                                           pdevs::SchedulerHandle >& receivers,
-                    common::DoubleTime::type t)
-    {
-        if (std::find(receivers.begin(), receivers.end(),
-                      &S1) != receivers.end()) {
-            S1.get_sender().send(
-                paradevs::pdevs::multithreading::transition_message <
-                    common::DoubleTime >(t));
-        }
-        if (std::find(receivers.begin(), receivers.end(),
-                      &S2) != receivers.end()) {
-            S2.get_sender().send(
-                paradevs::pdevs::multithreading::transition_message <
-                    common::DoubleTime >(t));
-        }
-    }
-
-    virtual ~RootGraphManager()
-    { }
-
-private:
-    paradevs::pdevs::multithreading::Coordinator <
-        common::DoubleTime,
-        pdevs::SchedulerType,
-        pdevs::SchedulerHandle,
-        S1GraphManager < pdevs::SchedulerHandle > > S1;
-    paradevs::pdevs::multithreading::Coordinator <
-        common::DoubleTime,
-        pdevs::SchedulerType,
-        pdevs::SchedulerHandle,
-        S2GraphManager < pdevs::SchedulerHandle > > S2;
-};
-
-template < class SchedulerHandle >
-class S3GraphManager :
-        public paradevs::pdevs::GraphManager < common::DoubleTime,
-                                               SchedulerHandle >
-{
-public:
-    S3GraphManager(common::Coordinator < common::DoubleTime,
-                                         SchedulerHandle >* coordinator,
-                   const paradevs::common::NoParameters& parameters) :
-        paradevs::pdevs::GraphManager < common::DoubleTime,
-                                        SchedulerHandle >(coordinator,
-                                                          parameters)
-    {
-        coordinator->add_out_port("out");
-        for (unsigned int i = 0; i < 10; ++i) {
-            std::ostringstream ss;
-            simulator_type* s = new simulator_type(ss.str(),
-                                                   common::NoParameters());
-
-            ss << "a" << (i + 1);
-            _simulators.push_back(s);
-            S3GraphManager < SchedulerHandle >::add_child(s);
-            s->add_out_port("out");
-        }
-    }
-
-    void init()
-    { }
-
-    void start(common::DoubleTime::type /* t */)
-    { }
-
-    void transition(
-        const common::Models < common::DoubleTime,
-                               pdevs::SchedulerHandle >& /* receivers */,
-        common::DoubleTime::type /* t */)
-    { }
-
-    virtual ~S3GraphManager()
-    {
-        for (typename std::vector < simulator_type* >::const_iterator it =
-                 _simulators.begin(); it != _simulators.end(); ++it) {
-            delete *it;
-        }
-    }
-
-private:
-    typedef paradevs::pdevs::Simulator < common::DoubleTime,
-                                         pdevs::A < SchedulerHandle >,
-                                         SchedulerHandle > simulator_type;
-
-    std::vector < simulator_type* > _simulators;
-};
-
-class Root2GraphManager :
-        public paradevs::pdevs::GraphManager < common::DoubleTime,
-                                               pdevs::SchedulerHandle >
-{
-public:
-    Root2GraphManager(
-        common::Coordinator < common::DoubleTime,
-                              pdevs::SchedulerHandle >* coordinator,
-        const paradevs::common::NoParameters& parameters) :
-        paradevs::pdevs::GraphManager < common::DoubleTime,
-                                        pdevs::SchedulerHandle >(
-                                            coordinator, parameters),
-        S1("S1", paradevs::common::NoParameters(),
-           paradevs::common::NoParameters()),
-        S2("S2", paradevs::common::NoParameters(),
-           paradevs::common::NoParameters())
-    {
-        add_child(&S1);
-        add_child(&S2);
-    }
-
-    void init()
-    {
-        S1.set_sender(
-            dynamic_cast < paradevs::pdevs::multithreading::Coordinator <
-                common::DoubleTime,
-                paradevs::common::scheduler::HeapScheduler <
-                    common::DoubleTime, pdevs::SchedulerHandle >,
-                pdevs::SchedulerHandle,
-                paradevs::tests::multithreading::Root2GraphManager >*
-            >(get_coordinator())->get_sender());
-        S2.set_sender(
-            dynamic_cast < paradevs::pdevs::multithreading::Coordinator <
-                common::DoubleTime,
-                paradevs::common::scheduler::HeapScheduler <
-                    common::DoubleTime, pdevs::SchedulerHandle >,
-                pdevs::SchedulerHandle,
-                paradevs::tests::multithreading::Root2GraphManager >*
-            >(get_coordinator())->get_sender());
-    }
-
-    void start(common::DoubleTime::type t)
-    {
-        S1.get_sender().send(
-            paradevs::pdevs::multithreading::start_message <
-                common::DoubleTime >(t));
-        S2.get_sender().send(
-            paradevs::pdevs::multithreading::start_message <
-                common::DoubleTime >(t));
-    }
-
-    void transition(const common::Models < common::DoubleTime,
-                                           pdevs::SchedulerHandle >& receivers,
-                    common::DoubleTime::type t)
-    {
-        if (std::find(receivers.begin(), receivers.end(),
-                      &S1) != receivers.end()) {
-            S1.get_sender().send(
-                paradevs::pdevs::multithreading::transition_message <
-                    common::DoubleTime >(t));
-        }
-        if (std::find(receivers.begin(), receivers.end(),
-                      &S2) != receivers.end()) {
-            S2.get_sender().send(
-                paradevs::pdevs::multithreading::transition_message <
-                    common::DoubleTime >(t));
-        }
-    }
-
-    virtual ~Root2GraphManager()
-    { }
-
-private:
-    paradevs::pdevs::multithreading::Coordinator <
-        common::DoubleTime,
-        pdevs::SchedulerType,
-        pdevs::SchedulerHandle,
-        S3GraphManager < pdevs::SchedulerHandle > > S1;
-    paradevs::pdevs::multithreading::Coordinator <
-        common::DoubleTime,
-        pdevs::SchedulerType,
-        pdevs::SchedulerHandle,
-        S3GraphManager < pdevs::SchedulerHandle > > S2;
-};
-
-class Root3GraphManager :
-        public paradevs::pdevs::GraphManager < common::DoubleTime,
-                                               pdevs::SchedulerHandle >
-{
-public:
-    Root3GraphManager(
-        common::Coordinator < common::DoubleTime,
-                              pdevs::SchedulerHandle >* coordinator,
-        const paradevs::common::NoParameters& parameters) :
-        paradevs::pdevs::GraphManager < common::DoubleTime,
-                                        pdevs::SchedulerHandle >(
-                                            coordinator, parameters),
-        S1("S1", paradevs::common::NoParameters(),
-           paradevs::common::NoParameters()),
-        S2("S2", paradevs::common::NoParameters(),
-           paradevs::common::NoParameters())
-    {
-        add_child(&S1);
-        add_child(&S2);
-    }
-
-    virtual ~Root3GraphManager()
-    { }
-
-private:
-    paradevs::pdevs::Coordinator <
-        common::DoubleTime,
-        pdevs::SchedulerType,
-        pdevs::SchedulerHandle,
-        S3GraphManager < pdevs::SchedulerHandle > > S1;
-    paradevs::pdevs::Coordinator <
-        common::DoubleTime,
-        pdevs::SchedulerType,
-        pdevs::SchedulerHandle,
-        S3GraphManager < pdevs::SchedulerHandle > > S2;
-};
-
-} } } // namespace paradevs tests multithreading
-
-#endif

+ 0 - 139
src/tests/multithreading/tests.cpp

@@ -1,139 +0,0 @@
-/**
- * @file tests/multithreading/tests.cpp
- * @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/>.
- */
-
-#include <tests/multithreading/graph_manager.hpp>
-#include <tests/pdevs/graph_manager.hpp>
-
-#include <common/RootCoordinator.hpp>
-
-#include <chrono>
-
-#define CATCH_CONFIG_MAIN
-#include <tests/catch.hpp>
-
-using namespace paradevs::tests::pdevs;
-using namespace paradevs::tests::multithreading;
-using namespace paradevs::common;
-using namespace std::chrono;
-
-TEST_CASE("pdevs/multithreading/hierachical", "run")
-{
-    steady_clock::time_point t1 = steady_clock::now();
-
-    paradevs::common::RootCoordinator <
-        DoubleTime, paradevs::pdevs::multithreading::Coordinator <
-            DoubleTime,
-            paradevs::common::scheduler::HeapScheduler <
-                DoubleTime, SchedulerHandle >,
-            SchedulerHandle,
-            paradevs::tests::multithreading::RootGraphManager >
-        > rc(0, 100, "root", paradevs::common::NoParameters(),
-             paradevs::common::NoParameters());
-
-    rc.run();
-
-    steady_clock::time_point t2 = steady_clock::now();
-
-    duration < double > time_span = duration_cast <
-        duration < double > >(t2 - t1);
-
-    std::cout << "multithreading/dependant -> " << time_span.count()
-              << std::endl;
-}
-
-TEST_CASE("pdevs/classic/hierachical", "run")
-{
-    steady_clock::time_point t1 = steady_clock::now();
-
-    paradevs::common::RootCoordinator <
-        DoubleTime, paradevs::pdevs::Coordinator <
-            DoubleTime,
-            paradevs::common::scheduler::HeapScheduler <
-                DoubleTime, SchedulerHandle >,
-            SchedulerHandle,
-            paradevs::tests::pdevs::RootGraphManager >
-        > rc(0, 100, "root", paradevs::common::NoParameters(),
-             paradevs::common::NoParameters());
-
-    rc.run();
-
-    steady_clock::time_point t2 = steady_clock::now();
-
-    duration < double > time_span = duration_cast <
-        duration < double > >(t2 - t1);
-
-    std::cout << "classic/dependant -> " << time_span.count() << std::endl;
-}
-
-TEST_CASE("pdevs/multithreading/independant", "run")
-{
-    steady_clock::time_point t1 = steady_clock::now();
-
-    paradevs::common::RootCoordinator <
-        DoubleTime, paradevs::pdevs::multithreading::Coordinator <
-            DoubleTime,
-            paradevs::common::scheduler::HeapScheduler <
-                DoubleTime, SchedulerHandle >,
-            SchedulerHandle,
-            paradevs::tests::multithreading::Root2GraphManager >
-        > rc(0, 100, "root", paradevs::common::NoParameters(),
-             paradevs::common::NoParameters());
-
-    rc.run();
-
-    steady_clock::time_point t2 = steady_clock::now();
-
-    duration < double > time_span = duration_cast <
-        duration < double > >(t2 - t1);
-
-    std::cout << "multithreading/independant -> " << time_span.count()
-              << std::endl;
-}
-
-TEST_CASE("pdevs/classic/independant", "run")
-{
-    steady_clock::time_point t1 = steady_clock::now();
-
-    paradevs::common::RootCoordinator <
-        DoubleTime, paradevs::pdevs::Coordinator <
-            DoubleTime,
-            paradevs::common::scheduler::HeapScheduler <
-                DoubleTime, SchedulerHandle >,
-            SchedulerHandle,
-            paradevs::tests::multithreading::Root3GraphManager >
-        > rc(0, 100, "root", paradevs::common::NoParameters(),
-             paradevs::common::NoParameters());
-
-    rc.run();
-
-    steady_clock::time_point t2 = steady_clock::now();
-
-    duration < double > time_span = duration_cast <
-        duration < double > >(t2 - t1);
-
-    std::cout << "classic/independant -> " << time_span.count() << std::endl;
-}
-

+ 0 - 18
src/tests/pdevs/CMakeLists.txt

@@ -1,18 +0,0 @@
-INCLUDE_DIRECTORIES(
-  ${PARADEVS_BINARY_DIR}/src
-  ${PARADEVS_SOURCE_DIR}/src
-  ${Boost_INCLUDE_DIRS}
-  ${GLIBMM_INCLUDE_DIRS}
-  ${LIBXML_INCLUDE_DIRS})
-
-LINK_DIRECTORIES(
-  ${GLIBMM_LIBRARY_DIRS}
-  ${LIBXML_LIBRARY_DIR})
-
-ADD_EXECUTABLE(pdevs-tests ${COMMON_HPP} ${COMMON_SCHEDULER_HPP} ${PDEVS_HPP}
-  graph_manager.hpp models.hpp tests.cpp)
-SET_TARGET_PROPERTIES(pdevs-tests PROPERTIES ${PARADEVS_APP_PROPERTIES})
-
-TARGET_LINK_LIBRARIES(pdevs-tests
-  ${Boost_SYSTEM_LIBRARY}
-  ${Boost_TIMER_LIBRARY})

+ 0 - 248
src/tests/pdevs/graph_manager.hpp

@@ -1,248 +0,0 @@
-/**
- * @file tests/pdevs/graph_manager.cpp
- * @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 TESTS_PDEVS_GRAPH_MANAGER_HPP
-#define TESTS_PDEVS_GRAPH_MANAGER_HPP 1
-
-#include <tests/pdevs/models.hpp>
-
-#include <common/scheduler/HeapScheduler.hpp>
-
-#include <kernel/pdevs/Coordinator.hpp>
-#include <kernel/pdevs/GraphManager.hpp>
-#include <kernel/pdevs/Simulator.hpp>
-
-namespace paradevs { namespace tests { namespace pdevs {
-
-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;
-};
-
-template < class SchedulerHandle >
-class S1GraphManager :
-        public paradevs::pdevs::GraphManager < common::DoubleTime,
-                                               SchedulerHandle >
-{
-public:
-    S1GraphManager(common::Coordinator < common::DoubleTime,
-                                         SchedulerHandle >* coordinator,
-                   const paradevs::common::NoParameters& parameters) :
-        paradevs::pdevs::GraphManager < common::DoubleTime,
-                                        SchedulerHandle >(coordinator,
-                                                          parameters),
-        a("a1", common::NoParameters()), b("b1", common::NoParameters())
-    {
-        S1GraphManager < SchedulerHandle >::add_child(&a);
-        S1GraphManager < SchedulerHandle >::add_child(&b);
-
-        a.add_out_port("out");
-        b.add_in_port("in");
-        b.add_out_port("out");
-        coordinator->add_out_port("out");
-
-        S1GraphManager < SchedulerHandle >::add_link(&a, "out", &b, "in");
-        S1GraphManager < SchedulerHandle >::add_link(&b, "out",
-                                                     coordinator, "out");
-    }
-
-    virtual ~S1GraphManager()
-    { }
-
-private:
-    paradevs::pdevs::Simulator < common::DoubleTime, A < SchedulerHandle >,
-                                 SchedulerHandle > a;
-    paradevs::pdevs::Simulator < common::DoubleTime, B < SchedulerHandle >,
-                                 SchedulerHandle > b;
-};
-
-template < class SchedulerHandle >
-class S2GraphManager :
-        public paradevs::pdevs::GraphManager < common::DoubleTime,
-                                               SchedulerHandle >
-{
-public:
-    S2GraphManager(common::Coordinator < common::DoubleTime,
-                                         SchedulerHandle >* coordinator,
-                   const paradevs::common::NoParameters& parameters) :
-        paradevs::pdevs::GraphManager < common::DoubleTime,
-                                        SchedulerHandle >(coordinator,
-                                                          parameters),
-        a("a2", common::NoParameters()), b("b2", common::NoParameters())
-    {
-        S2GraphManager < SchedulerHandle >::add_child(&a);
-        S2GraphManager < SchedulerHandle >::add_child(&b);
-
-        a.add_in_port("in");
-        a.add_out_port("out");
-        b.add_in_port("in");
-        coordinator->add_in_port("in");
-
-        S2GraphManager < SchedulerHandle >::add_link(&a, "out", &b, "in");
-        S2GraphManager < SchedulerHandle >::add_link(coordinator, "in",
-                                                     &a, "in");
-    }
-
-    virtual ~S2GraphManager()
-    { }
-
-private:
-    paradevs::pdevs::Simulator < common::DoubleTime, A < SchedulerHandle >,
-                                 SchedulerHandle > a;
-    paradevs::pdevs::Simulator < common::DoubleTime, B < SchedulerHandle >,
-                                 SchedulerHandle > b;
-};
-
-class RootGraphManager :
-        public paradevs::pdevs::GraphManager < common::DoubleTime,
-                                               SchedulerHandle >
-{
-public:
-    RootGraphManager(
-        common::Coordinator < common::DoubleTime,
-                              SchedulerHandle >* coordinator,
-        const paradevs::common::NoParameters& parameters) :
-        paradevs::pdevs::GraphManager < common::DoubleTime, SchedulerHandle >(
-                                            coordinator, parameters),
-        S1("S1", paradevs::common::NoParameters(),
-           paradevs::common::NoParameters()),
-        S2("S2", paradevs::common::NoParameters(),
-           paradevs::common::NoParameters())
-    {
-        add_child(&S1);
-        add_child(&S2);
-
-        add_link(&S1, "out", &S2, "in");
-    }
-
-    virtual ~RootGraphManager()
-    { }
-
-private:
-    paradevs::pdevs::Coordinator <
-        common::DoubleTime,
-        SchedulerType,
-        SchedulerHandle,
-        S1GraphManager < SchedulerHandle > > S1;
-    paradevs::pdevs::Coordinator <
-        common::DoubleTime,
-        SchedulerType,
-        SchedulerHandle,
-        S2GraphManager < SchedulerHandle > > S2;
-};
-
-template < class SchedulerHandle >
-class OnlyOneGraphManager :
-        public paradevs::pdevs::GraphManager < common::DoubleTime,
-                                               SchedulerHandle >
-{
-public:
-    OnlyOneGraphManager(common::Coordinator < common::DoubleTime,
-                                              SchedulerHandle >* coordinator,
-                        const paradevs::common::NoParameters& parameters) :
-        paradevs::pdevs::GraphManager < common::DoubleTime,
-                                        SchedulerHandle >(coordinator,
-                                                          parameters),
-        a("a", common::NoParameters())
-    {
-        OnlyOneGraphManager < SchedulerHandle >::add_child(&a);
-    }
-
-    virtual ~OnlyOneGraphManager()
-    { }
-
-private:
-    paradevs::pdevs::Simulator < common::DoubleTime, A < SchedulerHandle >,
-                                 SchedulerHandle > a;
-};
-
-template < class SchedulerHandle >
-class FlatGraphManager :
-        public paradevs::pdevs::GraphManager < common::DoubleTime,
-                                               SchedulerHandle >
-{
-public:
-    FlatGraphManager(common::Coordinator < common::DoubleTime,
-                                           SchedulerHandle >* coordinator,
-                     const paradevs::common::NoParameters& parameters) :
-        paradevs::pdevs::GraphManager < common::DoubleTime,
-                                        SchedulerHandle >(coordinator,
-                                                          parameters),
-        a1("a1", common::NoParameters()), b1("b1", common::NoParameters()),
-        a2("a2", common::NoParameters()), b2("b2", common::NoParameters())
-    {
-        FlatGraphManager < SchedulerHandle >::add_child(&a1);
-        FlatGraphManager < SchedulerHandle >::add_child(&b1);
-        FlatGraphManager < SchedulerHandle >::add_child(&a2);
-        FlatGraphManager < SchedulerHandle >::add_child(&b2);
-
-        a1.add_out_port("out");
-        b1.add_in_port("in");
-        b1.add_out_port("out");
-        a2.add_in_port("in");
-        a2.add_out_port("out");
-        b2.add_in_port("in");
-
-        FlatGraphManager < SchedulerHandle >::add_link(&a1, "out", &b1, "in");
-        FlatGraphManager < SchedulerHandle >::add_link(&b1, "out", &a2, "in");
-        FlatGraphManager < SchedulerHandle >::add_link(&a2, "out", &b2, "in");
-    }
-
-    virtual ~FlatGraphManager()
-    { }
-
-private:
-    paradevs::pdevs::Simulator < common::DoubleTime, A < SchedulerHandle >,
-                                 SchedulerHandle > a1;
-    paradevs::pdevs::Simulator < common::DoubleTime, B < SchedulerHandle >,
-                                 SchedulerHandle > b1;
-    paradevs::pdevs::Simulator < common::DoubleTime, A < SchedulerHandle >,
-                                 SchedulerHandle > a2;
-    paradevs::pdevs::Simulator < common::DoubleTime, B < SchedulerHandle >,
-                                 SchedulerHandle > b2;
-};
-
-} } } // namespace paradevs tests pdevs
-
-#endif

+ 0 - 357
src/tests/pdevs/models.hpp

@@ -1,357 +0,0 @@
-/**
- * @file tests/pdevs/models.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 TESTS_PDEVS_MODELS_HPP
-#define TESTS_PDEVS_MODELS_HPP 1
-
-#include <common/time/DoubleTime.hpp>
-#include <common/utils/Trace.hpp>
-
-#include <kernel/pdevs/Dynamics.hpp>
-
-#include <chrono>
-
-#define DELAY 100
-
-namespace paradevs { namespace tests { namespace pdevs {
-
-void delay()
-{
-    for (unsigned int i = 0; i < DELAY; ++i) {
-        std::vector < int > v;
-
-        for (unsigned int j = 1000; j > 0; --j) {
-            v.push_back(j);
-        }
-        std::sort(v.begin(), v.end());
-    }
-}
-
-template < class SchedulerHandle>
-class A :
-        public paradevs::pdevs::Dynamics < common::DoubleTime, SchedulerHandle >
-{
-public:
-    A(const std::string& name, const common::NoParameters& parameters) :
-        paradevs::pdevs::Dynamics < common::DoubleTime,
-                                    SchedulerHandle >(name, parameters)
-    { }
-    virtual ~A()
-    { }
-
-    void dint(typename common::DoubleTime::type t)
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                A < SchedulerHandle >::get_name(), t,
-                common::DELTA_INT);
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        delay();
-
-        if (_phase == SEND) {
-            _phase = WAIT;
-        }
-    }
-
-    void dext(typename common::DoubleTime::type t,
-              typename common::DoubleTime::type /* e */,
-              const common::Bag < common::DoubleTime, SchedulerHandle >& msgs)
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-        (void)msgs;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                A < SchedulerHandle >::get_name(), t,
-                common::DELTA_EXT)
-            << "messages = " << msgs.to_string();
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        _phase = SEND;
-    }
-
-    void dconf(typename common::DoubleTime::type t,
-               typename common::DoubleTime::type /* e */,
-               const common::Bag < common::DoubleTime, SchedulerHandle >& msgs)
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-        (void)msgs;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                A < SchedulerHandle >::get_name(), t,
-                common::DELTA_CONF)
-            << "messages = " << msgs.to_string();
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-    }
-
-    typename common::DoubleTime::type start(typename common::DoubleTime::type t)
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                A < SchedulerHandle >::get_name(), t,
-                common::START);
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        _phase = WAIT;
-        return 0;
-    }
-
-    typename common::DoubleTime::type ta(
-        typename common::DoubleTime::type t) const
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                A < SchedulerHandle >::get_name(), t,
-                common::TA);
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        if (_phase == WAIT) {
-            return 1;
-        } else {
-            return 0;
-        }
-    }
-
-    common::Bag < common::DoubleTime, SchedulerHandle > lambda(
-        typename common::DoubleTime::type t) const
-    {
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-        common::Bag < common::DoubleTime, SchedulerHandle > msgs;
-
-        msgs.push_back(
-            common::ExternalEvent < common::DoubleTime, SchedulerHandle >(
-                "out", 0.));
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                A < SchedulerHandle >::get_name(), t,
-                common::LAMBDA)
-            << "messages = " << msgs.to_string();
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        return msgs;
-    }
-
-    void observation(std::ostream& /* file */) const
-    { }
-
-private:
-    enum Phase { WAIT, SEND };
-
-    Phase _phase;
-};
-
-template < class SchedulerHandle >
-class B :
-        public paradevs::pdevs::Dynamics < common::DoubleTime, SchedulerHandle >
-{
-public:
-    B(const std::string& name, const common::NoParameters& parameters) :
-        paradevs::pdevs::Dynamics < common::DoubleTime,
-                                    SchedulerHandle >(name, parameters)
-    { }
-    virtual ~B()
-    { }
-
-    void dint(typename common::DoubleTime::type t)
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                B < SchedulerHandle >::get_name(), t,
-                common::DELTA_INT);
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        delay();
-
-        if (_phase == SEND) {
-            _phase = WAIT;
-        }
-    }
-
-    void dext(typename common::DoubleTime::type t,
-              typename common::DoubleTime::type /* e */,
-              const common::Bag < common::DoubleTime, SchedulerHandle >& msgs)
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-        (void)msgs;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                B < SchedulerHandle >::get_name(), t,
-                common::DELTA_EXT)
-            << "messages = " << msgs.to_string();
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        _phase = SEND;
-    }
-
-    void dconf(typename common::DoubleTime::type t,
-               typename common::DoubleTime::type /* e */,
-               const common::Bag < common::DoubleTime, SchedulerHandle >& msgs)
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-        (void)msgs;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                B < SchedulerHandle >::get_name(), t,
-                common::DELTA_CONF)
-            << "messages = " << msgs.to_string();
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-    }
-
-    typename common::DoubleTime::type start(typename common::DoubleTime::type t)
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                B < SchedulerHandle >::get_name(), t,
-                common::START);
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-        _phase = WAIT;
-        return std::numeric_limits < double >::max();
-    }
-
-    typename common::DoubleTime::type ta(
-        typename common::DoubleTime::type t) const
-    {
-
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                B < SchedulerHandle >::get_name(), t,
-                common::TA);
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        if (_phase == WAIT) {
-            return std::numeric_limits < double >::max();
-        } else {
-            return 0;
-        }
-    }
-
-    common::Bag < common::DoubleTime, SchedulerHandle > lambda(
-        typename common::DoubleTime::type t) const
-    {
-#ifndef WITH_TRACE
-        (void)t;
-#endif
-        common::Bag < common::DoubleTime, SchedulerHandle > msgs;
-
-        msgs.push_back(common::ExternalEvent < common::DoubleTime,
-                                               SchedulerHandle >("out", 0.));
-
-#ifdef WITH_TRACE
-        common::Trace < common::DoubleTime >::trace()
-            << common::TraceElement < common::DoubleTime >(
-                B < SchedulerHandle >::get_name(), t,
-                common::LAMBDA)
-            << "messages = " << msgs.to_string();
-        common::Trace < common::DoubleTime >::trace().flush();
-#endif
-
-        return msgs;
-    }
-
-    void observation(std::ostream& /* file */) const
-    { }
-
-private:
-    enum Phase { WAIT, SEND };
-
-    Phase _phase;
-};
-
-} } } // namespace paradevs tests pdevs
-
-#endif

+ 0 - 305
src/tests/pdevs/tests.cpp

@@ -1,305 +0,0 @@
-/**
- * @file tests/pdevs/tests.cpp
- * @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/>.
- */
-
-#include <tests/pdevs/graph_manager.hpp>
-#include <tests/pdevs/models.hpp>
-
-#include <common/RootCoordinator.hpp>
-
-#define CATCH_CONFIG_MAIN
-#include <tests/catch.hpp>
-
-using namespace paradevs::tests::pdevs;
-using namespace paradevs::common;
-
-TEST_CASE("pdevs/only_one", "run")
-{
-    paradevs::common::RootCoordinator <
-        DoubleTime, paradevs::pdevs::Coordinator <
-            DoubleTime,
-            paradevs::common::scheduler::HeapScheduler <
-                DoubleTime, SchedulerHandle >,
-            SchedulerHandle,
-            OnlyOneGraphManager < SchedulerHandle > >
-        > rc(0, 10, "root", paradevs::common::NoParameters(),
-             paradevs::common::NoParameters());
-
-    paradevs::common::Trace < DoubleTime >::trace().clear();
-    rc.run();
-
-    REQUIRE(paradevs::common::Trace <
-                DoubleTime >::trace().elements().
-            filter_model_name("a").
-            filter_type(paradevs::common::START).size() == 1);
-    REQUIRE(paradevs::common::Trace <
-                DoubleTime >::trace().elements().
-            filter_model_name("a").
-            filter_type(paradevs::common::DELTA_EXT).size() == 0);
-    REQUIRE(paradevs::common::Trace <
-                DoubleTime >::trace().elements().
-            filter_model_name("a").
-            filter_type(paradevs::common::DELTA_CONF).size() == 0);
-    for (unsigned int t = 0; t <= 10; ++t) {
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a").filter_time(t).
-                filter_type(paradevs::common::DELTA_INT).size() == 1);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a").filter_time(t).
-                filter_type(paradevs::common::TA).size() == 1);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a").filter_time(t).
-                filter_type(paradevs::common::LAMBDA).size() == 1);
-    }
-}
-
-TEST_CASE("pdevs/flat", "run")
-{
-    paradevs::common::RootCoordinator <
-        DoubleTime, paradevs::pdevs::Coordinator <
-            DoubleTime,
-            paradevs::common::scheduler::HeapScheduler <
-                DoubleTime, SchedulerHandle >,
-            SchedulerHandle,
-            FlatGraphManager < SchedulerHandle> >
-        > rc(0, 10, "root", paradevs::common::NoParameters(),
-             paradevs::common::NoParameters());
-
-    paradevs::common::Trace < DoubleTime >::trace().clear();
-    rc.run();
-
-    REQUIRE(paradevs::common::Trace <
-                DoubleTime >::trace().elements().
-            filter_model_name("a1").
-            filter_type(paradevs::common::START).size() == 1);
-    REQUIRE(paradevs::common::Trace <
-                DoubleTime >::trace().elements().
-            filter_model_name("b1").
-            filter_type(paradevs::common::START).size() == 1);
-    REQUIRE(paradevs::common::Trace <
-                DoubleTime >::trace().elements().
-            filter_model_name("a2").
-            filter_type(paradevs::common::START).size() == 1);
-    REQUIRE(paradevs::common::Trace <
-                DoubleTime >::trace().elements().
-            filter_model_name("b2").
-            filter_type(paradevs::common::START).size() == 1);
-
-    REQUIRE(paradevs::common::Trace <
-                DoubleTime >::trace().elements().
-            filter_model_name("a1").
-            filter_type(paradevs::common::DELTA_EXT).size() == 0);
-    for (unsigned int t = 0; t <= 10; ++t) {
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a1").filter_time(t).
-                filter_type(paradevs::common::LAMBDA).size() == 1);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a1").filter_time(t).
-                filter_type(paradevs::common::DELTA_INT).size() == 1);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a1").filter_time(t).
-                filter_type(paradevs::common::TA).size() == 1);
-    }
-
-    for (unsigned int t = 0; t <= 10; ++t) {
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("b1").filter_time(t).
-                filter_type(paradevs::common::LAMBDA).size() == 1);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("b1").filter_time(t).
-                filter_type(paradevs::common::DELTA_INT).size() == 1);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("b1").filter_time(t).
-                filter_type(paradevs::common::TA).size() == 2);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("b1").filter_time(t).
-                filter_type(paradevs::common::DELTA_EXT).size() == 1);
-    }
-
-    for (unsigned int t = 0; t <= 10; ++t) {
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a2").filter_time(t).
-                filter_type(paradevs::common::LAMBDA).size() == 2);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a2").filter_time(t).
-                filter_type(paradevs::common::DELTA_INT).size() == 2);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a2").filter_time(t).
-                filter_type(paradevs::common::TA).size() == 3);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a2").filter_time(t).
-                filter_type(paradevs::common::DELTA_EXT).size() == 1);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a2").filter_time(t).
-                filter_type(paradevs::common::DELTA_CONF).size() == 0);
-    }
-
-    for (unsigned int t = 0; t <= 10; ++t) {
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("b2").filter_time(t).
-                filter_type(paradevs::common::LAMBDA).size() == 2);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("b2").filter_time(t).
-                filter_type(paradevs::common::DELTA_INT).size() == 2);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("b2").filter_time(t).
-                filter_type(paradevs::common::TA).size() == 4);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("b2").filter_time(t).
-                filter_type(paradevs::common::DELTA_EXT).size() == 2);
-    }
-}
-
-TEST_CASE("pdevs/hierachical", "run")
-{
-    paradevs::common::RootCoordinator <
-        DoubleTime, paradevs::pdevs::Coordinator <
-            DoubleTime,
-            paradevs::common::scheduler::HeapScheduler <
-                DoubleTime, SchedulerHandle >,
-            SchedulerHandle,
-            RootGraphManager >
-        > rc(0, 10, "root", paradevs::common::NoParameters(),
-             paradevs::common::NoParameters());
-
-    paradevs::common::Trace < DoubleTime >::trace().clear();
-    rc.run();
-
-    REQUIRE(paradevs::common::Trace <
-                DoubleTime >::trace().elements().
-            filter_model_name("a1").
-            filter_type(paradevs::common::START).size() == 1);
-    REQUIRE(paradevs::common::Trace <
-                DoubleTime >::trace().elements().
-            filter_model_name("b1").
-            filter_type(paradevs::common::START).size() == 1);
-    REQUIRE(paradevs::common::Trace <
-                DoubleTime >::trace().elements().
-            filter_model_name("a2").
-            filter_type(paradevs::common::START).size() == 1);
-    REQUIRE(paradevs::common::Trace <
-                DoubleTime >::trace().elements().
-            filter_model_name("b2").
-            filter_type(paradevs::common::START).size() == 1);
-
-    REQUIRE(paradevs::common::Trace <
-                DoubleTime >::trace().elements().
-            filter_model_name("a1").
-            filter_type(paradevs::common::DELTA_EXT).size() == 0);
-    for (unsigned int t = 0; t <= 10; ++t) {
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a1").filter_time(t).
-                filter_type(paradevs::common::LAMBDA).size() == 1);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a1").filter_time(t).
-                filter_type(paradevs::common::DELTA_INT).size() == 1);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a1").filter_time(t).
-                filter_type(paradevs::common::TA).size() == 1);
-    }
-
-    for (unsigned int t = 0; t <= 10; ++t) {
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("b1").filter_time(t).
-                filter_type(paradevs::common::LAMBDA).size() == 1);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("b1").filter_time(t).
-                filter_type(paradevs::common::DELTA_INT).size() == 1);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("b1").filter_time(t).
-                filter_type(paradevs::common::TA).size() == 2);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("b1").filter_time(t).
-                filter_type(paradevs::common::DELTA_EXT).size() == 1);
-    }
-
-    for (unsigned int t = 0; t <= 10; ++t) {
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a2").filter_time(t).
-                filter_type(paradevs::common::LAMBDA).size() == 2);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a2").filter_time(t).
-                filter_type(paradevs::common::DELTA_INT).size() == 2);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a2").filter_time(t).
-                filter_type(paradevs::common::TA).size() == 3);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a2").filter_time(t).
-                filter_type(paradevs::common::DELTA_EXT).size() == 1);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("a2").filter_time(t).
-                filter_type(paradevs::common::DELTA_CONF).size() == 0);
-    }
-
-    for (unsigned int t = 0; t <= 10; ++t) {
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("b2").filter_time(t).
-                filter_type(paradevs::common::LAMBDA).size() == 2);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("b2").filter_time(t).
-                filter_type(paradevs::common::DELTA_INT).size() == 2);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("b2").filter_time(t).
-                filter_type(paradevs::common::TA).size() == 4);
-        REQUIRE(paradevs::common::Trace <
-                    DoubleTime >::trace().elements().
-                filter_model_name("b2").filter_time(t).
-                filter_type(paradevs::common::DELTA_EXT).size() == 2);
-    }
-}