PGROUTING
3.2
|
#include "pgr_turnRestrictedPath.hpp"
Classes | |
struct | found_goals |
class | Myvisitor |
Public Member Functions | |
Pgr_turnRestrictedPath ()=default | |
std::string | get_error () const |
get_error More... | |
std::string | get_log () const |
get_log More... | |
std::string | get_notice () const |
get_notice More... | |
bool | has_error () const |
get_error More... | |
std::deque< Path > | turnRestrictedPath (G &graph, const std::vector< pgrouting::trsp::Rule > &restrictions, int64_t source, int64_t target, size_t k, bool heap_paths, bool stop_on_first, bool strict) |
std::deque< Path > | Yen (G &graph, int64_t start_vertex, int64_t end_vertex, size_t K) |
std::deque< Path > | Yen (G &graph, int64_t start_vertex, int64_t end_vertex, size_t K, bool heap_paths) |
Public Attributes | |
std::ostringstream | error |
Stores the error information. More... | |
std::ostringstream | log |
Stores the hint information. More... | |
std::ostringstream | notice |
Stores the notice information. More... | |
Protected Member Functions | |
void | executeYen (G &graph) |
the actual algorithm More... | |
Auxiliary function for yen's algorithm | |
Path | getFirstSolution (G &graph) |
Performs the first Dijkstra of the algorithm. More... | |
void | doNextCycle (G &graph) |
Performs the next cycle of the algorithm. More... | |
void | removeVertices (G &graph, const Path &subpath) |
stores in subPath the first i elements of path More... | |
std::deque< Path > | get_results () |
Auxiliary function for yen's algorithm | |
Path | getFirstSolution (G &graph) |
Performs the first Dijkstra of the algorithm. More... | |
void | doNextCycle (G &graph) |
Performs the next cycle of the algorithm. More... | |
void | removeVertices (G &graph, const Path &subpath) |
stores in subPath the first i elements of path More... | |
std::deque< Path > | get_results () |
Protected Attributes | |
members | |
V | v_source |
source descriptor More... | |
V | v_target |
target descriptor More... | |
int64_t | m_start |
source id More... | |
int64_t | m_end |
target id More... | |
size_t | m_K |
Path | curr_result_path |
storage for the current result More... | |
pSet | m_ResultSet |
ordered set of shortest paths More... | |
pSet | m_Heap |
the heap More... | |
Visitor * | m_vis |
Private Types | |
typedef std::set< Path, compPathsLess > | pSet |
typedef G::V | V |
Private Member Functions | |
void | clear () |
containers cleanup More... | |
std::deque< Path > | get_results (std::deque< Path > &paths) |
std::deque< Path > | inf_cost_on_restriction (std::deque< Path > &paths) |
sets an inf value on agg_cost on the vertex/edge where the restriction begins More... | |
Private Attributes | |
bool | m_heap_paths |
std::vector< pgrouting::trsp::Rule > | m_restrictions |
pSet | m_solutions |
bool | m_stop_on_first |
bool | m_strict |
Definition at line 52 of file pgr_turnRestrictedPath.hpp.
|
private |
Definition at line 53 of file pgr_turnRestrictedPath.hpp.
|
privateinherited |
Definition at line 48 of file pgr_ksp.hpp.
|
default |
|
inlineprivate |
containers cleanup
empties containers
Definition at line 234 of file pgr_turnRestrictedPath.hpp.
References pgrouting::yen::Pgr_ksp< G >::clear(), and pgrouting::yen::Pgr_turnRestrictedPath< G >::m_solutions.
Referenced by pgrouting::yen::Pgr_turnRestrictedPath< G >::Yen().
|
inlineprotectedinherited |
Performs the next cycle of the algorithm.
Definition at line 163 of file pgr_ksp.hpp.
References Path::appendPath(), pgrouting::yen::Pgr_ksp< G >::curr_result_path, pgrouting::Pgr_dijkstra< G >::dijkstra(), Path::getSubpath(), pgrouting::yen::Pgr_ksp< G >::m_end, pgrouting::yen::Pgr_ksp< G >::m_Heap, pgrouting::yen::Pgr_ksp< G >::m_ResultSet, pgrouting::yen::Pgr_ksp< G >::m_vis, pgrouting::yen::Pgr_ksp< G >::Visitor::on_insert_to_heap(), pgrouting::yen::Pgr_ksp< G >::removeVertices(), and Path::size().
Referenced by pgrouting::yen::Pgr_ksp< G >::executeYen().
|
inlineprotectedinherited |
the actual algorithm
Definition at line 126 of file pgr_ksp.hpp.
References pgrouting::yen::Pgr_ksp< G >::clear(), pgrouting::yen::Pgr_ksp< G >::curr_result_path, pgrouting::yen::Pgr_ksp< G >::doNextCycle(), pgrouting::yen::Pgr_ksp< G >::getFirstSolution(), pgrouting::yen::Pgr_ksp< G >::m_Heap, pgrouting::yen::Pgr_ksp< G >::m_K, pgrouting::yen::Pgr_ksp< G >::m_ResultSet, pgrouting::yen::Pgr_ksp< G >::m_vis, pgrouting::yen::Pgr_ksp< G >::Visitor::on_insert_first_solution(), and Path::recalculate_agg_cost().
Referenced by pgrouting::yen::Pgr_ksp< G >::Yen(), and pgrouting::yen::Pgr_turnRestrictedPath< G >::Yen().
|
inherited |
get_error
Definition at line 53 of file pgr_messages.cpp.
References pgrouting::Pgr_messages::error.
Referenced by do_pgr_many_withPointsDD(), do_pgr_pickDeliver(), do_pgr_pickDeliverEuclidean(), do_pgr_withPoints(), do_pgr_withPointsKsp(), and pgrouting::vrp::Pgr_pickDeliver::Pgr_pickDeliver().
|
inherited |
get_log
Definition at line 36 of file pgr_messages.cpp.
References pgrouting::Pgr_messages::log.
Referenced by do_pgr_bipartite(), do_pgr_boyerMyrvold(), do_pgr_LTDTree(), do_pgr_makeConnected(), do_pgr_many_withPointsDD(), do_pgr_pickDeliver(), do_pgr_pickDeliverEuclidean(), do_pgr_withPoints(), do_pgr_withPointsKsp(), pgr_bellman_ford(), pgr_dijkstraTR(), and pgrouting::vrp::Pgr_pickDeliver::Pgr_pickDeliver().
|
inherited |
get_notice
Definition at line 42 of file pgr_messages.cpp.
References pgrouting::Pgr_messages::notice.
|
inlineprotectedinherited |
Definition at line 200 of file pgr_ksp.hpp.
References pgrouting::yen::Pgr_ksp< G >::m_Heap, pgrouting::yen::Pgr_ksp< G >::m_heap_paths, pgrouting::yen::Pgr_ksp< G >::m_ResultSet, and pgassert.
Referenced by pgrouting::yen::Pgr_ksp< G >::Yen(), and pgrouting::yen::Pgr_turnRestrictedPath< G >::Yen().
|
inlineprivate |
|
inlineprotectedinherited |
Performs the first Dijkstra of the algorithm.
Definition at line 148 of file pgr_ksp.hpp.
References pgrouting::Pgr_dijkstra< G >::dijkstra(), Path::empty(), pgrouting::yen::Pgr_ksp< G >::m_end, pgrouting::yen::Pgr_ksp< G >::m_ResultSet, pgrouting::yen::Pgr_ksp< G >::m_start, and Path::recalculate_agg_cost().
Referenced by pgrouting::yen::Pgr_ksp< G >::executeYen().
|
inherited |
get_error
Definition at line 48 of file pgr_messages.cpp.
References pgrouting::Pgr_messages::error.
Referenced by do_pgr_many_withPointsDD(), do_pgr_withPoints(), and do_pgr_withPointsKsp().
|
inlineprivate |
sets an inf value on agg_cost on the vertex/edge where the restriction begins
[in] | paths | that is being analized |
Definition at line 245 of file pgr_turnRestrictedPath.hpp.
References pgrouting::yen::Pgr_turnRestrictedPath< G >::m_restrictions.
Referenced by pgrouting::yen::Pgr_turnRestrictedPath< G >::get_results().
|
inlineprotectedinherited |
stores in subPath the first i elements of path
Definition at line 195 of file pgr_ksp.hpp.
Referenced by pgrouting::yen::Pgr_ksp< G >::doNextCycle().
|
inline |
Definition at line 106 of file pgr_turnRestrictedPath.hpp.
References pgrouting::yen::Pgr_ksp< G >::m_Heap, pgrouting::yen::Pgr_turnRestrictedPath< G >::m_heap_paths, pgrouting::yen::Pgr_turnRestrictedPath< G >::m_restrictions, pgrouting::yen::Pgr_ksp< G >::m_ResultSet, pgrouting::yen::Pgr_turnRestrictedPath< G >::m_stop_on_first, pgrouting::yen::Pgr_turnRestrictedPath< G >::m_strict, pgassert, and pgrouting::yen::Pgr_turnRestrictedPath< G >::Yen().
Referenced by pgr_dijkstraTR().
|
inline |
[in] | graph | |
[in] | start_vertex | original id of vertex |
[in] | end_vertex | original id of vertex |
[in] | K | when k=0 stop at first path without turn restriction when k > 0 do K cycles and return best path without turn restriction |
Definition at line 135 of file pgr_turnRestrictedPath.hpp.
References pgrouting::yen::Pgr_turnRestrictedPath< G >::clear(), pgrouting::yen::Pgr_ksp< G >::executeYen(), pgrouting::yen::Pgr_ksp< G >::get_results(), pgrouting::yen::Pgr_ksp< G >::m_end, pgrouting::yen::Pgr_ksp< G >::m_K, pgrouting::yen::Pgr_turnRestrictedPath< G >::m_restrictions, pgrouting::yen::Pgr_turnRestrictedPath< G >::m_solutions, pgrouting::yen::Pgr_ksp< G >::m_start, pgrouting::yen::Pgr_turnRestrictedPath< G >::m_stop_on_first, pgrouting::yen::Pgr_ksp< G >::m_vis, pgassert, pgrouting::yen::Pgr_ksp< G >::v_source, and pgrouting::yen::Pgr_ksp< G >::v_target.
Referenced by pgrouting::yen::Pgr_turnRestrictedPath< G >::turnRestrictedPath().
|
inlineinherited |
Definition at line 61 of file pgr_ksp.hpp.
References pgrouting::yen::Pgr_ksp< G >::clear(), pgrouting::yen::Pgr_ksp< G >::executeYen(), pgrouting::yen::Pgr_ksp< G >::get_results(), pgrouting::yen::Pgr_ksp< G >::m_end, pgrouting::yen::Pgr_ksp< G >::m_heap_paths, pgrouting::yen::Pgr_ksp< G >::m_K, pgrouting::yen::Pgr_ksp< G >::m_start, pgrouting::yen::Pgr_ksp< G >::v_source, and pgrouting::yen::Pgr_ksp< G >::v_target.
Referenced by do_pgr_ksp(), and do_pgr_withPointsKsp().
|
protectedinherited |
storage for the current result
Definition at line 229 of file pgr_ksp.hpp.
Referenced by pgrouting::yen::Pgr_ksp< G >::doNextCycle(), and pgrouting::yen::Pgr_ksp< G >::executeYen().
|
mutableinherited |
Stores the error information.
Definition at line 85 of file pgr_messages.h.
Referenced by pgrouting::vrp::Fleet::build_fleet(), pgrouting::Pg_points_graph::check_points(), pgrouting::Pgr_messages::clear(), pgrouting::Pg_points_graph::create_new_edges(), pgrouting::Pgr_messages::get_error(), pgrouting::Pgr_messages::has_error(), pgrouting::vrp::Fleet::is_fleet_ok(), and pgrouting::vrp::Pgr_pickDeliver::Pgr_pickDeliver().
|
mutableinherited |
Stores the hint information.
Definition at line 81 of file pgr_messages.h.
Referenced by pgrouting::vrp::Fleet::add_vehicle(), Pgr_bellman_ford< G >::bellman_ford(), Pgr_bellman_ford< G >::bellman_ford_1_to_1(), Pgr_bellman_ford< G >::bellman_ford_1_to_many(), pgrouting::alphashape::Pgr_alphaShape::build_best_alpha(), pgrouting::vrp::Fleet::build_fleet(), pgrouting::Pg_points_graph::check_points(), pgrouting::Pgr_messages::clear(), pgrouting::Pg_points_graph::create_new_edges(), pgrouting::vrp::Vehicle_pickDeliver::do_while_feasable(), pgrouting::vrp::Initial_solution::do_while_foo(), pgrouting::functions::Pgr_makeConnected< G >::generatemakeConnected(), pgrouting::Pgr_messages::get_log(), Pgr_bellman_ford< G >::get_paths(), pgrouting::vrp::Pgr_pickDeliver::get_postgres_result(), pgrouting::vrp::Vehicle::get_postgres_result(), pgrouting::vrp::Fleet::get_truck(), pgrouting::vrp::Optimize::inter_swap(), pgrouting::vrp::Fleet::is_fleet_ok(), pgrouting::vrp::Initial_solution::one_truck_all_orders(), pgrouting::vrp::Optimize::Optimize(), pgrouting::Pg_points_graph::Pg_points_graph(), pgrouting::vrp::Pgr_pickDeliver::Pgr_pickDeliver(), pgrouting::vrp::Optimize::save_if_best(), pgrouting::vrp::Solution::Solution(), pgrouting::vrp::Pgr_pickDeliver::solve(), and pgrouting::vrp::Vehicle::Vehicle().
|
protectedinherited |
target id
Definition at line 225 of file pgr_ksp.hpp.
Referenced by pgrouting::yen::Pgr_ksp< G >::doNextCycle(), pgrouting::yen::Pgr_ksp< G >::getFirstSolution(), pgrouting::yen::Pgr_ksp< G >::Yen(), and pgrouting::yen::Pgr_turnRestrictedPath< G >::Yen().
|
protectedinherited |
the heap
Definition at line 232 of file pgr_ksp.hpp.
Referenced by pgrouting::yen::Pgr_ksp< G >::clear(), pgrouting::yen::Pgr_ksp< G >::doNextCycle(), pgrouting::yen::Pgr_ksp< G >::executeYen(), pgrouting::yen::Pgr_ksp< G >::get_results(), and pgrouting::yen::Pgr_turnRestrictedPath< G >::turnRestrictedPath().
|
private |
Definition at line 261 of file pgr_turnRestrictedPath.hpp.
Referenced by pgrouting::yen::Pgr_turnRestrictedPath< G >::get_results(), and pgrouting::yen::Pgr_turnRestrictedPath< G >::turnRestrictedPath().
|
protectedinherited |
Definition at line 226 of file pgr_ksp.hpp.
Referenced by pgrouting::yen::Pgr_ksp< G >::executeYen(), pgrouting::yen::Pgr_ksp< G >::Yen(), and pgrouting::yen::Pgr_turnRestrictedPath< G >::Yen().
|
private |
|
protectedinherited |
ordered set of shortest paths
Definition at line 231 of file pgr_ksp.hpp.
Referenced by pgrouting::yen::Pgr_ksp< G >::clear(), pgrouting::yen::Pgr_ksp< G >::doNextCycle(), pgrouting::yen::Pgr_ksp< G >::executeYen(), pgrouting::yen::Pgr_ksp< G >::get_results(), pgrouting::yen::Pgr_ksp< G >::getFirstSolution(), and pgrouting::yen::Pgr_turnRestrictedPath< G >::turnRestrictedPath().
|
private |
Definition at line 259 of file pgr_turnRestrictedPath.hpp.
Referenced by pgrouting::yen::Pgr_turnRestrictedPath< G >::clear(), and pgrouting::yen::Pgr_turnRestrictedPath< G >::Yen().
|
protectedinherited |
source id
Definition at line 224 of file pgr_ksp.hpp.
Referenced by pgrouting::yen::Pgr_ksp< G >::getFirstSolution(), pgrouting::yen::Pgr_ksp< G >::Yen(), and pgrouting::yen::Pgr_turnRestrictedPath< G >::Yen().
|
private |
Definition at line 260 of file pgr_turnRestrictedPath.hpp.
Referenced by pgrouting::yen::Pgr_turnRestrictedPath< G >::turnRestrictedPath(), and pgrouting::yen::Pgr_turnRestrictedPath< G >::Yen().
|
private |
Definition at line 258 of file pgr_turnRestrictedPath.hpp.
Referenced by pgrouting::yen::Pgr_turnRestrictedPath< G >::get_results(), and pgrouting::yen::Pgr_turnRestrictedPath< G >::turnRestrictedPath().
|
protectedinherited |
Definition at line 234 of file pgr_ksp.hpp.
Referenced by pgrouting::yen::Pgr_ksp< G >::doNextCycle(), pgrouting::yen::Pgr_ksp< G >::executeYen(), pgrouting::yen::Pgr_ksp< G >::Pgr_ksp(), pgrouting::yen::Pgr_turnRestrictedPath< G >::Yen(), and pgrouting::yen::Pgr_ksp< G >::~Pgr_ksp().
|
mutableinherited |
Stores the notice information.
Definition at line 83 of file pgr_messages.h.
Referenced by pgrouting::Pgr_messages::clear(), and pgrouting::Pgr_messages::get_notice().
|
protectedinherited |
source descriptor
Definition at line 222 of file pgr_ksp.hpp.
Referenced by pgrouting::yen::Pgr_ksp< G >::Yen(), and pgrouting::yen::Pgr_turnRestrictedPath< G >::Yen().
|
protectedinherited |
target descriptor
Definition at line 223 of file pgr_ksp.hpp.
Referenced by pgrouting::yen::Pgr_ksp< G >::Yen(), and pgrouting::yen::Pgr_turnRestrictedPath< G >::Yen().