graph_defs.hpp 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /**
  2. * @file tests/boost_graph/graph_defs.hpp
  3. * @author The PARADEVS Development Team
  4. * See the AUTHORS or Authors.txt file
  5. */
  6. /*
  7. * PARADEVS - the multimodeling and simulation environment
  8. * This file is a part of the PARADEVS environment
  9. *
  10. * Copyright (C) 2013 ULCO http://www.univ-litoral.fr
  11. *
  12. * This program is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License as published by
  14. * the Free Software Foundation, either version 3 of the License, or
  15. * (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU General Public License
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  24. */
  25. #ifndef __TESTS_BOOST_GRAPH_GRAPH_DEFS_HPP
  26. #define __TESTS_BOOST_GRAPH_GRAPH_DEFS_HPP 1
  27. #include <boost/graph/adjacency_list.hpp>
  28. namespace paradevs { namespace tests { namespace boost_graph {
  29. enum DynamicsType {
  30. TOP_PIXEL = 0, NORMAL_PIXEL
  31. };
  32. struct VertexProperties
  33. {
  34. int _index;
  35. double _weight;
  36. DynamicsType _type;
  37. VertexProperties() : _index(0), _weight(0), _type(NORMAL_PIXEL)
  38. { }
  39. VertexProperties(int index, double weight, DynamicsType type) :
  40. _index(index), _weight(weight), _type(type)
  41. { }
  42. };
  43. struct EdgeProperties
  44. {
  45. double _weight;
  46. EdgeProperties() : _weight(0)
  47. { }
  48. EdgeProperties(double weight) : _weight(weight)
  49. { }
  50. };
  51. typedef boost::adjacency_list < boost::vecS, boost::vecS, boost::directedS,
  52. VertexProperties, EdgeProperties> OrientedGraph;
  53. typedef std::vector < OrientedGraph > OrientedGraphs;
  54. typedef std::pair < int, int > Edge;
  55. typedef std::vector < Edge > Edges;
  56. typedef Edges OutputEdges;
  57. typedef Edges InputEdges;
  58. typedef std::vector < OutputEdges > OutputEdgeList;
  59. typedef std::vector < InputEdges > InputEdgeList;
  60. typedef std::pair < int, int > Port;
  61. typedef std::pair < Port, Port > Connection;
  62. typedef std::vector < Connection > Connections;
  63. } } } // namespace paradevs tests boost_graph
  64. #endif