PGROUTING  3.2
pgrouting::vrp::Vehicle Class Reference

Vehicle with time windows. More...

#include "vehicle.h"

Inheritance diagram for pgrouting::vrp::Vehicle:
Collaboration diagram for pgrouting::vrp::Vehicle:

Public Types

typedef std::tuple< int, int, size_t, double, double > Cost
 

Public Member Functions

 Vehicle (const Vehicle &)=default
 
 Vehicle (size_t idx, int64_t id, const Vehicle_node &starting_site, const Vehicle_node &ending_site, double p_capacity, double p_speed, double p_factor)
 
std::pair< POS, POSdrop_position_limits (const Vehicle_node node) const
 
std::vector< General_vehicle_orders_tget_postgres_result (int vid) const
 
int64_t id () const
 
size_t idx () const
 
bool is_phony () const
 
std::pair< POS, POSposition_limits (const Vehicle_node node) const
 
void reset_id (int64_t)
 
double speed () const
 
void swap (POS i, POS j)
 Swap two nodes in the path. More...
 

Static Public Member Functions

static Pgr_messagesmsg ()
 Access to the problem's message. More...
 

Static Public Attributes

static Pgr_pickDeliverproblem
 Pointer to problem. More...
 

Protected Types

using difference_type = std::deque< Vehicle_node >::difference_type
 
typedef size_t POS
 

Protected Attributes

std::deque< Vehicle_nodem_path
 

Private Member Functions

POS getDropPosLowLimit (const Vehicle_node &node) const
 
POS getPosHighLimit (const Vehicle_node &node) const
 
POS getPosLowLimit (const Vehicle_node &node) const
 

Private Attributes

double m_capacity
 
double m_factor
 
int64_t m_id
 
size_t m_idx
 
double m_speed
 

Friends

class PD_problem
 

operators

std::ostream & operator<< (std::ostream &log, const Vehicle &v)
 @ { More...
 
bool operator< (const Vehicle &lhs, const Vehicle &rhs)
 
std::string tau () const
 

Detailed Description

Vehicle with time windows.

General functionality for a vehicle in a VRP problem

Recommended use:

Class my_vehicle : public vechicle
Note
All members return true when the operation is successful

A vehicle is a sequence of Vehicle_node from starting site to ending site. has: capacity speed factor TODO(vicky)

See also
Vehicle_node

Definition at line 73 of file vehicle.h.

Member Typedef Documentation

◆ Cost

typedef std::tuple< int, int, size_t, double, double > pgrouting::vrp::Vehicle::Cost

Definition at line 90 of file vehicle.h.

◆ difference_type

Definition at line 76 of file vehicle.h.

◆ POS

typedef size_t pgrouting::vrp::Vehicle::POS
protected

Definition at line 75 of file vehicle.h.

Constructor & Destructor Documentation

◆ Vehicle() [1/2]

pgrouting::vrp::Vehicle::Vehicle ( const Vehicle )
default

◆ Vehicle() [2/2]

pgrouting::vrp::Vehicle::Vehicle ( size_t  idx,
int64_t  id,
const Vehicle_node starting_site,
const Vehicle_node ending_site,
double  p_capacity,
double  p_speed,
double  p_factor 
)

Definition at line 419 of file vehicle.cpp.

426  :
427  Identifier(p_idx, p_id),
428  m_capacity(p_m_capacity),
429  m_factor(p_factor),
430  m_speed(p_speed) {
431 #if 0
432  ENTERING();
433 #endif
434  m_path.clear();
435  pgassert(starting_site.opens() <= starting_site.closes());
436  pgassert(ending_site.opens() <= ending_site.closes());
437  pgassert(capacity() > 0);
438 #if 0
439  msg().log << "p_idx: " << p_idx << "\t idx(): " << idx() << "\n";
440  msg().log << "p_id: " << p_id << "\tid(): " << id() << "\n";
441 #endif
442 
443  m_path.push_back(starting_site);
444  m_path.push_back(ending_site);
445 
446  evaluate(0);
447  msg().log << tau() << "\n";
448  invariant();
449 #if 0
450  EXITING();
451 #endif
452  }

References capacity(), pgrouting::vrp::Tw_node::closes(), ENTERING, evaluate(), EXITING, pgrouting::Identifier::id(), pgrouting::Identifier::idx(), invariant(), pgrouting::Pgr_messages::log, m_path, msg(), pgrouting::vrp::Tw_node::opens(), pgassert, and tau().

Member Function Documentation

◆ capacity()

double pgrouting::vrp::Vehicle::capacity ( ) const
inline

Definition at line 238 of file vehicle.h.

238 {return m_capacity;}

References m_capacity.

Referenced by Vehicle().

◆ cost()

Vehicle::Cost pgrouting::vrp::Vehicle::cost ( ) const

Definition at line 175 of file vehicle.cpp.

175  {
176  return std::make_tuple(
177  twvTot(), cvTot(), m_path.size(),
179 }

References cvTot(), duration(), m_path, total_wait_time(), and twvTot().

Referenced by insert().

◆ cost_compare()

bool pgrouting::vrp::Vehicle::cost_compare ( const Cost lhs,
const Cost rhs 
) const

Definition at line 97 of file vehicle.cpp.

97  {
98  /*
99  * capacity violations
100  */
101  if (std::get<1>(lhs) < std::get<1>(rhs))
102  return true;
103  if (std::get<1>(lhs) > std::get<1>(rhs))
104  return false;
105 
106  /*
107  * time window violations
108  */
109  if (std::get<0>(lhs) < std::get<0>(rhs))
110  return true;
111  if (std::get<0>(lhs) > std::get<0>(rhs))
112  return false;
113 
114  /*
115  * waiting time
116  */
117  if (std::get<3>(lhs) < std::get<3>(rhs))
118  return true;
119  if (std::get<3>(lhs) > std::get<3>(rhs))
120  return false;
121 
122  /*
123  * duration
124  */
125  if (std::get<4>(lhs) < std::get<4>(rhs))
126  return true;
127  if (std::get<4>(lhs) > std::get<4>(rhs))
128  return false;
129 
130  /*
131  * truck size
132  */
133  if (std::get<2>(lhs) < std::get<2>(rhs))
134  return true;
135  if (std::get<2>(lhs) > std::get<2>(rhs))
136  return false;
137 
138  return false;
139 }

Referenced by insert().

◆ cvTot()

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

Definition at line 216 of file vehicle.h.

216  {
217  return m_path.back().cvTot();
218  }

References m_path.

Referenced by cost(), has_cv(), and tau().

◆ drop_position_limits()

std::pair< size_t, size_t > pgrouting::vrp::Vehicle::drop_position_limits ( const Vehicle_node  node) const

Definition at line 306 of file vehicle.cpp.

306  {
307  POS high = getPosHighLimit(node);
308  POS low = getDropPosLowLimit(node);
309  return std::make_pair(low, high);
310 }

References getDropPosLowLimit(), and getPosHighLimit().

Referenced by pgrouting::vrp::Vehicle_pickDeliver::semiLIFO().

◆ duration()

double pgrouting::vrp::Vehicle::duration ( ) const
inline

Definition at line 201 of file vehicle.h.

201  {
202  return m_path.back().departure_time();
203  }

References m_path.

Referenced by cost(), pgrouting::vrp::Vehicle_pickDeliver::insert(), and tau().

◆ empty()

bool pgrouting::vrp::Vehicle::empty ( ) const

return true when no nodes are in the truck

True: S E
False: S <nodes> E

Definition at line 259 of file vehicle.cpp.

259  {
260  invariant();
261  return m_path.size() <= 2;
262 }

References invariant(), and m_path.

Referenced by pgrouting::vrp::Optimize::move_order().

◆ end_site()

Vehicle_node pgrouting::vrp::Vehicle::end_site ( ) const
inline

Definition at line 235 of file vehicle.h.

235  {
236  return m_path.back();
237  }

References m_path.

Referenced by is_ok().

◆ erase() [1/2]

void pgrouting::vrp::Vehicle::erase ( const Vehicle_node node)

Erase node.id()

Note
start and ending nodes cannot be erased

Numbers are positions before: S .... node.id() .... E after: S .... .... E

Todo:
TODO evaluate with matrix also

Definition at line 198 of file vehicle.cpp.

198  {
199  invariant();
200 
201  POS pos = 0;
202  for ( ; pos < m_path.size() ; ++pos) {
203  if (node.idx() == m_path[pos].idx())
204  break;
205  }
206 
207  erase(pos);
209  evaluate(pos);
210 
211  invariant();
212 }

References evaluate(), pgrouting::Identifier::idx(), invariant(), and m_path.

Referenced by pgrouting::vrp::Vehicle_pickDeliver::erase(), pgrouting::vrp::Vehicle_pickDeliver::insert(), and pgrouting::vrp::Vehicle_pickDeliver::semiLIFO().

◆ erase() [2/2]

void pgrouting::vrp::Vehicle::erase ( POS  pos)

Erase node at pos from the path.

Note
start and ending nodes cannot be erased

Numbers are positions before: S 1 2 3 4 5 6 pos 8 9 E after: S 1 2 3 4 5 6 8 9 E

Parameters
[in]posto be erased.

Definition at line 219 of file vehicle.cpp.

219  {
220  invariant();
221 
222  pgassert(m_path.size() > 2);
223  pgassert(at < m_path.size());
224  pgassert(!m_path[at].is_start());
225  pgassert(!m_path[at].is_end());
226 
227  m_path.erase(m_path.begin() + static_cast<difference_type>(at));
228  evaluate(at);
229 
230  invariant();
231 }

References evaluate(), invariant(), m_path, and pgassert.

◆ evaluate() [1/2]

void pgrouting::vrp::Vehicle::evaluate ( )

@ {

Evaluate: Evaluate the whole path from the start.

Definition at line 250 of file vehicle.cpp.

250  {
251  invariant();
252 
253  evaluate(0);
254 
255  invariant();
256 }

References invariant().

Referenced by erase(), insert(), pgrouting::vrp::Vehicle_pickDeliver::push_back(), pgrouting::vrp::Vehicle_pickDeliver::push_front(), swap(), and Vehicle().

◆ evaluate() [2/2]

void pgrouting::vrp::Vehicle::evaluate ( POS  from)

Evaluate: Evaluate a path from the given position.

Parameters
[in]fromThe starting position in the path for evaluation to the end of the path.

Definition at line 271 of file vehicle.cpp.

271  {
272  invariant();
273  // preconditions
274  pgassert(from < m_path.size());
275 
276 
277  auto node = m_path.begin() + static_cast<difference_type>(from);
278 
279  while (node != m_path.end()) {
280  if (node == m_path.begin()) {
281  node->evaluate(m_capacity);
282  } else {
283  node->evaluate(*(node - 1), m_capacity, speed());
284  }
285 
286  ++node;
287  }
288  invariant();
289 }

References invariant(), m_capacity, m_path, pgassert, and speed().

◆ get_postgres_result()

std::vector< General_vehicle_orders_t > pgrouting::vrp::Vehicle::get_postgres_result ( int  vid) const

Definition at line 144 of file vehicle.cpp.

145  {
146  std::vector<General_vehicle_orders_t> result;
147  /* postgres numbering starts with 1 */
148  int stop_seq(1);
149  msg().log << "getting solution: " << tau() << "\n";
150  for (const auto &p_stop : m_path) {
151  General_vehicle_orders_t data = {
152  vid,
153  id(),
154  stop_seq,
155  /* order_id
156  * The order_id is invalid for stops type 0 and 5
157  */
158  (p_stop.type() == 0 || p_stop.type() == 5)? -1 : p_stop.order(),
159  p_stop.id(),
160  p_stop.type(),
161  p_stop.cargo(),
162  p_stop.travel_time(),
163  p_stop.arrival_time(),
164  p_stop.wait_time(),
165  p_stop.service_time(),
166  p_stop.departure_time()};
167  result.push_back(data);
168  ++stop_seq;
169  }
170  return result;
171 }

References pgrouting::Identifier::id(), pgrouting::Pgr_messages::log, m_path, msg(), and tau().

◆ getDropPosLowLimit()

size_t pgrouting::vrp::Vehicle::getDropPosLowLimit ( const Vehicle_node node) const
private

Definition at line 327 of file vehicle.cpp.

327  {
328  invariant();
329 
330  POS low = 0;
331  POS high = m_path.size();
332  POS low_limit = high;
333 
334  /* J == m_path[low_limit - 1] */
335  while (low_limit > low
336  && m_path[low_limit - 1].is_compatible_IJ(nodeI, speed())
337  && !m_path[low_limit - 1].is_pickup()) {
338  --low_limit;
339  }
340 
341  invariant();
342  return low_limit;
343 }

References invariant(), m_path, and speed().

Referenced by drop_position_limits().

◆ getPosHighLimit()

size_t pgrouting::vrp::Vehicle::getPosHighLimit ( const Vehicle_node node) const
private

Definition at line 392 of file vehicle.cpp.

392  {
393  invariant();
394 
395  POS low = 0;
396  POS high = m_path.size();
397  POS high_limit = low;
398 
399  /* I == m_path[high_limit] */
400  while (high_limit < high
401  && nodeJ.is_compatible_IJ(m_path[high_limit], speed())) {
402  ++high_limit;
403  }
404 
405  invariant();
406  return high_limit;
407 }

References invariant(), pgrouting::vrp::Tw_node::is_compatible_IJ(), m_path, and speed().

Referenced by drop_position_limits(), and position_limits().

◆ getPosLowLimit()

size_t pgrouting::vrp::Vehicle::getPosLowLimit ( const Vehicle_node node) const
private

Definition at line 360 of file vehicle.cpp.

360  {
361  invariant();
362 
363  POS low = 0;
364  POS high = m_path.size();
365  POS low_limit = high;
366 
367  /* J == m_path[low_limit - 1] */
368  while (low_limit > low
369  && m_path[low_limit - 1].is_compatible_IJ(nodeI, speed())) {
370  --low_limit;
371  }
372 
373  invariant();
374  return low_limit;
375 }

References invariant(), m_path, and speed().

Referenced by position_limits().

◆ has_cv()

bool pgrouting::vrp::Vehicle::has_cv ( ) const
inline

Definition at line 222 of file vehicle.h.

222  {
223  return cvTot() != 0;
224  }

References cvTot().

Referenced by pgrouting::vrp::Vehicle_pickDeliver::insert(), is_feasable(), and pgrouting::vrp::Vehicle_pickDeliver::semiLIFO().

◆ has_twv()

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

Definition at line 219 of file vehicle.h.

219  {
220  return twvTot() != 0;
221  }

References twvTot().

Referenced by is_feasable(), and pgrouting::vrp::Vehicle_pickDeliver::semiLIFO().

◆ id()

int64_t pgrouting::Identifier::id ( ) const
inherited

◆ idx()

◆ insert() [1/2]

void pgrouting::vrp::Vehicle::insert ( POS  pos,
Vehicle_node  node 
)

@ {

Insert node at pos position.

Parameters
[in]posThe position that the node should be inserted.
[in]nodeThe node to insert.

Definition at line 183 of file vehicle.cpp.

183  {
184  invariant();
185  pgassert(at <= m_path.size());
186 
187  m_path.insert(m_path.begin() + static_cast<difference_type>(at), node);
188  evaluate(at);
189 
190  pgassert(at < m_path.size());
191  pgassert(m_path[at].idx() == node.idx());
192  invariant();
193 }

References evaluate(), pgrouting::Identifier::idx(), invariant(), m_path, and pgassert.

Referenced by pgrouting::vrp::Vehicle_pickDeliver::insert(), insert(), and pgrouting::vrp::Vehicle_pickDeliver::semiLIFO().

◆ insert() [2/2]

size_t pgrouting::vrp::Vehicle::insert ( std::pair< POS, POS position_limits,
const Vehicle_node node 
)

Insert node in best position of the position_limits.

Parameters
[in]position_limits
[in]nodeThe node to insert
Returns
position where it was inserted

Definition at line 63 of file vehicle.cpp.

63  {
64  invariant();
65  pgassert(position_limits.first <= m_path.size());
66  pgassert(position_limits.second <= m_path.size());
67 
68  auto low = position_limits.first;
69  auto high = position_limits.second;
70  auto best = low;
71 
72 
73  insert(low, node);
74 
75  Vehicle::Cost best_cost(cost());
76 
77 
78  while (low < high) {
79  swap(low, low + 1);
80  ++low;
81  if (cost_compare(best_cost, cost())) {
82  best_cost = cost();
83  best = low;
84  }
85  }
86  return best;
87 
88  pgassert(best < m_path.size());
89  pgassert(m_path[best].idx() == node.idx());
90  invariant();
91 }

References cost(), cost_compare(), pgrouting::Identifier::idx(), insert(), invariant(), m_path, pgassert, position_limits(), and swap().

◆ invariant()

void pgrouting::vrp::Vehicle::invariant ( ) const

◆ is_feasable()

bool pgrouting::vrp::Vehicle::is_feasable ( ) const
inline

◆ is_ok()

bool pgrouting::vrp::Vehicle::is_ok ( ) const

Definition at line 410 of file vehicle.cpp.

410  {
411  pgassert((m_path.front().opens() <= m_path.front().closes())
412  && (m_path.back().opens() <= m_path.back().closes())
413  && (m_capacity > 0));
414  return (start_site().opens() <= start_site().closes())
415  && (end_site().opens() <= end_site().closes())
416  && (m_capacity > 0);
417 }

References pgrouting::vrp::Tw_node::closes(), end_site(), m_capacity, m_path, pgrouting::vrp::Tw_node::opens(), pgassert, and start_site().

◆ is_phony()

bool pgrouting::vrp::Vehicle::is_phony ( ) const
inline

Definition at line 105 of file vehicle.h.

105 {return id() < 0;}

References pgrouting::Identifier::id().

Referenced by pgrouting::vrp::Optimize::move_order().

◆ msg()

Pgr_messages & pgrouting::vrp::Vehicle::msg ( )
static

Access to the problem's message.

Returns
reference to the problem's message

Definition at line 51 of file vehicle.cpp.

51  {
52  return problem->msg;
53 }

References pgrouting::vrp::Pgr_pickDeliver::msg, and problem.

Referenced by pgrouting::vrp::Vehicle_pickDeliver::do_while_feasable(), get_postgres_result(), and Vehicle().

◆ path()

std::deque< Vehicle_node > pgrouting::vrp::Vehicle::path ( ) const

@ {

Definition at line 292 of file vehicle.cpp.

292  {
293  invariant();
294  return m_path;
295 }

References invariant(), and m_path.

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

◆ position_limits()

std::pair< size_t, size_t > pgrouting::vrp::Vehicle::position_limits ( const Vehicle_node  node) const

Definition at line 299 of file vehicle.cpp.

299  {
300  POS high = getPosHighLimit(node);
301  POS low = getPosLowLimit(node);
302  return std::make_pair(low, high);
303 }

References getPosHighLimit(), and getPosLowLimit().

Referenced by pgrouting::vrp::Vehicle_pickDeliver::insert(), and insert().

◆ 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().

◆ size()

size_t pgrouting::vrp::Vehicle::size ( ) const

return number of nodes in the truck

True: S E
False: S <nodes> E

Definition at line 265 of file vehicle.cpp.

265  {
266  invariant();
267  return m_path.size() - 2;
268 }

References invariant(), and m_path.

Referenced by pgrouting::vrp::Optimize::move_order().

◆ speed()

double pgrouting::vrp::Vehicle::speed ( ) const

◆ start_site()

Vehicle_node pgrouting::vrp::Vehicle::start_site ( ) const
inline

Definition at line 232 of file vehicle.h.

232  {
233  return m_path.front();
234  }

References m_path.

Referenced by is_ok().

◆ swap()

void pgrouting::vrp::Vehicle::swap ( POS  i,
POS  j 
)

Swap two nodes in the path.

Before: S <nodesA> I <nodesB> J <nodesC> E
After: S <nodesA> J <nodesB> I <nodesC> E
Parameters
[in]iThe position of the first node to swap.
[in]jThe position of the second node to swap.

Definition at line 234 of file vehicle.cpp.

234  {
235  invariant();
236  pgassert(m_path.size() > 3);
237  pgassert(!m_path[i].is_start());
238  pgassert(!m_path[i].is_end());
239  pgassert(!m_path[j].is_start());
240  pgassert(!m_path[j].is_end());
241 
242  std::swap(m_path[i], m_path[j]);
243  i < j ? evaluate(i) : evaluate(j);
244 
245  invariant();
246 }

References evaluate(), invariant(), m_path, and pgassert.

Referenced by insert().

◆ tau()

std::string pgrouting::vrp::Vehicle::tau ( ) const

Definition at line 457 of file vehicle.cpp.

457  {
458  pgassert(m_path.size() > 1);
459  std::ostringstream log;
460  log << "Truck " << id() << "(" << idx() << ")"
461  << " (";
462  for (const auto &p_stop : m_path) {
463  if (!(p_stop == m_path.front()))
464  log << ", ";
465  log << p_stop.id();
466  }
467  log << ")" << " \t(cv, twv, wait_time, duration) = ("
468  << cvTot() << ", "
469  << twvTot() << ", "
470  << total_wait_time() << ", "
471  << duration() << ")";
472 
473  return log.str();
474 }

References cvTot(), duration(), pgrouting::Identifier::id(), pgrouting::Identifier::idx(), m_path, pgassert, total_wait_time(), and twvTot().

Referenced by get_postgres_result(), pgrouting::vrp::Vehicle_pickDeliver::insert(), pgrouting::vrp::operator<<(), and Vehicle().

◆ total_service_time()

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

Definition at line 210 of file vehicle.h.

210  {
211  return m_path.back().total_service_time();
212  }

References m_path.

◆ total_travel_time()

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

Definition at line 207 of file vehicle.h.

207  {
208  return m_path.back().total_travel_time();
209  }

References m_path.

◆ total_wait_time()

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

Definition at line 204 of file vehicle.h.

204  {
205  return m_path.back().total_wait_time();
206  }

References m_path.

Referenced by cost(), and tau().

◆ twvTot()

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

Definition at line 213 of file vehicle.h.

213  {
214  return m_path.back().twvTot();
215  }

References m_path.

Referenced by cost(), has_twv(), and tau().

Friends And Related Function Documentation

◆ operator<

bool operator< ( const Vehicle lhs,
const Vehicle rhs 
)
friend

Definition at line 502 of file vehicle.cpp.

502  {
503  lhs.invariant();
504  rhs.invariant();
505 
506  if (lhs.m_path.size() < rhs.m_path.size()) return true;
507 
508  /* here because sizes are equal */
509 
510  if (lhs.m_path.back().total_travel_time()
511  < rhs.m_path.back().total_travel_time()) return true;
512 
513  return false;
514 }

◆ operator<<

std::ostream& operator<< ( std::ostream &  log,
const Vehicle v 
)
friend

@ {

Definition at line 484 of file vehicle.cpp.

484  {
485  v.invariant();
486  int i(0);
487  log << "\n\n****************** " << v.idx() << "th VEHICLE*************\n";
488  log << "id = " << v.id()
489  << "\tcapacity = " << v.m_capacity
490  << "\tfactor = " << v.m_factor << "\n"
491  << "\tspeed = " << v.m_speed << "\n"
492  << "\tnew speed = " << v.speed() << "\n";
493 
494  for (const auto &path_stop : v.path()) {
495  log << "Path_stop" << ++i << "\n";
496  log << path_stop << "\n";
497  }
498  return log;
499 }

◆ PD_problem

friend class PD_problem
friend

Definition at line 79 of file vehicle.h.

Member Data Documentation

◆ m_capacity

double pgrouting::vrp::Vehicle::m_capacity
private

Definition at line 82 of file vehicle.h.

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

◆ m_factor

double pgrouting::vrp::Vehicle::m_factor
private

Definition at line 83 of file vehicle.h.

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

◆ 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_path

◆ m_speed

double pgrouting::vrp::Vehicle::m_speed
private

Definition at line 84 of file vehicle.h.

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

◆ problem

Pgr_pickDeliver * pgrouting::vrp::Vehicle::problem
static

Pointer to problem.

Definition at line 315 of file vehicle.h.

Referenced by msg(), and pgrouting::vrp::PD_problem::PD_problem().


The documentation for this class was generated from the following files:
pgrouting::vrp::Vehicle::m_path
std::deque< Vehicle_node > m_path
Definition: vehicle.h:77
pgrouting::vrp::Vehicle::getPosHighLimit
POS getPosHighLimit(const Vehicle_node &node) const
Definition: vehicle.cpp:392
pgrouting::vrp::Vehicle::speed
double speed() const
Definition: vehicle.cpp:477
EXITING
#define EXITING(x)
Definition: pgr_messages.h:94
pgrouting::vrp::Vehicle::cost
Cost cost() const
Definition: vehicle.cpp:175
pgrouting::vrp::Vehicle::m_capacity
double m_capacity
Definition: vehicle.h:82
pgrouting::vrp::Vehicle::cvTot
int cvTot() const
Definition: vehicle.h:216
pgrouting::vrp::Vehicle::duration
double duration() const
Definition: vehicle.h:201
ENTERING
#define ENTERING(x)
Definition: pgr_messages.h:93
pgrouting::Pgr_messages::log
std::ostringstream log
Stores the hint information.
Definition: pgr_messages.h:81
pgrouting::vrp::Pgr_pickDeliver::msg
Pgr_messages msg
message controller for all classes
Definition: pgr_pickDeliver.h:99
pgrouting::vrp::Vehicle::getDropPosLowLimit
POS getDropPosLowLimit(const Vehicle_node &node) const
Definition: vehicle.cpp:327
pgrouting::vrp::Vehicle::m_speed
double m_speed
Definition: vehicle.h:84
pgassert
#define pgassert(expr)
Uses the standard assert syntax.
Definition: pgr_assert.h:94
pgrouting::vrp::Vehicle::getPosLowLimit
POS getPosLowLimit(const Vehicle_node &node) const
Definition: vehicle.cpp:360
pgrouting::Identifier::idx
size_t idx() const
Definition: identifier.cpp:37
pgrouting::vrp::Vehicle::has_cv
bool has_cv() const
Definition: vehicle.h:222
pgrouting::vrp::Vehicle::m_factor
double m_factor
Definition: vehicle.h:83
pgrouting::vrp::Vehicle::twvTot
int twvTot() const
Definition: vehicle.h:213
pgrouting::vrp::Vehicle::evaluate
void evaluate()
@ {
Definition: vehicle.cpp:250
pgrouting::vrp::Vehicle::POS
size_t POS
Definition: vehicle.h:75
pgrouting::alphashape::E
boost::graph_traits< BG >::edge_descriptor E
Definition: pgr_alphaShape.h:57
pgrouting::Identifier::id
int64_t id() const
Definition: identifier.cpp:42
pgrouting::vrp::Vehicle::end_site
Vehicle_node end_site() const
Definition: vehicle.h:235
pgrouting::vrp::Tw_node::closes
double closes() const
Returns the closing time.
Definition: tw_node.h:79
pgrouting::vrp::Vehicle::capacity
double capacity() const
Definition: vehicle.h:238
pgrouting::vrp::Vehicle::difference_type
std::deque< Vehicle_node >::difference_type difference_type
Definition: vehicle.h:76
pgrouting::Identifier::m_idx
size_t m_idx
Definition: identifier.h:52
General_vehicle_orders_t
Definition: general_vehicle_orders_t.h:49
pgrouting::Identifier::m_id
int64_t m_id
Definition: identifier.h:53
pgrouting::vrp::Vehicle::invariant
void invariant() const
Invariant The path must:
Definition: vehicle.cpp:56
pgrouting::vrp::Tw_node::opens
double opens() const
Returns the opening time.
Definition: tw_node.h:76
pgrouting::vrp::Vehicle::position_limits
std::pair< POS, POS > position_limits(const Vehicle_node node) const
Definition: vehicle.cpp:299
pgrouting::vrp::Vehicle::total_wait_time
double total_wait_time() const
Definition: vehicle.h:204
pgrouting::vrp::Vehicle::problem
static Pgr_pickDeliver * problem
Pointer to problem.
Definition: vehicle.h:315
pgrouting::vrp::Vehicle::has_twv
bool has_twv() const
Definition: vehicle.h:219
pgrouting::Identifier::Identifier
Identifier()=default
pgrouting::vrp::Vehicle::start_site
Vehicle_node start_site() const
Definition: vehicle.h:232
pgrouting::vrp::Vehicle::cost_compare
bool cost_compare(const Cost &, const Cost &) const
Definition: vehicle.cpp:97
pgrouting::vrp::Vehicle::insert
void insert(POS pos, Vehicle_node node)
@ {
Definition: vehicle.cpp:183
pgrouting::vrp::Vehicle::Cost
std::tuple< int, int, size_t, double, double > Cost
Definition: vehicle.h:90
pgrouting::vrp::Vehicle::swap
void swap(POS i, POS j)
Swap two nodes in the path.
Definition: vehicle.cpp:234
pgrouting::vrp::Vehicle::msg
static Pgr_messages & msg()
Access to the problem's message.
Definition: vehicle.cpp:51
pgrouting::vrp::Vehicle::erase
void erase(const Vehicle_node &node)
Erase node.id()
Definition: vehicle.cpp:198
pgrouting::vrp::Vehicle::tau
std::string tau() const
Definition: vehicle.cpp:457