PGROUTING  2.6
pgrouting::vrp Namespace Reference

Classes

class  Base_node
 The Base_node class defines the operations that can be performed in a 2D node. More...
 
class  Dnode
 The Dnode class defines a the basic operations when data is a matrix. More...
 
class  Fleet
 
class  Initial_solution
 
class  Node
 The Node class defines a point in 2D space with an id. More...
 
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
 

Functions

bool operator< (const Vehicle &lhs, const Vehicle &rhs)
 
std::ostream & operator<< (std::ostream &log, const Base_node &node)
 
std::ostream & operator<< (std::ostream &log, const Node &node)
 
std::ostream & operator<< (std::ostream &log, const Dnode &node)
 
std::ostream & operator<< (std::ostream &log, const Swap_info &d)
 
std::ostream & operator<< (std::ostream &log, const Order &order)
 
std::ostream & operator<< (std::ostream &log, const Swap_bk &data)
 
std::ostream & operator<< (std::ostream &log, const Vehicle_node &v)
 
std::ostream & operator<< (std::ostream &log, const Solution &solution)
 
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 Fleet &f)
 
std::ostream & operator<< (std::ostream &log, const Vehicle &v)
 

Function Documentation

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

Definition at line 561 of file vehicle.cpp.

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

561  {
562  lhs.invariant();
563  rhs.invariant();
564 
565  if (lhs.m_path.size() < rhs.m_path.size()) return true;
566 
567  /* here because sizes are equal */
568 
569  if (lhs.m_path.back().total_travel_time()
570  < lhs.m_path.back().total_travel_time()) return true;
571 
572  return false;
573 }

Here is the call graph for this function:

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

Definition at line 32 of file base_node.cpp.

References pgrouting::vrp::Base_node::print().

32  {
33  node.print(log);
34  return log;
35 }

Here is the call graph for this function:

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

Definition at line 33 of file node.cpp.

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

33  {
34  node.print(log);
35  return log;
36 }

Here is the call graph for this function:

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

Definition at line 34 of file dnode.cpp.

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

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

Here is the call graph for this function:

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

Definition at line 47 of file book_keeping.cpp.

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.

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 }

Here is the call graph for this function:

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

Definition at line 55 of file order.cpp.

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

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 }

Here is the call graph for this function:

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

Definition at line 63 of file book_keeping.cpp.

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

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 }
std::ostream& pgrouting::vrp::operator<< ( std::ostream &  log,
const Vehicle_node v 
)

Definition at line 101 of file vehicle_node.cpp.

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

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 }

Here is the call graph for this function:

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

Definition at line 175 of file solution.cpp.

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

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

Here is the call graph for this function:

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

Print the contents of a Twnode object.

Definition at line 272 of file tw_node.cpp.

References pgrouting::Identifier::idx(), pgrouting::vrp::Pgr_pickDeliver::m_base_nodes, 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, pgrouting::vrp::PD_problem::problem, and pgrouting::vrp::Tw_node::type_str().

272  {
273  log << static_cast<const Node&>(
274  *n.problem->m_base_nodes[n.idx()].get())
275  << "[opens = " << n.m_opens
276  << "\tcloses = " << n.m_closes
277  << "\tservice = " << n.m_service_time
278  << "\tdemand = " << n.m_demand
279  << "\ttype = " << n.type_str()
280  << "]"
281  << "\n";
282  return log;
283 }

Here is the call graph for this function:

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

Definition at line 379 of file fleet.cpp.

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

379  {
380  log << "fleet\n";
381  for (const auto v : f.m_trucks) {
382  log << v;
383  }
384  log << "end fleet\n";
385 
386  return log;
387 }
std::ostream& pgrouting::vrp::operator<< ( std::ostream &  log,
const Vehicle v 
)

Definition at line 543 of file vehicle.cpp.

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

543  {
544  v.invariant();
545  int i(0);
546  log << "\n\n****************** " << v.idx() << "th VEHICLE*************\n";
547  log << "id = " << v.id()
548  << "\tcapacity = " << v.m_capacity
549  << "\tfactor = " << v.m_factor << "\n"
550  << "\tspeed = " << v.m_speed << "\n"
551  << "\tnew speed = " << v.speed() << "\n";
552 
553  for (const auto &path_stop : v.path()) {
554  log << "Path_stop" << ++i << "\n";
555  log << path_stop << "\n";
556  }
557  return log;
558 }

Here is the call graph for this function: