|
bitrl & cuberl Documentation
Simulation engine for reinforcement learning agents
|
. Representation of a graph using adjacency lists. The underlying implementation uses Boost Graph library. This wrapper is introduced to simplify the creation and handling of the graph. More...
#include <boost_serial_graph.h>
Classes | |
| struct | SerialGraphNode |
| Class that represents the Node of a graph. More... | |
Public Types | |
| typedef VertexData | vertex_data_t |
| vertex_data_t The type of the vertex data | |
| typedef EdgeData | edge_data_t |
| edge_data_t The type of the edge data | |
| typedef SerialGraphNode | vertex_t |
| vertex_t The vertex type | |
| typedef GenericLine< vertex_t, EdgeData > | edge_t |
| edge_t The edge type | |
| typedef graph_type::edge_iterator | edge_iterator |
| edge_iterator Edge iterator | |
| typedef graph_type::adjacency_iterator | adjacency_iterator |
| adjacency_iterator Adjacency iterator | |
Public Member Functions | |
| BoostSerialGraph (uint_t nvs=0) | |
| Constructor. | |
| vertex_t & | add_vertex (const VertexData &data) |
| Add a vertex to the graph by providing the data. | |
| edge_t & | add_edge (uint_t v1, uint_t v2) |
| Add an edge formed by the two given vertices. | |
| const vertex_t & | get_vertex (uint_t i) const |
| Access the i-th vertex of the graph. | |
| vertex_t & | get_vertex (uint_t i) |
| Access the i-th vertex of the graph. | |
| vertex_t & | get_vertex (adjacency_iterator itr) |
| Access the vertex given the vertex descriptor This is needed when accessing the vertices using the adjacency_iterator. | |
| const vertex_t & | get_vertex (adjacency_iterator itr) const |
| Access the vertex given the vertex descriptor This is needed when accessing the vertices using the adjacency_iterator. | |
| const edge_t & | get_edge (uint_t v1, uint_t v2) const |
| Access the i-th edge of the graph with endpoints the given vertices. | |
| edge_t & | get_edge (uint_t v1, uint_t v2) |
| Access the i-th edge of the graph with endpoints the given vertices. | |
| std::pair< edge_iterator, edge_iterator > | edges () const |
| edges Access the edges of the tree | |
| std::pair< adjacency_iterator, adjacency_iterator > | get_vertex_neighbors (uint_t id) const |
| Returns the neighboring vertices for the given vertex id. | |
| std::pair< adjacency_iterator, adjacency_iterator > | get_vertex_neighbors (const vertex_t &v) const |
| Returns the neighboring vertices for the given vertex id. | |
| std::vector< uint_t > | get_vertex_neighbors_ids (uint_t id) const |
| get_vertex_neighbors_ids Returns the ids of the vertices connectected with this vertex | |
| uint_t | n_vertices () const |
| Returns the number of vertices. | |
| uint_t | max_vertex_index () const noexcept |
| Returns the maximum vertex index. | |
| uint_t | n_edges () const |
| Returns the number of edges. | |
| uint_t | max_edge_index () const noexcept |
| Returns the maximum edge index. | |
| void | clear () |
| Clear the graph. | |
. Representation of a graph using adjacency lists. The underlying implementation uses Boost Graph library. This wrapper is introduced to simplify the creation and handling of the graph.
| typedef graph_type::adjacency_iterator bitrl::utils::BoostSerialGraph< VertexData, EdgeData >::adjacency_iterator |
adjacency_iterator Adjacency iterator
| typedef EdgeData bitrl::utils::BoostSerialGraph< VertexData, EdgeData >::edge_data_t |
edge_data_t The type of the edge data
| typedef graph_type::edge_iterator bitrl::utils::BoostSerialGraph< VertexData, EdgeData >::edge_iterator |
edge_iterator Edge iterator
| typedef GenericLine<vertex_t, EdgeData> bitrl::utils::BoostSerialGraph< VertexData, EdgeData >::edge_t |
edge_t The edge type
| typedef VertexData bitrl::utils::BoostSerialGraph< VertexData, EdgeData >::vertex_data_t |
vertex_data_t The type of the vertex data
| typedef SerialGraphNode bitrl::utils::BoostSerialGraph< VertexData, EdgeData >::vertex_t |
vertex_t The vertex type
|
explicit |
Constructor.
| BoostSerialGraph< VertexData, EdgeData >::edge_t & bitrl::utils::BoostSerialGraph< VertexData, EdgeData >::add_edge | ( | uint_t | v1, |
| uint_t | v2 | ||
| ) |
Add an edge formed by the two given vertices.
| BoostSerialGraph< VertexData, EdgeData >::vertex_t & bitrl::utils::BoostSerialGraph< VertexData, EdgeData >::add_vertex | ( | const VertexData & | data | ) |
Add a vertex to the graph by providing the data.
|
inline |
Clear the graph.
| std::pair< typename BoostSerialGraph< VertexData, EdgeData >::edge_iterator, typename BoostSerialGraph< VertexData, EdgeData >::edge_iterator > bitrl::utils::BoostSerialGraph< VertexData, EdgeData >::edges | ( | ) | const |
edges Access the edges of the tree
| BoostSerialGraph< VertexData, EdgeData >::edge_t & bitrl::utils::BoostSerialGraph< VertexData, EdgeData >::get_edge | ( | uint_t | v1, |
| uint_t | v2 | ||
| ) |
Access the i-th edge of the graph with endpoints the given vertices.
| const BoostSerialGraph< VertexData, EdgeData >::edge_t & bitrl::utils::BoostSerialGraph< VertexData, EdgeData >::get_edge | ( | uint_t | v1, |
| uint_t | v2 | ||
| ) | const |
Access the i-th edge of the graph with endpoints the given vertices.
| BoostSerialGraph< VertexData, EdgeData >::vertex_t & bitrl::utils::BoostSerialGraph< VertexData, EdgeData >::get_vertex | ( | adjacency_iterator | itr | ) |
Access the vertex given the vertex descriptor This is needed when accessing the vertices using the adjacency_iterator.
| const BoostSerialGraph< VertexData, EdgeData >::vertex_t & bitrl::utils::BoostSerialGraph< VertexData, EdgeData >::get_vertex | ( | adjacency_iterator | itr | ) | const |
Access the vertex given the vertex descriptor This is needed when accessing the vertices using the adjacency_iterator.
| BoostSerialGraph< VertexData, EdgeData >::vertex_t & bitrl::utils::BoostSerialGraph< VertexData, EdgeData >::get_vertex | ( | uint_t | i | ) |
Access the i-th vertex of the graph.
| const BoostSerialGraph< VertexData, EdgeData >::vertex_t & bitrl::utils::BoostSerialGraph< VertexData, EdgeData >::get_vertex | ( | uint_t | i | ) | const |
Access the i-th vertex of the graph.
| std::pair< adjacency_iterator, adjacency_iterator > bitrl::utils::BoostSerialGraph< VertexData, EdgeData >::get_vertex_neighbors | ( | const vertex_t & | v | ) | const |
Returns the neighboring vertices for the given vertex id.
| std::pair< typename BoostSerialGraph< VertexData, EdgeData >::adjacency_iterator, typename BoostSerialGraph< VertexData, EdgeData >::adjacency_iterator > bitrl::utils::BoostSerialGraph< VertexData, EdgeData >::get_vertex_neighbors | ( | uint_t | id | ) | const |
Returns the neighboring vertices for the given vertex id.
| std::vector< uint_t > bitrl::utils::BoostSerialGraph< VertexData, EdgeData >::get_vertex_neighbors_ids | ( | uint_t | id | ) | const |
get_vertex_neighbors_ids Returns the ids of the vertices connectected with this vertex
|
inlinenoexcept |
Returns the maximum edge index.
|
inlinenoexcept |
Returns the maximum vertex index.
|
inline |
Returns the number of edges.
|
inline |
Returns the number of vertices.