PGROUTING
3.2
|
#include "order.h"
Public Member Functions | |
int64_t | id () const |
size_t | idx () const |
void | reset_id (int64_t) |
Constructors | |
Order (size_t p_id, int64_t p_idx, const Vehicle_node &p_pickup, const Vehicle_node &p_deliver) | |
Order (const Order &)=default | |
Accessors | |
const Vehicle_node & | delivery () const |
The delivery node identifier. More... | |
const Vehicle_node & | pickup () const |
The delivery node identifier. More... | |
Identifiers< size_t > | subsetJ (const Identifiers< size_t > &J) const |
Get a subset of the orders that can be placed after this order. More... | |
Identifiers< size_t > | subsetI (const Identifiers< size_t > &I) const |
Modifiers | |
void | set_compatibles (const Order order, double speed) |
To be or not to be | |
bool | is_valid (double speed) const |
validate a pickup/delivery order More... | |
bool | isCompatibleIJ (const Order &I, double speed) const |
Can order I be placed before this order? More... | |
Private Attributes | |
Identifiers< size_t > | m_compatibleI |
Stores all the orders that can be placed before this order. More... | |
Identifiers< size_t > | m_compatibleJ |
Stores all the orders that can be placed after this order. More... | |
Vehicle_node | m_delivery |
The delivery node identifier. More... | |
int64_t | m_id |
size_t | m_idx |
Vehicle_node | m_pickup |
The pick up node identifier. More... | |
Friends | |
Friends | |
std::ostream & | operator<< (std::ostream &, const Order &) |
pgrouting::vrp::Order::Order | ( | size_t | p_id, |
int64_t | p_idx, | ||
const Vehicle_node & | p_pickup, | ||
const Vehicle_node & | p_deliver | ||
) |
|
default |
const Vehicle_node & pgrouting::vrp::Order::delivery | ( | ) | const |
The delivery node identifier.
It hold's the idx of the node
Definition at line 82 of file order.cpp.
References m_delivery.
Referenced by pgrouting::vrp::Vehicle_pickDeliver::erase(), pgrouting::vrp::Vehicle_pickDeliver::insert(), is_valid(), isCompatibleIJ(), pgrouting::vrp::operator<<(), pgrouting::vrp::Vehicle_pickDeliver::push_back(), pgrouting::vrp::Vehicle_pickDeliver::push_front(), and pgrouting::vrp::Vehicle_pickDeliver::semiLIFO().
|
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<<(), pgrouting::vrp::Tw_node::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<<(), pgrouting::vrp::Tw_node::operator==(), pgrouting::vrp::Vehicle_pickDeliver::push_back(), pgrouting::vrp::Vehicle_pickDeliver::push_front(), pgrouting::vrp::Vehicle_pickDeliver::semiLIFO(), set_compatibles(), pgrouting::vrp::Vehicle::tau(), and pgrouting::vrp::Vehicle::Vehicle().
bool pgrouting::vrp::Order::is_valid | ( | double | speed | ) | const |
validate a pickup/delivery order
An order is valid when:
Definition at line 94 of file order.cpp.
References delivery(), pgrouting::vrp::Tw_node::is_compatible_IJ(), pgrouting::vrp::Tw_node::is_delivery(), pgrouting::vrp::Tw_node::is_pickup(), and pickup().
Referenced by pgrouting::vrp::Fleet::is_order_ok().
bool pgrouting::vrp::Order::isCompatibleIJ | ( | const Order & | I, |
double | speed | ||
) | const |
Can order I be placed before this order?
[in] | I | order |
[in] | speed | to be used for evaluating the order |
Definition at line 135 of file order.cpp.
References delivery(), pgrouting::vrp::Tw_node::is_compatible_IJ(), and pickup().
Referenced by set_compatibles().
const Vehicle_node & pgrouting::vrp::Order::pickup | ( | ) | const |
The delivery node identifier.
It hold's the idx of the node
Definition at line 88 of file order.cpp.
References m_pickup.
Referenced by pgrouting::vrp::Vehicle_pickDeliver::erase(), pgrouting::vrp::Vehicle_pickDeliver::insert(), is_valid(), isCompatibleIJ(), pgrouting::vrp::operator<<(), pgrouting::vrp::Vehicle_pickDeliver::push_back(), pgrouting::vrp::Vehicle_pickDeliver::push_front(), and pgrouting::vrp::Vehicle_pickDeliver::semiLIFO().
|
inherited |
Definition at line 47 of file identifier.cpp.
References pgrouting::Identifier::m_id.
Referenced by pgrouting::vrp::Tw_node::Tw_node().
void pgrouting::vrp::Order::set_compatibles | ( | const Order | order, |
double | speed | ||
) |
Definition at line 111 of file order.cpp.
References pgrouting::Identifier::idx(), isCompatibleIJ(), m_compatibleI, and m_compatibleJ.
Identifiers< size_t > pgrouting::vrp::Order::subsetI | ( | const Identifiers< size_t > & | I | ) | const |
Definition at line 35 of file order.cpp.
References m_compatibleI.
Identifiers< size_t > pgrouting::vrp::Order::subsetJ | ( | const Identifiers< size_t > & | J | ) | const |
Get a subset of the orders that can be placed after this order.
[in] | J | set of orders |
Definition at line 40 of file order.cpp.
References m_compatibleJ.
|
friend |
|
private |
Stores all the orders that can be placed before this order.
Definition at line 182 of file order.h.
Referenced by pgrouting::vrp::operator<<(), set_compatibles(), and subsetI().
|
private |
Stores all the orders that can be placed after this order.
Definition at line 168 of file order.h.
Referenced by pgrouting::vrp::operator<<(), set_compatibles(), and subsetJ().
|
private |
The delivery node identifier.
It hold's the idx of the node
Definition at line 151 of file order.h.
Referenced by delivery().
|
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 |