PGROUTING  3.2
pgrouting::vrp Namespace Reference

Classes

class  Dnode
 The Dnode class defines a the basic operations when data is a matrix. More...
 
class  Fleet
 
class  Initial_solution
 
class  Optimize
 
class  Order
 
class  PD_Orders
 
class  PD_problem
 
class  Pgr_pickDeliver
 
class  Solution
 
class  Swap_bk
 
class  Swap_info
 
class  Tw_node
 Extends the Node class to create a Node with time window attributes. More...
 
class  Vehicle
 Vehicle with time windows. More...
 
class  Vehicle_node
 Extend Tw_node to evaluate the vehicle at node level. More...
 
class  Vehicle_pickDeliver
 

Enumerations

enum  Initials_code {
  OneTruck, OnePerTruck, FrontTruck, BackTruck,
  BestInsert, BestBack, BestFront, OneDepot
}
 Different kinds to insert an order into the vehicle. More...
 

Functions

bool operator< (const Vehicle &lhs, const Vehicle &rhs)
 
std::ostream & operator<< (std::ostream &log, const Dnode &node)
 
std::ostream & operator<< (std::ostream &log, const Fleet &f)
 
std::ostream & operator<< (std::ostream &log, const Order &order)
 
std::ostream & operator<< (std::ostream &log, const Solution &solution)
 
std::ostream & operator<< (std::ostream &log, const Swap_bk &data)
 
std::ostream & operator<< (std::ostream &log, const Swap_info &d)
 
std::ostream & operator<< (std::ostream &log, const Tw_node &n)
 Print the contents of a Twnode object. More...
 
std::ostream & operator<< (std::ostream &log, const Vehicle &v)
 
std::ostream & operator<< (std::ostream &log, const Vehicle_node &v)
 

Enumeration Type Documentation

◆ Initials_code

Different kinds to insert an order into the vehicle.

Enumerator
OneTruck 
OnePerTruck 

All orders in one truck.

FrontTruck 

One Order per truck.

BackTruck 

Insetion at the front of the truck.

BestInsert 

Insetion at the back of the truck.

BestBack 

Best place to insert Order.

BestFront 

Push back order that allows more orders to be inserted at the back.

OneDepot 

Push front order that allows more orders to be inserted at the front.

Pick at front, drop at back, OneDepot for all vehicles

Definition at line 36 of file initials_code.h.

36  {
37  OneTruck,
38  OnePerTruck,
39  FrontTruck,
40  BackTruck,
41  BestInsert,
42  BestBack,
43  BestFront,
44  OneDepot
45 };

Function Documentation

◆ operator<()

bool pgrouting::vrp::operator< ( const Vehicle lhs,
const Vehicle rhs 
)

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 }

References pgrouting::vrp::Vehicle::invariant(), and pgrouting::vrp::Vehicle::m_path.

◆ operator<<() [1/9]

std::ostream& pgrouting::vrp::operator<< ( std::ostream &  log,
const Dnode node 
)

Definition at line 35 of file dnode.cpp.

35  {
36  log << node.id()
37  << "(" << node.idx() << ")";
38  return log;
39 }

References pgrouting::Identifier::id(), and pgrouting::Identifier::idx().

◆ operator<<() [2/9]

std::ostream& pgrouting::vrp::operator<< ( std::ostream &  log,
const Fleet f 
)

Definition at line 324 of file fleet.cpp.

324  {
325  log << "fleet\n";
326  for (const auto &v : f.m_trucks) {
327  log << v;
328  }
329  log << "end fleet\n";
330 
331  return log;
332 }

References pgrouting::vrp::Fleet::m_trucks.

◆ operator<<() [3/9]

std::ostream& pgrouting::vrp::operator<< ( std::ostream &  log,
const Order order 
)

Definition at line 55 of file order.cpp.

55  {
56  log << "\n\nOrder "
57  << static_cast<Identifier>(order) << ": \n"
58  << "\tPickup: " << order.pickup() << "\n"
59  << "\tDelivery: " << order.delivery() << "\n\n"
60  << "\tTravel time: "
61  << order.pickup().travel_time_to(order.delivery(), 1);
62  log << "\nThere are | {I}| = "
63  << order.m_compatibleI.size()
64  << " -> order(" << order.idx()
65  << ") -> | {J}| = " << order.m_compatibleJ.size()
66  << "\n\n {";
67  for (const auto o : order.m_compatibleI) {
68  log << o << ", ";
69  }
70  log << "} -> " << order.idx() << " -> {";
71  for (const auto o : order.m_compatibleJ) {
72  log << o << ", ";
73  }
74  log << "}";
75 
76  return log;
77 }

References pgrouting::vrp::Order::delivery(), pgrouting::Identifier::idx(), pgrouting::vrp::Order::m_compatibleI, pgrouting::vrp::Order::m_compatibleJ, pgrouting::vrp::Order::pickup(), Identifiers< T >::size(), and pgrouting::vrp::Tw_node::travel_time_to().

◆ operator<<() [4/9]

std::ostream& pgrouting::vrp::operator<< ( std::ostream &  log,
const Solution solution 
)

Definition at line 177 of file solution.cpp.

177  {
178  for (const auto &vehicle : solution.fleet) {
179  log << vehicle;
180  }
181 
182  log << "\n SOLUTION:\n\n "
183  << solution.tau();
184 
185  return log;
186 }

References pgrouting::vrp::Solution::fleet, and pgrouting::vrp::Solution::tau().

◆ operator<<() [5/9]

std::ostream& pgrouting::vrp::operator<< ( std::ostream &  log,
const Swap_bk data 
)

Definition at line 63 of file book_keeping.cpp.

63  {
64  auto q = data.m_swaps;
65  while (!q.empty()) {
66  log << q.top() << " ";
67  q.pop();
68  }
69  log << '\n';
70  return log;
71 }

References pgrouting::vrp::Swap_bk::m_swaps.

◆ operator<<() [6/9]

std::ostream& pgrouting::vrp::operator<< ( std::ostream &  log,
const Swap_info d 
)

Definition at line 47 of file book_keeping.cpp.

47  {
48  log << "\n" << d.from_truck.tau() << " --> "
49  << d.from_order
50  << "("
51  << d.from_truck.orders()[d.from_order].pickup().id()
52  << ")"
53  << "\n" << d.to_truck.tau() << " --> "
54  << d.to_order
55  << "("
56  << d.to_truck.orders()[d.to_order].pickup().id()
57  << ")"
58  << "\n" << "delta = " << d.estimated_delta;
59  return log;
60 }

References pgrouting::vrp::Swap_info::estimated_delta, pgrouting::vrp::Swap_info::from_order, pgrouting::vrp::Swap_info::from_truck, pgrouting::vrp::Vehicle_pickDeliver::orders(), pgrouting::vrp::Vehicle::tau(), pgrouting::vrp::Swap_info::to_order, and pgrouting::vrp::Swap_info::to_truck.

◆ operator<<() [7/9]

std::ostream& pgrouting::vrp::operator<< ( std::ostream &  log,
const Tw_node n 
)

Print the contents of a Twnode object.

Definition at line 191 of file tw_node.cpp.

191  {
192  log << n.id()
193  << "[opens = " << n.m_opens
194  << "\tcloses = " << n.m_closes
195  << "\tservice = " << n.m_service_time
196  << "\tdemand = " << n.m_demand
197  << "\ttype = " << n.type_str()
198  << "]"
199  << "\n";
200  return log;
201 }

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

◆ operator<<() [8/9]

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

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 }

References pgrouting::Identifier::id(), pgrouting::Identifier::idx(), pgrouting::vrp::Vehicle::invariant(), pgrouting::vrp::Vehicle::m_capacity, pgrouting::vrp::Vehicle::m_factor, pgrouting::vrp::Vehicle::m_speed, pgrouting::vrp::Vehicle::path(), and pgrouting::vrp::Vehicle::speed().

◆ operator<<() [9/9]

std::ostream& pgrouting::vrp::operator<< ( std::ostream &  log,
const Vehicle_node v 
)

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 }

References pgrouting::vrp::Vehicle_node::arrival_time(), pgrouting::vrp::Vehicle_node::cargo(), pgrouting::vrp::Vehicle_node::cvTot(), pgrouting::vrp::Vehicle_node::departure_time(), pgrouting::vrp::Vehicle_node::has_twv(), pgrouting::vrp::Tw_node::service_time(), pgrouting::vrp::Vehicle_node::travel_time(), pgrouting::vrp::Vehicle_node::twvTot(), and pgrouting::vrp::Vehicle_node::wait_time().

pgrouting::vrp::BestInsert
@ BestInsert
Insetion at the back of the truck.
Definition: initials_code.h:41
pgrouting::vrp::OnePerTruck
@ OnePerTruck
All orders in one truck.
Definition: initials_code.h:38
pgrouting::vrp::OneTruck
@ OneTruck
Definition: initials_code.h:37
pgrouting::vrp::BackTruck
@ BackTruck
Insetion at the front of the truck.
Definition: initials_code.h:40
pgrouting::vrp::OneDepot
@ OneDepot
Push front order that allows more orders to be inserted at the front.
Definition: initials_code.h:44
pgrouting::vrp::BestBack
@ BestBack
Best place to insert Order.
Definition: initials_code.h:42
pgrouting::vrp::FrontTruck
@ FrontTruck
One Order per truck.
Definition: initials_code.h:39
pgrouting::vrp::BestFront
@ BestFront
Push back order that allows more orders to be inserted at the back.
Definition: initials_code.h:43