PGROUTING
3.2
|
Extends the Node class to create a Node with time window attributes. More...
#include "tw_node.h"
Public Types | |
enum | NodeType { kStart = 0, kPickup, kDelivery, kDump, kLoad, kEnd } |
Public Member Functions | |
Tw_node ()=default | |
Tw_node (const Tw_node &)=default | |
Tw_node (size_t id, PickDeliveryOrders_t data, NodeType type) | |
Tw_node (size_t id, Vehicle_t data, NodeType type) | |
double | distance (const Dnode &other) const |
int64_t | id () const |
size_t | idx () const |
void | reset_id (int64_t) |
Static Protected Member Functions | |
static Pgr_messages & | msg () |
Static Protected Attributes | |
static Pgr_pickDeliver * | problem |
The problem. More... | |
Private Attributes | |
double | m_closes |
closing time of the node More... | |
double | m_demand |
The demand for the Node. More... | |
int64_t | m_id |
size_t | m_idx |
double | m_opens |
opening time of the node More... | |
int64_t | m_order |
order to which it belongs More... | |
double | m_service_time |
NodeType | m_type |
The demand for the Node. More... | |
friend | PD_problem |
Friends | |
std::ostream & | operator<< (std::ostream &log, const Tw_node &node) |
Print the contents of a Twnode object. More... | |
Extends the Node class to create a Node with time window attributes.
A Time Window node is a Node with addition attributes and methods to to support Time Windows and to model a more complex Node need in many vehicle routing problems.
Most application specific code will extend this class and define the specific values and requirements for type
and streetid
.
|
default |
|
default |
pgrouting::vrp::Tw_node::Tw_node | ( | size_t | id, |
PickDeliveryOrders_t | data, | ||
NodeType | type | ||
) |
Definition at line 151 of file tw_node.cpp.
References PickDeliveryOrders_t::deliver_close_t, PickDeliveryOrders_t::deliver_node_id, PickDeliveryOrders_t::deliver_open_t, PickDeliveryOrders_t::deliver_service_t, kDelivery, m_closes, m_demand, m_opens, m_service_time, m_type, and pgrouting::Identifier::reset_id().
Definition at line 171 of file tw_node.cpp.
References Vehicle_t::end_close_t, Vehicle_t::end_node_id, Vehicle_t::end_open_t, Vehicle_t::end_service_t, kEnd, m_closes, m_opens, m_service_time, m_type, and pgrouting::Identifier::reset_id().
double pgrouting::vrp::Tw_node::arrival_j_opens_i | ( | const Tw_node & | I, |
double | speed | ||
) | const |
@ {
The actual arrival time at This node, given that: this node is visited directly after other node and that the actual arrival time at other node was opens(other)
Definition at line 50 of file tw_node.cpp.
References kStart, m_type, opens(), service_time(), and travel_time_to().
Referenced by is_compatible_IJ().
|
inline |
Returns the closing time.
Definition at line 79 of file tw_node.h.
References m_closes.
Referenced by pgrouting::vrp::Fleet::add_vehicle(), is_delivery(), is_dump(), is_end(), pgrouting::vrp::Vehicle::is_ok(), is_pickup(), is_start(), and pgrouting::vrp::Vehicle::Vehicle().
|
inline |
Returns the demand associated with this node.
Definition at line 82 of file tw_node.h.
References m_demand.
Referenced by pgrouting::vrp::Vehicle_node::evaluate(), is_delivery(), is_dump(), is_end(), is_pickup(), and is_start().
|
inline |
|
inherited |
Definition at line 43 of file dnode.cpp.
References pgrouting::tsp::Dmatrix::distance(), pgrouting::vrp::Pgr_pickDeliver::get_cost_matrix(), pgrouting::tsp::Dmatrix::get_index(), pgrouting::Identifier::id(), and pgrouting::vrp::Dnode::problem.
Referenced by travel_time_to().
|
inherited |
Definition at line 42 of file identifier.cpp.
References pgrouting::Identifier::m_id.
Referenced by pgrouting::vrp::Dnode::distance(), pgrouting::vrp::Vehicle::get_postgres_result(), pgrouting::vrp::Vehicle::is_phony(), pgrouting::vrp::operator<<(), pgrouting::operator<<(), operator==(), pgrouting::vrp::Vehicle::tau(), and pgrouting::vrp::Vehicle::Vehicle().
|
inherited |
Definition at line 37 of file identifier.cpp.
References pgrouting::Identifier::m_idx.
Referenced by pgrouting::vrp::Vehicle::erase(), pgrouting::vrp::Vehicle_pickDeliver::erase(), pgrouting::vrp::Vehicle_pickDeliver::has_order(), pgrouting::vrp::Vehicle_pickDeliver::insert(), pgrouting::vrp::Vehicle::insert(), pgrouting::vrp::operator<<(), pgrouting::operator<<(), operator==(), pgrouting::vrp::Vehicle_pickDeliver::push_back(), pgrouting::vrp::Vehicle_pickDeliver::push_front(), pgrouting::vrp::Vehicle_pickDeliver::semiLIFO(), pgrouting::vrp::Order::set_compatibles(), pgrouting::vrp::Vehicle::tau(), and pgrouting::vrp::Vehicle::Vehicle().
bool pgrouting::vrp::Tw_node::is_compatible_IJ | ( | const Tw_node & | I, |
double | speed | ||
) | const |
Definition at line 60 of file tw_node.cpp.
References arrival_j_opens_i(), is_late_arrival(), kEnd, kStart, and m_type.
Referenced by pgrouting::vrp::Vehicle::getPosHighLimit(), pgrouting::vrp::Order::is_valid(), and pgrouting::vrp::Order::isCompatibleIJ().
bool pgrouting::vrp::Tw_node::is_delivery | ( | ) | const |
is_delivery
To be a delivery node:
Definition at line 106 of file tw_node.cpp.
References closes(), demand(), kDelivery, m_type, opens(), and service_time().
Referenced by pgrouting::vrp::Order::is_valid().
bool pgrouting::vrp::Tw_node::is_dump | ( | ) | const |
is_dump
To be a dump node:
Definition at line 115 of file tw_node.cpp.
References closes(), demand(), kDump, m_type, opens(), and service_time().
Referenced by pgrouting::vrp::Vehicle_node::evaluate().
|
inline |
True when arrivalTime is before it opens.
Definition at line 179 of file tw_node.h.
References m_opens.
Referenced by pgrouting::vrp::Vehicle_node::evaluate().
bool pgrouting::vrp::Tw_node::is_end | ( | ) | const |
is_end
To be a End node:
Definition at line 126 of file tw_node.cpp.
References closes(), demand(), kEnd, m_type, opens(), and service_time().
Referenced by pgrouting::vrp::Fleet::add_vehicle(), and pgrouting::vrp::Vehicle_node::has_cv().
|
inline |
True when arrivalTime is after it closes.
Definition at line 184 of file tw_node.h.
References m_closes.
Referenced by pgrouting::vrp::Vehicle_node::has_twv(), and is_compatible_IJ().
bool pgrouting::vrp::Tw_node::is_pickup | ( | ) | const |
is_pickup
To be a pickup node:
Definition at line 97 of file tw_node.cpp.
References closes(), demand(), kPickup, m_type, opens(), and service_time().
Referenced by pgrouting::vrp::Order::is_valid().
bool pgrouting::vrp::Tw_node::is_start | ( | ) | const |
@ {
is_start
To be a start node:
Definition at line 88 of file tw_node.cpp.
References closes(), demand(), kStart, m_type, opens(), and service_time().
Referenced by pgrouting::vrp::Fleet::add_vehicle(), pgrouting::vrp::Vehicle_node::evaluate(), and pgrouting::vrp::Vehicle_node::has_cv().
|
staticprotectedinherited |
|
inline |
Returns the opening time.
Definition at line 76 of file tw_node.h.
References m_opens.
Referenced by pgrouting::vrp::Fleet::add_vehicle(), arrival_j_opens_i(), pgrouting::vrp::Vehicle_node::evaluate(), is_delivery(), is_dump(), is_end(), pgrouting::vrp::Vehicle::is_ok(), is_pickup(), is_start(), and pgrouting::vrp::Vehicle::Vehicle().
bool pgrouting::vrp::Tw_node::operator== | ( | const Tw_node & | rhs | ) | const |
Definition at line 135 of file tw_node.cpp.
References pgrouting::Identifier::id(), pgrouting::Identifier::idx(), m_closes, m_demand, m_opens, m_order, m_service_time, and m_type.
|
inline |
|
inherited |
Definition at line 47 of file identifier.cpp.
References pgrouting::Identifier::m_id.
Referenced by Tw_node().
|
inline |
Returns the service time for this node.
Definition at line 86 of file tw_node.h.
References m_service_time.
Referenced by arrival_j_opens_i(), pgrouting::vrp::Vehicle_node::evaluate(), is_delivery(), is_dump(), is_end(), is_pickup(), is_start(), and pgrouting::vrp::operator<<().
double pgrouting::vrp::Tw_node::travel_time_to | ( | const Tw_node & | other, |
double | speed | ||
) | const |
time = distance / speed.
Definition at line 40 of file tw_node.cpp.
References pgrouting::vrp::Dnode::distance(), and pgassert.
Referenced by arrival_j_opens_i(), and pgrouting::vrp::operator<<().
|
inline |
Returns the type of this node.
Definition at line 89 of file tw_node.h.
References m_type.
Referenced by type_str().
std::string pgrouting::vrp::Tw_node::type_str | ( | ) | const |
Definition at line 75 of file tw_node.cpp.
References kDelivery, kDump, kEnd, kLoad, kPickup, kStart, and type().
Referenced by pgrouting::vrp::operator<<().
|
inline |
|
friend |
|
private |
closing time of the node
Definition at line 227 of file tw_node.h.
Referenced by closes(), is_late_arrival(), pgrouting::vrp::operator<<(), operator==(), Tw_node(), and window_length().
|
private |
The demand for the Node.
Definition at line 229 of file tw_node.h.
Referenced by demand(), pgrouting::vrp::operator<<(), operator==(), and Tw_node().
|
privateinherited |
Definition at line 53 of file identifier.h.
Referenced by pgrouting::Identifier::id(), and pgrouting::Identifier::reset_id().
|
privateinherited |
Definition at line 52 of file identifier.h.
Referenced by pgrouting::Identifier::idx().
|
private |
opening time of the node
Definition at line 226 of file tw_node.h.
Referenced by is_early_arrival(), opens(), pgrouting::vrp::operator<<(), operator==(), Tw_node(), and window_length().
|
private |
order to which it belongs
Definition at line 225 of file tw_node.h.
Referenced by operator==(), and order().
|
private |
Definition at line 228 of file tw_node.h.
Referenced by pgrouting::vrp::operator<<(), operator==(), service_time(), and Tw_node().
|
private |
The demand for the Node.
Definition at line 230 of file tw_node.h.
Referenced by arrival_j_opens_i(), is_compatible_IJ(), is_delivery(), is_dump(), is_end(), is_pickup(), is_start(), operator==(), Tw_node(), and type().
|
staticprotectedinherited |
The problem.
Definition at line 70 of file dnode.h.
Referenced by pgrouting::vrp::Dnode::distance(), and pgrouting::vrp::PD_problem::PD_problem().