bitrl & cuberl Documentation
Simulation engine for reinforcement learning agents
Loading...
Searching...
No Matches
bitrl::utils::BoostSerialGraph< VertexData, EdgeData > Class Template Reference

. 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, EdgeDataedge_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_tadd_vertex (const VertexData &data)
 Add a vertex to the graph by providing the data.
 
edge_tadd_edge (uint_t v1, uint_t v2)
 Add an edge formed by the two given vertices.
 
const vertex_tget_vertex (uint_t i) const
 Access the i-th vertex of the graph.
 
vertex_tget_vertex (uint_t i)
 Access the i-th vertex of the graph.
 
vertex_tget_vertex (adjacency_iterator itr)
 Access the vertex given the vertex descriptor This is needed when accessing the vertices using the adjacency_iterator.
 
const vertex_tget_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_tget_edge (uint_t v1, uint_t v2) const
 Access the i-th edge of the graph with endpoints the given vertices.
 
edge_tget_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_iteratoredges () const
 edges Access the edges of the tree
 
std::pair< adjacency_iterator, adjacency_iteratorget_vertex_neighbors (uint_t id) const
 Returns the neighboring vertices for the given vertex id.
 
std::pair< adjacency_iterator, adjacency_iteratorget_vertex_neighbors (const vertex_t &v) const
 Returns the neighboring vertices for the given vertex id.
 
std::vector< uint_tget_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.
 

Detailed Description

template<typename VertexData, typename EdgeData>
class bitrl::utils::BoostSerialGraph< VertexData, EdgeData >

. 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.

Member Typedef Documentation

◆ adjacency_iterator

typedef graph_type::adjacency_iterator bitrl::utils::BoostSerialGraph< VertexData, EdgeData >::adjacency_iterator

adjacency_iterator Adjacency iterator

◆ edge_data_t

edge_data_t The type of the edge data

◆ edge_iterator

typedef graph_type::edge_iterator bitrl::utils::BoostSerialGraph< VertexData, EdgeData >::edge_iterator

edge_iterator Edge iterator

◆ edge_t

edge_t The edge type

◆ vertex_data_t

vertex_data_t The type of the vertex data

◆ vertex_t

Constructor & Destructor Documentation

◆ BoostSerialGraph()

bitrl::utils::BoostSerialGraph< VertexData, EdgeData >::BoostSerialGraph ( uint_t  nvs = 0)
explicit

Constructor.

Member Function Documentation

◆ add_edge()

Add an edge formed by the two given vertices.

◆ add_vertex()

Add a vertex to the graph by providing the data.

◆ clear()

Clear the graph.

◆ edges()

◆ get_edge() [1/2]

Access the i-th edge of the graph with endpoints the given vertices.

◆ get_edge() [2/2]

Access the i-th edge of the graph with endpoints the given vertices.

◆ get_vertex() [1/4]

Access the vertex given the vertex descriptor This is needed when accessing the vertices using the adjacency_iterator.

◆ get_vertex() [2/4]

Access the vertex given the vertex descriptor This is needed when accessing the vertices using the adjacency_iterator.

◆ get_vertex() [3/4]

Access the i-th vertex of the graph.

◆ get_vertex() [4/4]

Access the i-th vertex of the graph.

◆ get_vertex_neighbors() [1/2]

Returns the neighboring vertices for the given vertex id.

◆ get_vertex_neighbors() [2/2]

Returns the neighboring vertices for the given vertex id.

◆ get_vertex_neighbors_ids()

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

◆ max_edge_index()

uint_t bitrl::utils::BoostSerialGraph< VertexData, EdgeData >::max_edge_index ( ) const
inlinenoexcept

Returns the maximum edge index.

◆ max_vertex_index()

uint_t bitrl::utils::BoostSerialGraph< VertexData, EdgeData >::max_vertex_index ( ) const
inlinenoexcept

Returns the maximum vertex index.

◆ n_edges()

Returns the number of edges.

◆ n_vertices()

Returns the number of vertices.


The documentation for this class was generated from the following file: