DISPLACE  1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
GeoGraph Class Reference

#include <GeoGraph.h>

Classes

struct  location
 

Public Types

using cost = float
 
using Graph = boost::adjacency_list< boost::listS, boost::vecS, boost::undirectedS, boost::no_property, boost::property< boost::edge_weight_t, cost > >
 
using WeightMap = boost::property_map< Graph, boost::edge_weight_t >::type
 
using vertex = Graph::vertex_descriptor
 
using edge_descriptor = Graph::edge_descriptor
 
using edge = std::pair< int, int >
 

Public Member Functions

 GeoGraph ()=default
 
void addNode (int node, float x, float y)
 
bool addEdge (int node_from, int node_to, cost weight)
 
auto selectRandomNode ()
 
size_t numNodes () const
 
size_t numEdges () const
 

Public Attributes

Graph graph
 
WeightMap weightmap = get(boost::edge_weight, graph)
 
std::vector< locationlocations
 
std::mt19937 randomGenerator = std::mt19937(time(0))
 

Member Typedef Documentation

◆ cost

using GeoGraph::cost = float

◆ edge

using GeoGraph::edge = std::pair<int, int>

◆ edge_descriptor

using GeoGraph::edge_descriptor = Graph::edge_descriptor

◆ Graph

using GeoGraph::Graph = boost::adjacency_list<boost::listS, boost::vecS, boost::undirectedS, boost::no_property, boost::property<boost::edge_weight_t, cost> >

◆ vertex

using GeoGraph::vertex = Graph::vertex_descriptor

◆ WeightMap

using GeoGraph::WeightMap = boost::property_map<Graph, boost::edge_weight_t>::type

Constructor & Destructor Documentation

◆ GeoGraph()

GeoGraph::GeoGraph ( )
default

Member Function Documentation

◆ addEdge()

bool GeoGraph::addEdge ( int  node_from,
int  node_to,
GeoGraph::cost  weight 
)

◆ addNode()

void GeoGraph::addNode ( int  node,
float  x,
float  y 
)

◆ numEdges()

size_t GeoGraph::numEdges ( ) const
inline

◆ numNodes()

size_t GeoGraph::numNodes ( ) const
inline

◆ selectRandomNode()

auto GeoGraph::selectRandomNode ( )
inline

Member Data Documentation

◆ graph

Graph GeoGraph::graph

◆ locations

std::vector<location> GeoGraph::locations

◆ randomGenerator

std::mt19937 GeoGraph::randomGenerator = std::mt19937(time(0))

◆ weightmap

WeightMap GeoGraph::weightmap = get(boost::edge_weight, graph)

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