PGROUTING  2.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pgrouting::vrp::Vehicle_node Class Reference

Extend Tw_node to evaluate the vehicle at node level. More...

#include "vehicle_node.h"

Inheritance diagram for pgrouting::vrp::Vehicle_node:
pgrouting::vrp::Tw_node pgrouting::vrp::Node

Public Types

enum  NodeType {
  kStart = 0, kPickup, kDelivery, kDump,
  kLoad, kEnd
}
 

Public Member Functions

 Vehicle_node (const Vehicle_node &node)=default
 Construct from parameters. More...
 
 Vehicle_node (const Tw_node &node)
 Creates a disconected vehicle node. More...
 
bool deltaGeneratesTWV (double delta_time) const
 True when arrival_time + delta_time generates TWV. More...
 
size_t Did () const
 
bool is_early_arrival (double arrival_time) const
 True when arrivalTime is before it opens. More...
 
bool is_late_arrival (double arrival_time) const
 True when arrivalTime is after it closes. More...
 
bool is_on_time (double arrival_time) const
 True when arrivalTime in the time window. More...
 
bool operator== (const Tw_node &rhs) const
 
size_t Pid () const
 
void set_Did (size_t id)
 
void set_Pid (size_t id)
 
Node evaluation accessors
double travel_time () const
 @ { More...
 
double arrival_time () const
 Truck's arrival_time to this node. More...
 
double wait_time () const
 Truck's wait_time at this node. More...
 
double departure_time () const
 Truck's departure_time from this node. More...
 
double delta_time () const
 delta_time = departure_time(this) - departure_time(previous) More...
 
Accumulated evaluation accessors
int twvTot () const
 @ { More...
 
int cvTot () const
 Truck's total times it has violated cargo limits. More...
 
double cargo () const
 Truck's total cargo after the node was served. More...
 
double total_time () const
 Truck's travel duration up to this node. More...
 
double total_travel_time () const
 _time spent moving between nodes by the truck More...
 
double total_wait_time () const
 _time spent by the truck waiting for nodes to open More...
 
double total_service_time () const
 _time spent by the truck servicing the nodes More...
 
State
bool feasible () const
 @ { More...
 
bool feasible (double cargoLimit) const
 True doesn't have twc nor cv (including total counts) More...
 
bool has_twv () const
 True when at this node does not violate time windows. More...
 
bool has_cv (double cargoLimit) const
 True when not violation. More...
 
mutators
void evaluate (double cargoLimit)
 @ { More...
 
void evaluate (const Vehicle_node &pred, double cargoLimit)
 
Document
double arrival_i_arrives_j (const Vehicle_node &other) const
 @ { More...
 
accessors
double opens () const
 @ { More...
 
double closes () const
 Returns the closing time. More...
 
double demand () const
 Returns the demand associated with this node. More...
 
double service_time () const
 Returns the service time for this node. More...
 
NodeType type () const
 Returns the type of this node. More...
 
double window_length () const
 Returns the length of time between the opening and closing. More...
 
double travel_time_to (const Node &other) const
 time = distance / speed. More...
 
kind of node

A true value when;

  • 0 < opens < closes
  • the type is the requested type
  • the demand are valid for the requested type
bool is_start () const
 @ { More...
 
bool is_pickup () const
 is_pickup More...
 
bool is_delivery () const
 is_delivery More...
 
bool is_dump () const
 is_dump More...
 
bool is_load () const
 is_Load More...
 
bool is_end () const
 is_end More...
 
std::string type_str () const
 
state
bool operator== (const Node &rhs) const
 
bool isSamePos (const Node &other) const
 @ { More...
 
double distance (const Node &other) const
 
double comparable_distance (const Node &other) const
 
document functions
double arrival_j_opens_i (const Tw_node &I) const
 @ { More...
 
double arrival_j_closes_i (const Tw_node &I) 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 closes(other) More...
 
bool is_compatible_IJ (const Tw_node &I) const
 
bool is_partially_compatible_IJ (const Tw_node &I) const
 
bool is_tight_compatible_IJ (const Tw_node &I) const
 
bool is_partially_waitTime_compatible_IJ (const Tw_node &I) const
 
bool is_waitTime_compatible_IJ (const Tw_node &I) const
 
accessors
size_t id () const
 @ { More...
 
int64_t original_id () const
 

Protected Member Functions

bool is_valid () const
 

Protected Attributes

double m_closes
 closing time of the node More...
 
double m_demand
 The demand for the Node. More...
 
double m_opens
 opening time of the node More...
 
size_t m_otherid
 the other's internal id More...
 
double m_service_time
 
NodeType m_type
 The demand for the Node. More...
 
const Pgr_pickDeliverproblem
 
Node evaluation members
double m_travel_time
 @ { More...
 
double m_arrival_time
 Arrival time at this node. More...
 
double m_wait_time
 Wait time at this node when early arrival. More...
 
double m_departure_time
 
double m_delta_time
 Departure time - last nodes departure time. More...
 
Accumulated evaluation members
double m_cargo
 @ { More...
 
int m_twvTot
 Total count of TWV. More...
 
int m_cvTot
 Total count of CV. More...
 
double m_tot_wait_time
 Accumulated wait time. More...
 
double m_tot_travel_time
 Accumulated travel time. More...
 
double m_tot_service_time
 

Friends

log
std::ostream & operator<< (std::ostream &log, const Vehicle_node &node)
 @ { More...
 

Detailed Description

Extend Tw_node to evaluate the vehicle at node level.

This class extends Twnode by adding attributes to store information about the node in a path and provides the tools evaluate the node and to set and get these attribute values.

Definition at line 46 of file vehicle_node.h.

Member Enumeration Documentation

Enumerator
kStart 
kPickup 
kDelivery 
kDump 
kLoad 
kEnd 

ending site

Definition at line 52 of file tw_node.h.

Constructor & Destructor Documentation

pgrouting::vrp::Vehicle_node::Vehicle_node ( const Vehicle_node node)
default

Construct from parameters.

pgrouting::vrp::Vehicle_node::Vehicle_node ( const Tw_node node)

Creates a disconected vehicle node.

A node that is not served by any vehicle

Parameters
[in]nodeTime window node

Definition at line 117 of file vehicle_node.cpp.

Member Function Documentation

double pgrouting::vrp::Vehicle_node::arrival_i_arrives_j ( const Vehicle_node other) 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 arrival(other)

returns the arrval time at this visited after other

Definition at line 146 of file vehicle_node.cpp.

References arrival_time(), pgrouting::vrp::Tw_node::service_time(), and pgrouting::vrp::Tw_node::travel_time_to().

double pgrouting::vrp::Tw_node::arrival_j_closes_i ( const Tw_node I) const
inherited

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 closes(other)

Definition at line 56 of file tw_node.cpp.

References pgrouting::vrp::Tw_node::closes(), pgrouting::vrp::Tw_node::kStart, pgrouting::vrp::Tw_node::m_type, pgrouting::vrp::Tw_node::service_time(), and pgrouting::vrp::Tw_node::travel_time_to().

Referenced by pgrouting::vrp::Tw_node::is_partially_compatible_IJ(), and pgrouting::vrp::Tw_node::is_tight_compatible_IJ().

double pgrouting::vrp::Tw_node::arrival_j_opens_i ( const Tw_node I) const
inherited
double pgrouting::vrp::Vehicle_node::arrival_time ( ) const
inline

Truck's arrival_time to this node.

Definition at line 63 of file vehicle_node.h.

References m_arrival_time.

Referenced by arrival_i_arrives_j(), evaluate(), and pgrouting::vrp::operator<<().

double pgrouting::vrp::Vehicle_node::cargo ( ) const
inline

Truck's total cargo after the node was served.

Definition at line 91 of file vehicle_node.h.

References m_cargo.

Referenced by evaluate(), and pgrouting::vrp::operator<<().

double pgrouting::vrp::Node::comparable_distance ( const Node other) const
inherited

Definition at line 56 of file node.cpp.

References pgrouting::vrp::Node::m_point.

Referenced by pgrouting::vrp::Node::isSamePos().

int pgrouting::vrp::Vehicle_node::cvTot ( ) const
inline

Truck's total times it has violated cargo limits.

Definition at line 88 of file vehicle_node.h.

References m_cvTot.

Referenced by evaluate(), and pgrouting::vrp::operator<<().

double pgrouting::vrp::Vehicle_node::delta_time ( ) const
inline

delta_time = departure_time(this) - departure_time(previous)

Definition at line 72 of file vehicle_node.h.

References m_delta_time.

bool pgrouting::vrp::Vehicle_node::deltaGeneratesTWV ( double  delta_time) const

True when arrival_time + delta_time generates TWV.

Definition at line 135 of file vehicle_node.cpp.

References pgrouting::vrp::Tw_node::is_late_arrival(), and m_arrival_time.

double pgrouting::vrp::Tw_node::demand ( ) const
inlineinherited
double pgrouting::vrp::Vehicle_node::departure_time ( ) const
inline

Truck's departure_time from this node.

Definition at line 69 of file vehicle_node.h.

References m_departure_time.

Referenced by evaluate(), and pgrouting::vrp::operator<<().

size_t pgrouting::vrp::Tw_node::Did ( ) const
inlineinherited
double pgrouting::vrp::Node::distance ( const Node other) const
inherited

Definition at line 49 of file node.cpp.

References pgrouting::vrp::Node::m_point.

Referenced by pgrouting::vrp::Tw_node::travel_time_to().

bool pgrouting::vrp::Vehicle_node::feasible ( ) const
inline

@ {

True when the total count for violations are 0

Definition at line 114 of file vehicle_node.h.

References m_cvTot, and m_twvTot.

Referenced by feasible().

bool pgrouting::vrp::Vehicle_node::feasible ( double  cargoLimit) const
inline

True doesn't have twc nor cv (including total counts)

Definition at line 117 of file vehicle_node.h.

References feasible(), has_cv(), and has_twv().

bool pgrouting::vrp::Vehicle_node::has_cv ( double  cargoLimit) const
inline

True when not violation.

Ending's or start's cargo should be 0

Definition at line 130 of file vehicle_node.h.

References pgrouting::vrp::Tw_node::is_end(), pgrouting::vrp::Tw_node::is_start(), and m_cargo.

Referenced by evaluate(), and feasible().

bool pgrouting::vrp::Vehicle_node::has_twv ( ) const
inline

True when at this node does not violate time windows.

Definition at line 122 of file vehicle_node.h.

References pgrouting::vrp::Tw_node::is_late_arrival(), and m_arrival_time.

Referenced by evaluate(), feasible(), and pgrouting::vrp::operator<<().

bool pgrouting::vrp::Tw_node::is_dump ( ) const
inherited
bool pgrouting::vrp::Tw_node::is_late_arrival ( double  arrival_time) const
inlineinherited
bool pgrouting::vrp::Tw_node::is_load ( ) const
inherited
bool pgrouting::vrp::Tw_node::is_on_time ( double  arrival_time) const
inlineinherited

True when arrivalTime in the time window.

Definition at line 205 of file tw_node.h.

References pgrouting::vrp::Tw_node::is_early_arrival(), and pgrouting::vrp::Tw_node::is_late_arrival().

bool pgrouting::vrp::Tw_node::is_partially_waitTime_compatible_IJ ( const Tw_node I) const
inherited
bool pgrouting::vrp::Tw_node::is_start ( ) const
inherited
bool pgrouting::vrp::Tw_node::is_waitTime_compatible_IJ ( const Tw_node I) const
inherited
bool pgrouting::vrp::Node::isSamePos ( const Node other) const
inherited

@ {

Definition at line 31 of file node.cpp.

References pgrouting::vrp::Node::comparable_distance().

bool pgrouting::vrp::Node::operator== ( const Node rhs) const
inherited
bool pgrouting::vrp::Tw_node::operator== ( const Tw_node rhs) const
inherited

Definition at line 182 of file tw_node.cpp.

int64_t pgrouting::vrp::Node::original_id ( ) const
inlineinherited

Definition at line 52 of file node.h.

References pgrouting::vrp::Node::m_original_id.

Referenced by pgrouting::vrp::Node::operator==().

size_t pgrouting::vrp::Tw_node::Pid ( ) const
inlineinherited
void pgrouting::vrp::Tw_node::set_Did ( size_t  id)
inlineinherited
void pgrouting::vrp::Tw_node::set_Pid ( size_t  id)
inlineinherited
double pgrouting::vrp::Vehicle_node::total_service_time ( ) const
inline

_time spent by the truck servicing the nodes

Definition at line 103 of file vehicle_node.h.

References m_tot_service_time.

Referenced by evaluate().

double pgrouting::vrp::Vehicle_node::total_time ( ) const
inline

Truck's travel duration up to this node.

Definition at line 94 of file vehicle_node.h.

References m_departure_time.

double pgrouting::vrp::Vehicle_node::total_travel_time ( ) const
inline

_time spent moving between nodes by the truck

Definition at line 97 of file vehicle_node.h.

References m_tot_travel_time.

Referenced by evaluate().

double pgrouting::vrp::Vehicle_node::total_wait_time ( ) const
inline

_time spent by the truck waiting for nodes to open

Definition at line 100 of file vehicle_node.h.

References m_tot_wait_time.

Referenced by evaluate().

double pgrouting::vrp::Vehicle_node::travel_time ( ) const
inline

@ {

Truck's travel_time from previous node to this node.

Definition at line 60 of file vehicle_node.h.

References m_travel_time.

Referenced by evaluate(), and pgrouting::vrp::operator<<().

double pgrouting::vrp::Tw_node::travel_time_to ( const Node other) const
inherited
int pgrouting::vrp::Vehicle_node::twvTot ( ) const
inline

@ {

Truck's total times it has violated time windows.

Definition at line 85 of file vehicle_node.h.

References m_twvTot.

Referenced by evaluate(), and pgrouting::vrp::operator<<().

NodeType pgrouting::vrp::Tw_node::type ( ) const
inlineinherited

Returns the type of this node.

Definition at line 100 of file tw_node.h.

References pgrouting::vrp::Tw_node::m_type.

Referenced by pgrouting::vrp::Tw_node::is_valid(), and pgrouting::vrp::Tw_node::type_str().

double pgrouting::vrp::Vehicle_node::wait_time ( ) const
inline

Truck's wait_time at this node.

Definition at line 66 of file vehicle_node.h.

References m_wait_time.

Referenced by evaluate(), and pgrouting::vrp::operator<<().

double pgrouting::vrp::Tw_node::window_length ( ) const
inlineinherited

Returns the length of time between the opening and closing.

Definition at line 103 of file tw_node.h.

References pgrouting::vrp::Tw_node::m_closes, and pgrouting::vrp::Tw_node::m_opens.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  log,
const Vehicle_node node 
)
friend

@ {

Definition at line 96 of file vehicle_node.cpp.

Member Data Documentation

double pgrouting::vrp::Vehicle_node::m_arrival_time
protected

Arrival time at this node.

Definition at line 162 of file vehicle_node.h.

Referenced by arrival_time(), deltaGeneratesTWV(), evaluate(), and has_twv().

double pgrouting::vrp::Vehicle_node::m_cargo
protected

@ {

Accumulated cargo

Definition at line 172 of file vehicle_node.h.

Referenced by cargo(), evaluate(), and has_cv().

double pgrouting::vrp::Tw_node::m_closes
protectedinherited
int pgrouting::vrp::Vehicle_node::m_cvTot
protected

Total count of CV.

Definition at line 174 of file vehicle_node.h.

Referenced by cvTot(), evaluate(), and feasible().

double pgrouting::vrp::Vehicle_node::m_delta_time
protected

Departure time - last nodes departure time.

Definition at line 165 of file vehicle_node.h.

Referenced by delta_time(), and evaluate().

double pgrouting::vrp::Tw_node::m_demand
protectedinherited

The demand for the Node.

Definition at line 292 of file tw_node.h.

Referenced by pgrouting::vrp::Tw_node::demand(), evaluate(), and pgrouting::vrp::operator<<().

double pgrouting::vrp::Vehicle_node::m_departure_time
protected

Definition at line 164 of file vehicle_node.h.

Referenced by departure_time(), evaluate(), and total_time().

double pgrouting::vrp::Tw_node::m_opens
protectedinherited
size_t pgrouting::vrp::Tw_node::m_otherid
protectedinherited
double pgrouting::vrp::Tw_node::m_service_time
protectedinherited

Definition at line 291 of file tw_node.h.

Referenced by pgrouting::vrp::operator<<(), and pgrouting::vrp::Tw_node::service_time().

double pgrouting::vrp::Vehicle_node::m_tot_service_time
protected

Definition at line 177 of file vehicle_node.h.

Referenced by evaluate(), and total_service_time().

double pgrouting::vrp::Vehicle_node::m_tot_travel_time
protected

Accumulated travel time.

Definition at line 176 of file vehicle_node.h.

Referenced by evaluate(), and total_travel_time().

double pgrouting::vrp::Vehicle_node::m_tot_wait_time
protected

Accumulated wait time.

Definition at line 175 of file vehicle_node.h.

Referenced by evaluate(), and total_wait_time().

double pgrouting::vrp::Vehicle_node::m_travel_time
protected

@ {

Travel time from last node

Definition at line 161 of file vehicle_node.h.

Referenced by evaluate(), and travel_time().

int pgrouting::vrp::Vehicle_node::m_twvTot
protected

Total count of TWV.

Definition at line 173 of file vehicle_node.h.

Referenced by evaluate(), feasible(), and twvTot().

double pgrouting::vrp::Vehicle_node::m_wait_time
protected

Wait time at this node when early arrival.

Definition at line 163 of file vehicle_node.h.

Referenced by evaluate(), and wait_time().

const Pgr_pickDeliver* pgrouting::vrp::Tw_node::problem
protectedinherited

Definition at line 295 of file tw_node.h.

Referenced by pgrouting::vrp::Tw_node::travel_time_to().


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