pgRouting
pgRouting extends the PostGIS / PostgreSQL geospatial database to provide geospatial routing functionality.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Pgr_astar< G > Class Template Reference

#include "pgr_astar.hpp"

Classes

class  astar_many_goals_visitor
 class for stopping when all targets are found More...
 
class  astar_one_goal_visitor
 visitor that terminates when we find the goal More...
 
class  distance_heuristic
 
struct  found_goals
 exception for termination More...
 

Public Types

typedef G::B_G B_G
 
typedef G::V V
 

Public Member Functions

Astar
void astar (G &graph, Path &path, int64_t start_vertex, int64_t end_vertex, int heuristic, double factor, double epsilon, bool only_cost=false)
 one to one More...
 
void astar (G &graph, std::deque< Path > &paths, int64_t start_vertex, const std::vector< int64_t > &end_vertex, int heuristic, double factor, double epsilon, bool only_cost=false)
 one to Many More...
 
void astar (G &graph, std::deque< Path > &paths, std::vector< int64_t > start_vertex, const std::vector< int64_t > &end_vertex, int heuristic, double factor, double epsilon, bool only_cost=false)
 Many to Many. More...
 

Private Member Functions

bool astar_1_to_1 (G &graph, V source, V target, int heuristic, double factor, double epsilon)
 Call to Astar 1 source to 1 target. More...
 
bool astar_1_to_many (G &graph, V source, const std::vector< V > &targets, int heuristic, double factor, double epsilon)
 Call to astar 1 source to many targets. More...
 
void clear ()
 
void get_cost (const G &graph, V source, V target, Path &path) const
 
void get_cost (const G &graph, std::deque< Path > &paths, V source, std::vector< V > &targets) const
 
void get_path (const G &graph, V source, V target, Path &path) const
 
void get_path (const G &graph, std::deque< Path > &paths, V source, std::vector< V > &targets) const
 

Private Attributes

members;
std::vector< Vpredecessors
 
std::vector< double > distances
 
std::deque< VnodesInDistance
 

Detailed Description

template<class G>
class Pgr_astar< G >

Definition at line 58 of file pgr_astar.hpp.

Member Typedef Documentation

template<class G>
typedef G::B_G Pgr_astar< G >::B_G

Definition at line 61 of file pgr_astar.hpp.

template<class G>
typedef G::V Pgr_astar< G >::V

Definition at line 60 of file pgr_astar.hpp.

Member Function Documentation

template<class G >
void Pgr_astar< G >::astar ( G &  graph,
Path path,
int64_t  start_vertex,
int64_t  end_vertex,
int  heuristic,
double  factor,
double  epsilon,
bool  only_cost = false 
)

one to one

astar 1 to 1

Definition at line 263 of file pgr_astar.hpp.

References Path::clear(), and get_path().

Referenced by pgr_astar().

template<class G >
void Pgr_astar< G >::astar ( G &  graph,
std::deque< Path > &  paths,
int64_t  start_vertex,
const std::vector< int64_t > &  end_vertex,
int  heuristic,
double  factor,
double  epsilon,
bool  only_cost = false 
)

one to Many

astar 1 to many

Definition at line 304 of file pgr_astar.hpp.

References Path::end_id(), and get_path().

template<class G >
void Pgr_astar< G >::astar ( G &  graph,
std::deque< Path > &  paths,
std::vector< int64_t >  start_vertex,
const std::vector< int64_t > &  end_vertex,
int  heuristic,
double  factor,
double  epsilon,
bool  only_cost = false 
)

Many to Many.

Definition at line 352 of file pgr_astar.hpp.

References Path::end_id(), and Path::start_id().

template<class G >
bool Pgr_astar< G >::astar_1_to_1 ( G &  graph,
V  source,
V  target,
int  heuristic,
double  factor,
double  epsilon 
)
private

Call to Astar 1 source to 1 target.

Definition at line 387 of file pgr_astar.hpp.

References pgrouting::Basic_edge::cost.

template<class G >
bool Pgr_astar< G >::astar_1_to_many ( G &  graph,
V  source,
const std::vector< V > &  targets,
int  heuristic,
double  factor,
double  epsilon 
)
private

Call to astar 1 source to many targets.

Definition at line 416 of file pgr_astar.hpp.

References pgrouting::Basic_edge::cost.

template<class G>
void Pgr_astar< G >::clear ( )
inlineprivate

Definition at line 122 of file pgr_astar.hpp.

References Pgr_astar< G >::distances, and Pgr_astar< G >::predecessors.

template<class G >
void Pgr_astar< G >::get_cost ( const G &  graph,
V  source,
V  target,
Path path 
) const
private

Definition at line 450 of file pgr_astar.hpp.

References Path::clear(), path, and Path::push_front().

template<class G >
void Pgr_astar< G >::get_cost ( const G &  graph,
std::deque< Path > &  paths,
V  source,
std::vector< V > &  targets 
) const
private

Definition at line 472 of file pgr_astar.hpp.

References Path::clear(), and path.

template<class G >
void Pgr_astar< G >::get_path ( const G &  graph,
V  source,
V  target,
Path path 
) const
private

Definition at line 509 of file pgr_astar.hpp.

References Path::clear(), path, and Path::push_front().

template<class G >
void Pgr_astar< G >::get_path ( const G &  graph,
std::deque< Path > &  paths,
V  source,
std::vector< V > &  targets 
) const
private

Definition at line 493 of file pgr_astar.hpp.

References Path::clear(), get_path(), and path.

Member Data Documentation

template<class G>
std::vector< double > Pgr_astar< G >::distances
private

Definition at line 155 of file pgr_astar.hpp.

Referenced by Pgr_astar< G >::clear().

template<class G>
std::deque< V > Pgr_astar< G >::nodesInDistance
private

Definition at line 156 of file pgr_astar.hpp.

template<class G>
std::vector< V > Pgr_astar< G >::predecessors
private

Definition at line 154 of file pgr_astar.hpp.

Referenced by Pgr_astar< G >::clear().


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