PGROUTING  3.2
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:
Collaboration diagram for pgrouting::vrp::Vehicle_node:

Public Types

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

Public Member Functions

 Vehicle_node ()=delete
 Construct from parameters. More...
 
 Vehicle_node (const Tw_node &node)
 Creates a disconected vehicle node. More...
 
 Vehicle_node (const Vehicle_node &)=default
 
double distance (const Dnode &other) const
 
int64_t id () const
 
size_t idx () const
 
void reset_id (int64_t)
 
accessors
int64_t order () const
 @ { More...
 
double opens () const
 Returns the opening time. More...
 
double closes () const
 Returns the closing time. More...
 
double demand () const
 Returns the demand associated with this node. More...
 
void demand (double value)
 
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 Tw_node &other, double speed) 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_end () const
 is_end More...
 
std::string type_str () const
 
to be or not to be
bool operator== (const Tw_node &rhs) 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...
 
document functions
double arrival_j_opens_i (const Tw_node &I, double speed) const
 @ { More...
 
bool is_compatible_IJ (const Tw_node &I, double speed) const
 
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, double speed)
 
accessors
int64_t order () const
 @ { More...
 
double opens () const
 Returns the opening time. More...
 
double closes () const
 Returns the closing time. More...
 
double demand () const
 Returns the demand associated with this node. More...
 
void demand (double value)
 
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 Tw_node &other, double speed) 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_end () const
 is_end More...
 
std::string type_str () const
 
to be or not to be
bool operator== (const Tw_node &rhs) 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...
 
document functions
double arrival_j_opens_i (const Tw_node &I, double speed) const
 @ { More...
 
bool is_compatible_IJ (const Tw_node &I, double speed) const
 

Static Protected Member Functions

static Pgr_messagesmsg ()
 

Static Protected Attributes

static Pgr_pickDeliverproblem
 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
 
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 48 of file vehicle_node.h.

Member Enumeration Documentation

◆ NodeType

Enumerator
kStart 

starting site

kPickup 

pickup site

kDelivery 

delivery site

kDump 

dump site, empties truck

kLoad 

load site, fills the truck

kEnd 

ending site

Definition at line 59 of file tw_node.h.

59  {
60  kStart = 0,
61  kPickup,
62  kDelivery,
63  kDump,
64  kLoad,
65  kEnd
66  } NodeType;

Constructor & Destructor Documentation

◆ Vehicle_node() [1/3]

pgrouting::vrp::Vehicle_node::Vehicle_node ( )
delete

Construct from parameters.

◆ Vehicle_node() [2/3]

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

◆ Vehicle_node() [3/3]

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

Creates a disconected vehicle node.

A node that is not served by any vehicle

Parameters
[in]nodeTime window node

Definition at line 122 of file vehicle_node.cpp.

123  : Tw_node(node),
124  m_travel_time(0),
125  m_arrival_time(0),
126  m_wait_time(0),
127  m_departure_time(0),
128  m_delta_time(0),
129  m_cargo(0),
130  m_twvTot(0),
131  m_cvTot(0),
132  m_tot_wait_time(0),
134  m_tot_service_time(0) {
135  }

Member Function Documentation

◆ arrival_j_opens_i()

double pgrouting::vrp::Tw_node::arrival_j_opens_i ( const Tw_node I,
double  speed 
) 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 opens(other)

Definition at line 50 of file tw_node.cpp.

50  {
51  if (m_type == kStart) return (std::numeric_limits<double>::max)();
52  return I.opens() + I.service_time() + I.travel_time_to(*this, speed);
53 }

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

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

◆ arrival_time()

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

Truck's arrival_time to this node.

Definition at line 65 of file vehicle_node.h.

65 {return m_arrival_time;}

References m_arrival_time.

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

◆ cargo()

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

Truck's total cargo after the node was served.

Definition at line 93 of file vehicle_node.h.

93 {return m_cargo;}

References m_cargo.

Referenced by pgrouting::vrp::operator<<().

◆ closes()

◆ cvTot()

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

Truck's total times it has violated cargo limits.

Definition at line 90 of file vehicle_node.h.

90 {return m_cvTot;}

References m_cvTot.

Referenced by pgrouting::vrp::operator<<().

◆ delta_time()

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

delta_time = departure_time(this) - departure_time(previous)

Definition at line 74 of file vehicle_node.h.

74 {return m_delta_time;}

References m_delta_time.

◆ demand() [1/2]

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

◆ demand() [2/2]

void pgrouting::vrp::Tw_node::demand ( double  value)
inlineinherited

Definition at line 83 of file tw_node.h.

83 {m_demand = value;}

References pgrouting::vrp::Tw_node::m_demand.

◆ departure_time()

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

Truck's departure_time from this node.

Definition at line 71 of file vehicle_node.h.

71 {return m_departure_time;}

References m_departure_time.

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

◆ distance()

double pgrouting::vrp::Dnode::distance ( const Dnode other) const
inherited

◆ evaluate() [1/2]

void pgrouting::vrp::Vehicle_node::evaluate ( const Vehicle_node pred,
double  cargoLimit,
double  speed 
)
Parameters
[in]predThe node preceding this node in the path.
[in]cargoLimitof the vehicle.
[in]speedof the vehicle.

Definition at line 68 of file vehicle_node.cpp.

71  {
72  /* time */
73  m_travel_time = pred.travel_time_to(*this, speed);
74  m_arrival_time = pred.departure_time() + travel_time();
76  opens() - m_arrival_time :
77  0;
79 
80  /* time aggregates */
81  m_tot_travel_time = pred.total_travel_time() + travel_time();
82  m_tot_wait_time = pred.total_wait_time() + wait_time();
83  m_tot_service_time = pred.total_service_time() + service_time();
84 
85  /* cargo aggregates */
86  if (is_dump() && pred.cargo() >= 0) {
87  demand(-pred.cargo());
88  }
89  m_cargo = pred.cargo() + demand();
90 
91  /* violations aggregates */
92 
93  m_twvTot = has_twv() ? pred.twvTot() + 1 : pred.twvTot();
94  m_cvTot = has_cv(cargoLimit) ? pred.cvTot() + 1 : pred.cvTot();
95  m_delta_time = departure_time() - pred.departure_time();
96 }

References arrival_time(), pgrouting::vrp::Tw_node::demand(), departure_time(), has_cv(), has_twv(), pgrouting::vrp::Tw_node::is_dump(), pgrouting::vrp::Tw_node::is_early_arrival(), m_arrival_time, m_cargo, m_cvTot, m_delta_time, m_departure_time, m_tot_service_time, m_tot_travel_time, m_tot_wait_time, m_travel_time, m_twvTot, m_wait_time, pgrouting::vrp::Tw_node::opens(), pred(), pgrouting::vrp::Tw_node::service_time(), travel_time(), and wait_time().

◆ evaluate() [2/2]

void pgrouting::vrp::Vehicle_node::evaluate ( double  cargoLimit)

@ {

Todo:
TODO evaluate with matrix also
Parameters
[in]cargoLimitof the vehicle

Definition at line 38 of file vehicle_node.cpp.

38  {
39  if (is_start()) {
40  /* time */
41  m_travel_time = 0;
43  m_wait_time = 0;
45 
46  /* time aggregates */
48  m_tot_wait_time = 0;
50 
51  /* cargo aggregates */
52  m_cargo = demand();
53 
54  /* violation aggregates */
55  m_twvTot = m_cvTot = 0;
56  m_cvTot = has_cv(cargoLimit) ? 1 : 0;
57  m_delta_time = 0;
58  }
59 }

References arrival_time(), pgrouting::vrp::Tw_node::demand(), has_cv(), pgrouting::vrp::Tw_node::is_start(), m_arrival_time, m_cargo, m_cvTot, m_delta_time, m_departure_time, m_tot_service_time, m_tot_travel_time, m_tot_wait_time, m_travel_time, m_twvTot, m_wait_time, pgrouting::vrp::Tw_node::opens(), and pgrouting::vrp::Tw_node::service_time().

◆ feasible() [1/2]

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.

114 {return m_twvTot == 0 && m_cvTot == 0;}

References m_cvTot, and m_twvTot.

Referenced by feasible().

◆ feasible() [2/2]

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.

117  {
118  return feasible() && !has_twv() && !has_cv(cargoLimit);
119  }

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

◆ has_cv()

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.

130  {
131  return is_end() || is_start() ? m_cargo != 0
132  : m_cargo > cargoLimit || m_cargo < 0;
133  }

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

Referenced by evaluate(), and feasible().

◆ has_twv()

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.

122  {
124  }

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

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

◆ id()

◆ idx()

◆ is_compatible_IJ()

bool pgrouting::vrp::Tw_node::is_compatible_IJ ( const Tw_node I,
double  speed 
) const
inherited

Definition at line 60 of file tw_node.cpp.

60  {
61  /*
62  * I /-> kStart
63  */
64  if (m_type == kStart) return false;
65  /*
66  * kEnd /-> (*this)
67  */
68  if (I.m_type == kEnd) return false;
69 
70  return !is_late_arrival(arrival_j_opens_i(I, speed));
71 }

References pgrouting::vrp::Tw_node::arrival_j_opens_i(), pgrouting::vrp::Tw_node::is_late_arrival(), pgrouting::vrp::Tw_node::kEnd, pgrouting::vrp::Tw_node::kStart, and pgrouting::vrp::Tw_node::m_type.

Referenced by pgrouting::vrp::Vehicle::getPosHighLimit(), pgrouting::vrp::Order::is_valid(), and pgrouting::vrp::Order::isCompatibleIJ().

◆ is_delivery()

bool pgrouting::vrp::Tw_node::is_delivery ( ) const
inherited

is_delivery

To be a delivery node:

  • type is kDelivery
  • demand < 0

Definition at line 106 of file tw_node.cpp.

106  {
107  return m_type == kDelivery
108  && (opens() < closes())
109  && (service_time() >= 0)
110  && (demand() < 0);
111 }

References pgrouting::vrp::Tw_node::closes(), pgrouting::vrp::Tw_node::demand(), pgrouting::vrp::Tw_node::kDelivery, pgrouting::vrp::Tw_node::m_type, pgrouting::vrp::Tw_node::opens(), and pgrouting::vrp::Tw_node::service_time().

Referenced by pgrouting::vrp::Order::is_valid().

◆ is_dump()

bool pgrouting::vrp::Tw_node::is_dump ( ) const
inherited

is_dump

To be a dump node:

  • type is kDump
  • demand <= 0

Definition at line 115 of file tw_node.cpp.

115  {
116  return m_type == kDump
117  && (opens() < closes())
118  && (service_time() >= 0)
119  && (demand() <= 0);
120 }

References pgrouting::vrp::Tw_node::closes(), pgrouting::vrp::Tw_node::demand(), pgrouting::vrp::Tw_node::kDump, pgrouting::vrp::Tw_node::m_type, pgrouting::vrp::Tw_node::opens(), and pgrouting::vrp::Tw_node::service_time().

Referenced by evaluate().

◆ is_early_arrival()

bool pgrouting::vrp::Tw_node::is_early_arrival ( double  arrival_time) const
inlineinherited

True when arrivalTime is before it opens.

Definition at line 179 of file tw_node.h.

179  {
180  return arrival_time < m_opens;
181  }

References pgrouting::vrp::Tw_node::m_opens.

Referenced by evaluate().

◆ is_end()

bool pgrouting::vrp::Tw_node::is_end ( ) const
inherited

is_end

To be a End node:

  • type is kEnd
  • demand == 0

Definition at line 126 of file tw_node.cpp.

126  {
127  return m_type == kEnd
128  && (opens() < closes())
129  && (service_time() >= 0)
130  && (demand() == 0);
131 }

References pgrouting::vrp::Tw_node::closes(), pgrouting::vrp::Tw_node::demand(), pgrouting::vrp::Tw_node::kEnd, pgrouting::vrp::Tw_node::m_type, pgrouting::vrp::Tw_node::opens(), and pgrouting::vrp::Tw_node::service_time().

Referenced by pgrouting::vrp::Fleet::add_vehicle(), and has_cv().

◆ is_late_arrival()

bool pgrouting::vrp::Tw_node::is_late_arrival ( double  arrival_time) const
inlineinherited

True when arrivalTime is after it closes.

Definition at line 184 of file tw_node.h.

184  {
185  return arrival_time > m_closes;
186  }

References pgrouting::vrp::Tw_node::m_closes.

Referenced by has_twv(), and pgrouting::vrp::Tw_node::is_compatible_IJ().

◆ is_pickup()

bool pgrouting::vrp::Tw_node::is_pickup ( ) const
inherited

is_pickup

To be a pickup node:

  • type is kPickup
  • demand > 0

Definition at line 97 of file tw_node.cpp.

97  {
98  return m_type == kPickup
99  && (opens() < closes())
100  && (service_time() >= 0)
101  && (demand() > 0);
102 }

References pgrouting::vrp::Tw_node::closes(), pgrouting::vrp::Tw_node::demand(), pgrouting::vrp::Tw_node::kPickup, pgrouting::vrp::Tw_node::m_type, pgrouting::vrp::Tw_node::opens(), and pgrouting::vrp::Tw_node::service_time().

Referenced by pgrouting::vrp::Order::is_valid().

◆ is_start()

bool pgrouting::vrp::Tw_node::is_start ( ) const
inherited

@ {

is_start

To be a start node:

  • type is kStart
  • demand == 0

Definition at line 88 of file tw_node.cpp.

88  {
89  return
90  m_type == kStart
91  && (opens() < closes())
92  && (service_time() >= 0)
93  && (demand() == 0);
94 }

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

Referenced by pgrouting::vrp::Fleet::add_vehicle(), evaluate(), and has_cv().

◆ msg()

static Pgr_messages& pgrouting::vrp::Dnode::msg ( )
staticprotectedinherited

◆ opens()

◆ operator==()

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

Definition at line 135 of file tw_node.cpp.

135  {
136  if (&other == this) return true;
137  return m_order == other.m_order
138  && m_opens == other.m_opens
139  && m_closes == other.m_closes
140  && m_service_time == other.m_service_time
141  && m_demand == other.m_demand
142  && m_type == other.m_type
143  && id() == other.id()
144  && idx() == other.idx();
145 }

References pgrouting::Identifier::id(), pgrouting::Identifier::idx(), pgrouting::vrp::Tw_node::m_closes, pgrouting::vrp::Tw_node::m_demand, pgrouting::vrp::Tw_node::m_opens, pgrouting::vrp::Tw_node::m_order, pgrouting::vrp::Tw_node::m_service_time, and pgrouting::vrp::Tw_node::m_type.

◆ order()

int64_t pgrouting::vrp::Tw_node::order ( ) const
inlineinherited

@ {

Returns the opening time.

Definition at line 73 of file tw_node.h.

73 {return m_order;}

References pgrouting::vrp::Tw_node::m_order.

◆ reset_id()

void pgrouting::Identifier::reset_id ( int64_t  _id)
inherited

Definition at line 47 of file identifier.cpp.

47  {
48  m_id = _id;
49 }

References pgrouting::Identifier::m_id.

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

◆ service_time()

◆ total_service_time()

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

_time spent by the truck servicing the nodes

Definition at line 105 of file vehicle_node.h.

105 {return m_tot_service_time;}

References m_tot_service_time.

◆ total_time()

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

Truck's travel duration up to this node.

Definition at line 96 of file vehicle_node.h.

96 {return m_departure_time;}

References m_departure_time.

◆ total_travel_time()

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

_time spent moving between nodes by the truck

Definition at line 99 of file vehicle_node.h.

99 {return m_tot_travel_time;}

References m_tot_travel_time.

◆ total_wait_time()

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

_time spent by the truck waiting for nodes to open

Definition at line 102 of file vehicle_node.h.

102 {return m_tot_wait_time;}

References m_tot_wait_time.

◆ travel_time()

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

@ {

Truck's travel_time from previous node to this node.

Definition at line 62 of file vehicle_node.h.

62 {return m_travel_time;}

References m_travel_time.

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

◆ travel_time_to()

double pgrouting::vrp::Tw_node::travel_time_to ( const Tw_node other,
double  speed 
) const
inherited

time = distance / speed.

Definition at line 40 of file tw_node.cpp.

40  {
41  pgassert(speed != 0);
42  return distance(to) / speed;
43 }

References pgrouting::vrp::Dnode::distance(), and pgassert.

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

◆ twvTot()

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

@ {

Truck's total times it has violated time windows.

Definition at line 87 of file vehicle_node.h.

87 {return m_twvTot;}

References m_twvTot.

Referenced by pgrouting::vrp::operator<<().

◆ type()

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

Returns the type of this node.

Definition at line 89 of file tw_node.h.

89 {return m_type;}

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

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

◆ type_str()

std::string pgrouting::vrp::Tw_node::type_str ( ) const
inherited

Definition at line 75 of file tw_node.cpp.

75  {
76  switch (type()) {
77  case kStart: return "START"; break;
78  case kEnd: return "END"; break;
79  case kDump: return "DUMP"; break;
80  case kLoad: return "LOAD"; break;
81  case kPickup: return "PICKUP"; break;
82  case kDelivery: return "DELIVERY"; break;
83  default: return "UNKNOWN";
84  }
85 }

References pgrouting::vrp::Tw_node::kDelivery, pgrouting::vrp::Tw_node::kDump, pgrouting::vrp::Tw_node::kEnd, pgrouting::vrp::Tw_node::kLoad, pgrouting::vrp::Tw_node::kPickup, pgrouting::vrp::Tw_node::kStart, and pgrouting::vrp::Tw_node::type().

Referenced by pgrouting::vrp::operator<<().

◆ wait_time()

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

Truck's wait_time at this node.

Definition at line 68 of file vehicle_node.h.

68 {return m_wait_time;}

References m_wait_time.

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

◆ window_length()

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

Returns the length of time between the opening and closing.

Definition at line 92 of file tw_node.h.

92 {return m_closes - m_opens;}

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

Friends And Related Function Documentation

◆ operator<<

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

@ {

Definition at line 101 of file vehicle_node.cpp.

101  {
102  log << static_cast<const Tw_node&>(v)
103  << " twv = " << v.has_twv()
104  << ", twvTot = " << v.twvTot()
105  << ", cvTot = " << v.cvTot()
106  << ", cargo = " << v.cargo()
107  << ", travel_time = " << v.travel_time()
108  << ", arrival_time = " << v.arrival_time()
109  << ", wait_time = " << v.wait_time()
110  << ", service_time = " << v.service_time()
111  << ", departure_time = " << v.departure_time();
112  return log;
113 }

Member Data Documentation

◆ m_arrival_time

double pgrouting::vrp::Vehicle_node::m_arrival_time
private

Arrival time at this node.

Definition at line 156 of file vehicle_node.h.

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

◆ m_cargo

double pgrouting::vrp::Vehicle_node::m_cargo
private

@ {

Accumulated cargo

Definition at line 166 of file vehicle_node.h.

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

◆ m_closes

◆ m_cvTot

int pgrouting::vrp::Vehicle_node::m_cvTot
private

Total count of CV.

Definition at line 168 of file vehicle_node.h.

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

◆ m_delta_time

double pgrouting::vrp::Vehicle_node::m_delta_time
private

Departure time - last nodes departure time.

Definition at line 159 of file vehicle_node.h.

Referenced by delta_time(), and evaluate().

◆ m_demand

double pgrouting::vrp::Tw_node::m_demand
privateinherited

◆ m_departure_time

double pgrouting::vrp::Vehicle_node::m_departure_time
private

Definition at line 158 of file vehicle_node.h.

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

◆ m_id

int64_t pgrouting::Identifier::m_id
privateinherited

Definition at line 53 of file identifier.h.

Referenced by pgrouting::Identifier::id(), and pgrouting::Identifier::reset_id().

◆ m_idx

size_t pgrouting::Identifier::m_idx
privateinherited

Definition at line 52 of file identifier.h.

Referenced by pgrouting::Identifier::idx().

◆ m_opens

◆ m_order

int64_t pgrouting::vrp::Tw_node::m_order
privateinherited

order to which it belongs

Definition at line 225 of file tw_node.h.

Referenced by pgrouting::vrp::Tw_node::operator==(), and pgrouting::vrp::Tw_node::order().

◆ m_service_time

double pgrouting::vrp::Tw_node::m_service_time
privateinherited

◆ m_tot_service_time

double pgrouting::vrp::Vehicle_node::m_tot_service_time
private

Definition at line 171 of file vehicle_node.h.

Referenced by evaluate(), and total_service_time().

◆ m_tot_travel_time

double pgrouting::vrp::Vehicle_node::m_tot_travel_time
private

Accumulated travel time.

Definition at line 170 of file vehicle_node.h.

Referenced by evaluate(), and total_travel_time().

◆ m_tot_wait_time

double pgrouting::vrp::Vehicle_node::m_tot_wait_time
private

Accumulated wait time.

Definition at line 169 of file vehicle_node.h.

Referenced by evaluate(), and total_wait_time().

◆ m_travel_time

double pgrouting::vrp::Vehicle_node::m_travel_time
private

@ {

Travel time from last node

Definition at line 155 of file vehicle_node.h.

Referenced by evaluate(), and travel_time().

◆ m_twvTot

int pgrouting::vrp::Vehicle_node::m_twvTot
private

Total count of TWV.

Definition at line 167 of file vehicle_node.h.

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

◆ m_type

◆ m_wait_time

double pgrouting::vrp::Vehicle_node::m_wait_time
private

Wait time at this node when early arrival.

Definition at line 157 of file vehicle_node.h.

Referenced by evaluate(), and wait_time().

◆ PD_problem

friend pgrouting::vrp::Dnode::PD_problem
privateinherited

Definition at line 49 of file dnode.h.

◆ problem

Pgr_pickDeliver * pgrouting::vrp::Dnode::problem
staticprotectedinherited

The problem.

Definition at line 70 of file dnode.h.

Referenced by pgrouting::vrp::Dnode::distance(), and pgrouting::vrp::PD_problem::PD_problem().


The documentation for this class was generated from the following files:
pgrouting::vrp::Vehicle_node::m_tot_travel_time
double m_tot_travel_time
Accumulated travel time.
Definition: vehicle_node.h:170
pgrouting::vrp::Vehicle_node::m_departure_time
double m_departure_time
Definition: vehicle_node.h:158
pgrouting::tsp::Dmatrix::get_index
size_t get_index(int64_t id) const
original id -> idx
Definition: Dmatrix.cpp:93
pgrouting::vrp::Vehicle_node::m_twvTot
int m_twvTot
Total count of TWV.
Definition: vehicle_node.h:167
pgrouting::vrp::Dnode::distance
double distance(const Dnode &other) const
Definition: dnode.cpp:43
pgrouting::vrp::Vehicle_node::departure_time
double departure_time() const
Truck's departure_time from this node.
Definition: vehicle_node.h:71
pgrouting::vrp::Tw_node::kDump
@ kDump
dump site, empties truck
Definition: tw_node.h:63
pgrouting::vrp::Tw_node::m_type
NodeType m_type
The demand for the Node.
Definition: tw_node.h:230
pgrouting::vrp::Dnode::problem
static Pgr_pickDeliver * problem
The problem.
Definition: dnode.h:70
pgrouting::vrp::Tw_node::is_end
bool is_end() const
is_end
Definition: tw_node.cpp:126
pgrouting::vrp::Vehicle_node::m_travel_time
double m_travel_time
@ {
Definition: vehicle_node.h:155
pgrouting::vrp::Vehicle_node::m_cvTot
int m_cvTot
Total count of CV.
Definition: vehicle_node.h:168
pgrouting::vrp::Tw_node::kDelivery
@ kDelivery
delivery site
Definition: tw_node.h:62
pgrouting::vrp::Tw_node::kStart
@ kStart
starting site
Definition: tw_node.h:60
pgrouting::vrp::Tw_node::demand
double demand() const
Returns the demand associated with this node.
Definition: tw_node.h:82
pgrouting::vrp::Vehicle_node::m_cargo
double m_cargo
@ {
Definition: vehicle_node.h:166
pgrouting::vrp::Tw_node::m_opens
double m_opens
opening time of the node
Definition: tw_node.h:226
pgrouting::vrp::Vehicle_node::m_delta_time
double m_delta_time
Departure time - last nodes departure time.
Definition: vehicle_node.h:159
pgassert
#define pgassert(expr)
Uses the standard assert syntax.
Definition: pgr_assert.h:94
pgrouting::Identifier::idx
size_t idx() const
Definition: identifier.cpp:37
pgrouting::vrp::Tw_node::arrival_j_opens_i
double arrival_j_opens_i(const Tw_node &I, double speed) const
@ {
Definition: tw_node.cpp:50
pgrouting::vrp::Tw_node::is_early_arrival
bool is_early_arrival(double arrival_time) const
True when arrivalTime is before it opens.
Definition: tw_node.h:179
pgrouting::vrp::Pgr_pickDeliver::get_cost_matrix
pgrouting::tsp::Dmatrix get_cost_matrix() const
Definition: pgr_pickDeliver.h:92
pred
static size_t pred(size_t i, size_t n)
Definition: pgr_tsp.cpp:64
pgrouting::vrp::Tw_node::kEnd
@ kEnd
ending site
Definition: tw_node.h:65
pgrouting::vrp::Vehicle_node::travel_time
double travel_time() const
@ {
Definition: vehicle_node.h:62
pgrouting::Identifier::id
int64_t id() const
Definition: identifier.cpp:42
pgrouting::vrp::Tw_node::closes
double closes() const
Returns the closing time.
Definition: tw_node.h:79
pgrouting::vrp::Tw_node::m_service_time
double m_service_time
Definition: tw_node.h:228
pgrouting::vrp::Tw_node::is_start
bool is_start() const
@ {
Definition: tw_node.cpp:88
pgrouting::vrp::Tw_node::Tw_node
Tw_node()=default
pgrouting::vrp::Tw_node::kLoad
@ kLoad
load site, fills the truck
Definition: tw_node.h:64
pgrouting::vrp::Vehicle_node::has_cv
bool has_cv(double cargoLimit) const
True when not violation.
Definition: vehicle_node.h:130
pgrouting::vrp::Tw_node::kPickup
@ kPickup
pickup site
Definition: tw_node.h:61
pgrouting::vrp::Vehicle_node::m_wait_time
double m_wait_time
Wait time at this node when early arrival.
Definition: vehicle_node.h:157
pgrouting::vrp::Tw_node::m_order
int64_t m_order
order to which it belongs
Definition: tw_node.h:225
pgrouting::vrp::Tw_node::m_closes
double m_closes
closing time of the node
Definition: tw_node.h:227
pgrouting::Identifier::m_idx
size_t m_idx
Definition: identifier.h:52
pgrouting::Identifier::m_id
int64_t m_id
Definition: identifier.h:53
pgrouting::vrp::Vehicle_node::m_arrival_time
double m_arrival_time
Arrival time at this node.
Definition: vehicle_node.h:156
pgrouting::vrp::Tw_node::is_late_arrival
bool is_late_arrival(double arrival_time) const
True when arrivalTime is after it closes.
Definition: tw_node.h:184
pgrouting::vrp::Vehicle_node::m_tot_wait_time
double m_tot_wait_time
Accumulated wait time.
Definition: vehicle_node.h:169
pgrouting::vrp::Tw_node::opens
double opens() const
Returns the opening time.
Definition: tw_node.h:76
pgrouting::vrp::Tw_node::service_time
double service_time() const
Returns the service time for this node.
Definition: tw_node.h:86
pgrouting::tsp::Dmatrix::distance
double distance(int64_t i, int64_t j) const
Definition: Dmatrix.h:108
pgrouting::vrp::Vehicle_node::wait_time
double wait_time() const
Truck's wait_time at this node.
Definition: vehicle_node.h:68
pgrouting::vrp::Vehicle_node::arrival_time
double arrival_time() const
Truck's arrival_time to this node.
Definition: vehicle_node.h:65
pgrouting::vrp::Tw_node::is_dump
bool is_dump() const
is_dump
Definition: tw_node.cpp:115
pgrouting::vrp::Tw_node::type
NodeType type() const
Returns the type of this node.
Definition: tw_node.h:89
pgrouting::vrp::Tw_node::NodeType
NodeType
Definition: tw_node.h:59
pgrouting::vrp::Vehicle_node::feasible
bool feasible() const
@ {
Definition: vehicle_node.h:114
pgrouting::vrp::Vehicle_node::has_twv
bool has_twv() const
True when at this node does not violate time windows.
Definition: vehicle_node.h:122
pgrouting::vrp::Vehicle_node::m_tot_service_time
double m_tot_service_time
Definition: vehicle_node.h:171
pgrouting::vrp::Tw_node::m_demand
double m_demand
The demand for the Node.
Definition: tw_node.h:229