PGROUTING  2.6-dev
pgrouting::vrp::Fleet Class Reference

#include "fleet.h"

Inheritance diagram for pgrouting::vrp::Fleet:
Collaboration diagram for pgrouting::vrp::Fleet:

Public Types

typedef std::vector< Vehicle_pickDeliver >::iterator iterator
 

Public Member Functions

Vehicle_pickDeliver get_truck ()
 
Vehicle_pickDeliver get_truck (size_t order)
 
Vehicle_pickDeliver get_truck (const Order order)
 
bool is_fleet_ok () const
 
bool is_order_ok (const Order &order) const
 Given an order, Cycle trhugh all the trucks to verify if the order can be served by at least one truck. More...
 
Fleetoperator= (const Fleet &fleet)
 
void release_truck (size_t id)
 
void set_compatibles (const PD_Orders &orders)
 
constructor
 Fleet ()=default
 
 Fleet (const std::vector< Vehicle_t > &vehicles, double factor)
 
 Fleet (const Fleet &fleet)
 
vector like functions
size_t size () const
 
Vehicle_pickDeliveroperator[] (size_t i)
 
iterator begin ()
 
iterator end ()
 

Public Attributes

std::vector< Vehicle_pickDeliverm_trucks
 

Static Public Attributes

static Pgr_messages msg
 

Static Protected Attributes

static Pgr_pickDeliverproblem
 

Private Member Functions

void add_vehicle (Vehicle_t, double factor, std::unique_ptr< Base_node >, const Vehicle_node &, std::unique_ptr< Base_node >, const Vehicle_node &)
 
bool build_fleet (std::vector< Vehicle_t > vehicles, double factor)
 build the fleet More...
 
template<typename T >
std::unique_ptr< Base_nodecreate_b_end (const Vehicle_t &vehicle, size_t node_id)
 
template<typename T >
std::unique_ptr< Base_nodecreate_b_start (const Vehicle_t &vehicle, size_t node_id)
 

Private Attributes

Identifiers< size_t > un_used
 
Identifiers< size_t > used
 

Friends

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

Detailed Description

Definition at line 47 of file fleet.h.

Member Typedef Documentation

Definition at line 49 of file fleet.h.

Constructor & Destructor Documentation

pgrouting::vrp::Fleet::Fleet ( )
default
pgrouting::vrp::Fleet::Fleet ( const std::vector< Vehicle_t > &  vehicles,
double  factor 
)

Definition at line 47 of file fleet.cpp.

References build_fleet(), m_trucks, and un_used.

48  :
49  PD_problem(),
50  used(),
51  un_used() {
52  build_fleet(vehicles, factor);
53  Identifiers<size_t> unused(m_trucks.size());
54  un_used = unused;
55  }
std::vector< Vehicle_pickDeliver > m_trucks
Definition: fleet.h:50
bool build_fleet(std::vector< Vehicle_t > vehicles, double factor)
build the fleet
Definition: fleet.cpp:175
Identifiers< size_t > used
Definition: fleet.h:95
Identifiers< size_t > un_used
Definition: fleet.h:96

Here is the call graph for this function:

pgrouting::vrp::Fleet::Fleet ( const Fleet fleet)

Definition at line 40 of file fleet.cpp.

40  :
41  PD_problem(),
42  m_trucks(fleet.m_trucks),
43  used(fleet.used),
44  un_used(fleet.un_used)
45  {}
std::vector< Vehicle_pickDeliver > m_trucks
Definition: fleet.h:50
Identifiers< size_t > used
Definition: fleet.h:95
Identifiers< size_t > un_used
Definition: fleet.h:96

Member Function Documentation

void pgrouting::vrp::Fleet::add_vehicle ( Vehicle_t  vehicle,
double  factor,
std::unique_ptr< Base_node b_start,
const Vehicle_node starting_site,
std::unique_ptr< Base_node b_end,
const Vehicle_node ending_site 
)
private

Definition at line 133 of file fleet.cpp.

References pgrouting::vrp::Pgr_pickDeliver::add_base_node(), pgrouting::vrp::Pgr_pickDeliver::add_node(), Vehicle_t::cant_v, Vehicle_t::capacity, pgrouting::vrp::Tw_node::closes(), Vehicle_t::id, pgrouting::vrp::Tw_node::is_end(), pgrouting::vrp::Tw_node::is_start(), pgrouting::Pgr_messages::log, m_trucks, pgrouting::vrp::PD_problem::msg, pgrouting::vrp::Tw_node::opens(), pgassert, pgrouting::vrp::PD_problem::problem, and Vehicle_t::speed.

Referenced by build_fleet().

139  {
140  pgassert(starting_site.is_start() && ending_site.is_end());
141  pgassert(starting_site.opens() <= starting_site.closes());
142  pgassert(ending_site.opens() <= ending_site.closes());
143 
144  problem->add_base_node(std::move(b_start));
145  problem->add_base_node(std::move(b_end));
146  problem->add_node(starting_site);
147  problem->add_node(ending_site);
148 
149  for (int i = 0; i < vehicle.cant_v; ++i) {
150  m_trucks.push_back(Vehicle_pickDeliver(
151  m_trucks.size(),
152  vehicle.id,
153  starting_site,
154  ending_site,
155  vehicle.capacity,
156  vehicle.speed,
157  factor));
158  msg.log << "inserting vehicle: " << m_trucks.back().tau() << "\n";
159  pgassert((m_trucks.back().idx() + 1) == m_trucks.size());
160  pgassert(m_trucks.back().is_ok());
161  }
162 }
void add_base_node(std::unique_ptr< Base_node > node_ptr)
double capacity
Definition: vehicle_t.h:62
void add_node(const Vehicle_node &node)
std::vector< Vehicle_pickDeliver > m_trucks
Definition: fleet.h:50
static Pgr_pickDeliver * problem
Definition: pd_problem.h:51
std::ostringstream log
Stores the hint information.
Definition: pgr_messages.h:102
int64_t cant_v
Definition: vehicle_t.h:69
#define pgassert(expr)
Uses the standard assert syntax.
Definition: pgr_assert.h:81
double speed
Definition: vehicle_t.h:63
static Pgr_messages msg
Definition: pd_problem.h:48
int64_t id
Definition: vehicle_t.h:61

Here is the call graph for this function:

Here is the caller graph for this function:

iterator pgrouting::vrp::Fleet::begin ( )
inline

Definition at line 87 of file fleet.h.

87 {return m_trucks.begin();}
std::vector< Vehicle_pickDeliver > m_trucks
Definition: fleet.h:50
bool pgrouting::vrp::Fleet::build_fleet ( std::vector< Vehicle_t vehicles,
double  factor 
)
private

build the fleet

builds a fleet from a vector of Vehicle_t

Parameters
[in]vehiclesof type Vehicle_t
  • creates a phoney truck with unlimited capacity and unlimited closing times
  • checks that the number of vehicles is a legal value
  • creates the requested vehicles
Parameters
[in]vehiclesthe list of vehicles
[in]factorthe multiplier to speed up or slow down

Definition at line 175 of file fleet.cpp.

References add_vehicle(), pgrouting::Pgr_messages::clear(), pgrouting::tsp::Dmatrix::empty(), pgrouting::Pgr_messages::error, pgrouting::Pgr_messages::get_error(), pgrouting::Pgr_messages::log, pgrouting::vrp::Pgr_pickDeliver::m_cost_matrix, m_trucks, pgrouting::vrp::PD_problem::msg, pgrouting::vrp::Pgr_pickDeliver::node_id(), pgassert, pgassertwm, pgrouting::vrp::PD_problem::problem, and un_used.

Referenced by Fleet().

177  {
178  /*
179  * creating a phoney truck with max capacity and max window
180  * with the start & end points of the first vehicle given
181  */
182  vehicles.push_back({
183  /*
184  * id, capacity
185  */
186  -1,
187  std::numeric_limits<double>::infinity(),
188 
189  vehicles[0].speed,
190  vehicles[0].start_x,
191  vehicles[0].start_y,
192  vehicles[0].start_node_id,
193 
194  /*
195  * cant_v, start_open_t, start_close_t, start_service_t
196  */
197  1,
198  0,
199  std::numeric_limits<double>::infinity(),
200  0,
201 
202  vehicles[0].end_x,
203  vehicles[0].end_y,
204  vehicles[0].end_node_id,
205  /*
206  * end_open_t, end_close_t, end_service_t
207  */
208  0,
209  std::numeric_limits<double>::infinity(),
210  0});
211 
212 
213  for (auto vehicle : vehicles) {
214  if (vehicle.cant_v < 0) {
215  msg.error << "Illegal number of vehicles found vehicle";
216  msg.log << vehicle.cant_v << "< 0 on vehicle " << vehicle.id;
217  return false;
218  }
219 
220  if (problem->m_cost_matrix.empty()) {
221  /*
222  * Euclidean version
223  */
224  auto b_start = create_b_start<Node>(vehicle, problem->node_id());
225  auto starting_site = Vehicle_node(
226  {problem->node_id()++, vehicle, Tw_node::NodeType::kStart});
227 
228  auto b_end = create_b_end<Node>(vehicle, problem->node_id());
229  auto ending_site = Vehicle_node(
230  {problem->node_id()++, vehicle, Tw_node::NodeType::kEnd});
231 
232  if (!(starting_site.is_start() && ending_site.is_end()
233  && starting_site.opens() <= starting_site.closes()
234  && ending_site.opens() <= ending_site.closes())) {
235  msg.clear();
236  msg.error << "Illegal values found on vehicle";
237  msg.log << "On vehicle " << vehicle.id
238  << " a condition is not met:\n"
239  << "starting_site.is_start: "
240  << (starting_site.is_start()? "YES" : "NO") << "\n"
241  << "ending_site.is_end: "
242  << (ending_site.is_end()? "YES" : "NO") << "\n"
243  << "verify that:\n"
244  << "- start_open <= start_close: "
245  << starting_site.opens()
246  << "<" << starting_site.closes() << "\n"
247  << "- end_open <= end_close: "
248  << ending_site.opens()
249  << "<" << ending_site.closes() << "\n"
250  << "- capacity > 0\n";
251  pgassert(!msg.get_error().empty());
252  return false;
253  }
254  pgassert(starting_site.is_start());
255  pgassert(ending_site.is_end());
256 
257  pgassert(starting_site.opens() <= starting_site.closes());
258  pgassert(ending_site.opens() <= ending_site.closes());
259  pgassertwm(
260  starting_site.is_start() && ending_site.is_end(),
261  msg.get_error().c_str());
262  add_vehicle(vehicle, factor,
263  std::move(b_start), starting_site,
264  std::move(b_end), ending_site);
265  } else {
266  /*
267  * Matrix version
268  */
269  auto b_start = create_b_start<Dnode>(vehicle, problem->node_id());
270  auto starting_site = Vehicle_node(
271  {problem->node_id()++, vehicle, Tw_node::NodeType::kStart});
272 
273  auto b_end = create_b_end<Dnode>(vehicle, problem->node_id());
274  auto ending_site = Vehicle_node(
275  {problem->node_id()++, vehicle, Tw_node::NodeType::kEnd});
276 
277  if (!(starting_site.is_start() && ending_site.is_end()
278  && starting_site.opens() <= starting_site.closes()
279  && ending_site.opens() <= ending_site.closes())) {
280  msg.clear();
281  msg.error << "Illegal values found on vehicle";
282  msg.log << "On vehicle " << vehicle.id
283  << " a condition is not met, verify that:\n"
284  << "starting_site.is_start()"
285  << starting_site.is_start() << "\n"
286  << "ending_site.is_start()"
287  << ending_site.is_end() << "\n"
288  << "- start_open <= start_close\n"
289  << starting_site.opens() << "<"
290  << starting_site.closes() << "\n"
291  << "- end_open <= end_close\n"
292  << ending_site.opens() << "<"
293  << ending_site.closes() << "\n"
294  << "- capacity > 0\n";
295  pgassert(!msg.get_error().empty());
296  return false;
297  }
298  pgassert(starting_site.is_start());
299  pgassert(ending_site.is_end());
300 
301  pgassert(starting_site.opens() <= starting_site.closes());
302  pgassert(ending_site.opens() <= ending_site.closes());
303  pgassert(starting_site.is_start() && ending_site.is_end());
304  add_vehicle(vehicle, factor,
305  std::move(b_start), starting_site,
306  std::move(b_end), ending_site);
307  }
308  }
309  Identifiers<size_t> unused(m_trucks.size());
310  un_used = unused;
311  return true;
312 }
std::vector< Vehicle_pickDeliver > m_trucks
Definition: fleet.h:50
static Pgr_pickDeliver * problem
Definition: pd_problem.h:51
#define pgassertwm(expr, msg)
Adds a message to the assertion.
Definition: pgr_assert.h:104
std::ostringstream log
Stores the hint information.
Definition: pgr_messages.h:102
void add_vehicle(Vehicle_t, double factor, std::unique_ptr< Base_node >, const Vehicle_node &, std::unique_ptr< Base_node >, const Vehicle_node &)
Definition: fleet.cpp:133
std::string get_error() const
get_error
std::ostringstream error
Stores the error information.
Definition: pgr_messages.h:106
#define pgassert(expr)
Uses the standard assert syntax.
Definition: pgr_assert.h:81
pgrouting::tsp::Dmatrix m_cost_matrix
double empty() const
Definition: Dmatrix.h:116
static Pgr_messages msg
Definition: pd_problem.h:48
Identifiers< size_t > un_used
Definition: fleet.h:96

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T >
std::unique_ptr<Base_node> pgrouting::vrp::Fleet::create_b_end ( const Vehicle_t vehicle,
size_t  node_id 
)
inlineprivate

Definition at line 125 of file fleet.h.

References Vehicle_t::end_node_id, Vehicle_t::end_x, and Vehicle_t::end_y.

127  {
128  std::unique_ptr<Base_node> b_end(new T(
129  node_id,
130  vehicle.end_node_id,
131  vehicle.end_x,
132  vehicle.end_y));
133  return std::move(b_end);
134  }
double end_x
Definition: vehicle_t.h:75
double end_y
Definition: vehicle_t.h:76
int64_t end_node_id
Definition: vehicle_t.h:77
template<typename T >
std::unique_ptr<Base_node> pgrouting::vrp::Fleet::create_b_start ( const Vehicle_t vehicle,
size_t  node_id 
)
inlineprivate

Definition at line 114 of file fleet.h.

References Vehicle_t::start_node_id, Vehicle_t::start_x, and Vehicle_t::start_y.

116  {
117  std::unique_ptr<Base_node> b_start(new T(
118  node_id,
119  vehicle.start_node_id,
120  vehicle.start_x,
121  vehicle.start_y));
122  return std::move(b_start);
123  }
double start_y
Definition: vehicle_t.h:66
double start_x
Definition: vehicle_t.h:65
int64_t start_node_id
Definition: vehicle_t.h:67
iterator pgrouting::vrp::Fleet::end ( )
inline

Definition at line 88 of file fleet.h.

References operator<<.

88 {return m_trucks.end();}
std::vector< Vehicle_pickDeliver > m_trucks
Definition: fleet.h:50
Vehicle_pickDeliver pgrouting::vrp::Fleet::get_truck ( )

Definition at line 59 of file fleet.cpp.

References ENTERING, EXITING, Identifiers< T >::front(), pgrouting::Pgr_messages::log, m_trucks, pgrouting::vrp::PD_problem::msg, pgassertwm, Identifiers< T >::size(), un_used, and used.

Referenced by pgrouting::vrp::Initial_solution::do_while_foo(), pgrouting::vrp::Initial_solution::one_truck_all_orders(), and operator=().

59  {
60  ENTERING();
61  auto idx = un_used.front();
62  msg.log << "Available vehicles: " << un_used << "\n";
63  msg.log << "NOT Available vehicles: " << used << "\n";
64  msg.log << "getting idx" << idx << "\n";
65  pgassertwm(idx < m_trucks.size(), msg.log.str());
66  used += idx;
67  if (un_used.size() > 1) un_used -= idx;
68  EXITING();
69  return m_trucks[idx];
70 }
std::vector< Vehicle_pickDeliver > m_trucks
Definition: fleet.h:50
#define pgassertwm(expr, msg)
Adds a message to the assertion.
Definition: pgr_assert.h:104
std::ostringstream log
Stores the hint information.
Definition: pgr_messages.h:102
#define EXITING()
Definition: pgr_messages.h:119
#define ENTERING()
Definition: pgr_messages.h:118
size_t size() const
Definition: identifiers.hpp:77
static Pgr_messages msg
Definition: pd_problem.h:48
Identifiers< size_t > used
Definition: fleet.h:95
T front() const
Definition: identifiers.hpp:79
Identifiers< size_t > un_used
Definition: fleet.h:96

Here is the call graph for this function:

Here is the caller graph for this function:

Vehicle_pickDeliver pgrouting::vrp::Fleet::get_truck ( size_t  order)

Definition at line 79 of file fleet.cpp.

References Identifiers< T >::front(), pgrouting::Pgr_messages::get_log(), pgrouting::Pgr_messages::log, m_trucks, pgrouting::vrp::PD_problem::msg, pgassert, pgassertwm, un_used, and used.

79  {
80  msg.log << "Available vehicles: " << un_used << "\n";
81  msg.log << "NOT Available vehicles: " << used << "\n";
82  auto idx = un_used.front();
83 
84  for (const auto i : un_used) {
85  if (m_trucks[i].feasable_orders().has(order)) {
86  idx = i;
87  msg.log << "getting idx" << idx << "\n";
88  used += idx;
89  if (un_used.size() > 1) un_used -= idx;
90  return m_trucks[idx];
91  }
92  }
93 
94  /*
95  * using phoney truck
96  */
97  pgassert(false);
98  return m_trucks.back();
99 
100  for (auto truck : m_trucks) {
101  if (truck.feasable_orders().has(order)) {
102  idx = truck.idx();
103  msg.log << "idx" << idx << "size" << m_trucks.size();
104  pgassertwm(idx < m_trucks.size(), msg.get_log());
105  used += idx;
106  if (un_used.size() > 1) un_used -= idx;
107  break;
108  }
109  }
110  return m_trucks[idx];
111 }
std::vector< Vehicle_pickDeliver > m_trucks
Definition: fleet.h:50
#define pgassertwm(expr, msg)
Adds a message to the assertion.
Definition: pgr_assert.h:104
std::ostringstream log
Stores the hint information.
Definition: pgr_messages.h:102
std::string get_log() const
get_log
#define pgassert(expr)
Uses the standard assert syntax.
Definition: pgr_assert.h:81
static Pgr_messages msg
Definition: pd_problem.h:48
Identifiers< size_t > used
Definition: fleet.h:95
T front() const
Definition: identifiers.hpp:79
Identifiers< size_t > un_used
Definition: fleet.h:96

Here is the call graph for this function:

Vehicle_pickDeliver pgrouting::vrp::Fleet::get_truck ( const Order  order)

Definition at line 115 of file fleet.cpp.

References pgrouting::Pgr_messages::get_log(), pgrouting::Identifier::idx(), pgrouting::Pgr_messages::log, m_trucks, pgrouting::vrp::PD_problem::msg, pgassertwm, Identifiers< T >::size(), un_used, and used.

115  {
116  auto id = m_trucks.front().idx();
117  for (auto truck : m_trucks) {
118  if (truck.feasable_orders().has(order.idx())) {
119  id = truck.idx();
120  msg.log << "id" << id
121  << "size" << m_trucks.size();
122  pgassertwm(id < m_trucks.size(), msg.get_log());
123  used += id;
124  if (un_used.size() > 1) un_used -= id;
125  break;
126  }
127  }
128  return m_trucks[id];
129 }
std::vector< Vehicle_pickDeliver > m_trucks
Definition: fleet.h:50
#define pgassertwm(expr, msg)
Adds a message to the assertion.
Definition: pgr_assert.h:104
std::ostringstream log
Stores the hint information.
Definition: pgr_messages.h:102
std::string get_log() const
get_log
size_t size() const
Definition: identifiers.hpp:77
static Pgr_messages msg
Definition: pd_problem.h:48
Identifiers< size_t > used
Definition: fleet.h:95
Identifiers< size_t > un_used
Definition: fleet.h:96

Here is the call graph for this function:

bool pgrouting::vrp::Fleet::is_fleet_ok ( ) const

Definition at line 316 of file fleet.cpp.

References ENTERING, pgrouting::Pgr_messages::error, EXITING, pgrouting::Pgr_messages::get_error(), pgrouting::Pgr_messages::log, m_trucks, pgrouting::vrp::PD_problem::msg, and pgassertwm.

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

316  {
317  ENTERING();
318  if (!msg.get_error().empty()) return false;
319  for (auto truck : m_trucks) {
320  if (!truck.is_ok()) {
321  msg.error << "Illegal values found on vehicle";
322  msg.log << "On vehicle " << truck.id()
323  << " a condition is not met, verify that:\n"
324  << "- start_open <= start_close\n"
325  << "- end_open <= end_close\n"
326  << "- capacity > 0\n";
327  return false;
328  }
329 
330  if (!(truck.start_site().is_start()
331  && truck.end_site().is_end())) {
332  pgassertwm(false, "should never pass through here");
333  msg.error << "Illegal values found on vehicle";
334  return false;
335  }
336  if (!truck.is_feasable()) {
337  msg.error << "Truck is not feasible";
338  return false;
339  }
340  }
341  EXITING();
342  return true;
343 }
std::vector< Vehicle_pickDeliver > m_trucks
Definition: fleet.h:50
#define pgassertwm(expr, msg)
Adds a message to the assertion.
Definition: pgr_assert.h:104
std::ostringstream log
Stores the hint information.
Definition: pgr_messages.h:102
std::string get_error() const
get_error
#define EXITING()
Definition: pgr_messages.h:119
std::ostringstream error
Stores the error information.
Definition: pgr_messages.h:106
#define ENTERING()
Definition: pgr_messages.h:118
static Pgr_messages msg
Definition: pd_problem.h:48

Here is the call graph for this function:

Here is the caller graph for this function:

bool pgrouting::vrp::Fleet::is_order_ok ( const Order order) const

Given an order, Cycle trhugh all the trucks to verify if the order can be served by at least one truck.

Definition at line 351 of file fleet.cpp.

References pgrouting::vrp::Order::is_valid(), and m_trucks.

Referenced by operator=().

351  {
352  for (const auto truck : m_trucks) {
353  if (!order.is_valid(truck.speed())) continue;
354  if (truck.is_order_feasable(order)) {
355  return true;
356  }
357  }
358  return false;
359 }
std::vector< Vehicle_pickDeliver > m_trucks
Definition: fleet.h:50

Here is the call graph for this function:

Here is the caller graph for this function:

Fleet& pgrouting::vrp::Fleet::operator= ( const Fleet fleet)
inline

Definition at line 65 of file fleet.h.

References get_truck(), is_fleet_ok(), is_order_ok(), m_trucks, release_truck(), set_compatibles(), un_used, and used.

65  {
66  m_trucks = fleet.m_trucks;
67  used = fleet.used;
68  un_used = fleet.un_used;
69  return *this;
70  }
std::vector< Vehicle_pickDeliver > m_trucks
Definition: fleet.h:50
Identifiers< size_t > used
Definition: fleet.h:95
Identifiers< size_t > un_used
Definition: fleet.h:96

Here is the call graph for this function:

Vehicle_pickDeliver & pgrouting::vrp::Fleet::operator[] ( size_t  i)

Definition at line 362 of file fleet.cpp.

References m_trucks, and pgassert.

Referenced by size().

362  {
363  pgassert(i < m_trucks.size());
364  return m_trucks[i];
365 }
std::vector< Vehicle_pickDeliver > m_trucks
Definition: fleet.h:50
#define pgassert(expr)
Uses the standard assert syntax.
Definition: pgr_assert.h:81

Here is the caller graph for this function:

void pgrouting::vrp::Fleet::release_truck ( size_t  id)

Definition at line 73 of file fleet.cpp.

References un_used, and used.

Referenced by pgrouting::vrp::Initial_solution::do_while_foo(), and operator=().

73  {
74  used -= id;
75  un_used += id;
76 }
Identifiers< size_t > used
Definition: fleet.h:95
Identifiers< size_t > un_used
Definition: fleet.h:96

Here is the caller graph for this function:

void pgrouting::vrp::Fleet::set_compatibles ( const PD_Orders orders)

Definition at line 368 of file fleet.cpp.

References m_trucks.

Referenced by operator=().

368  {
369  for (auto &truck : m_trucks) {
370  truck.set_compatibles(orders);
371  }
372 }
std::vector< Vehicle_pickDeliver > m_trucks
Definition: fleet.h:50

Here is the caller graph for this function:

size_t pgrouting::vrp::Fleet::size ( ) const
inline

Definition at line 85 of file fleet.h.

References operator[]().

85 {return m_trucks.size();}
std::vector< Vehicle_pickDeliver > m_trucks
Definition: fleet.h:50

Here is the call graph for this function:

Friends And Related Function Documentation

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

Definition at line 379 of file fleet.cpp.

Referenced by end().

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 }

Member Data Documentation

std::vector<Vehicle_pickDeliver> pgrouting::vrp::Fleet::m_trucks
Identifiers<size_t> pgrouting::vrp::Fleet::un_used
private

Definition at line 96 of file fleet.h.

Referenced by build_fleet(), Fleet(), get_truck(), operator=(), and release_truck().

Identifiers<size_t> pgrouting::vrp::Fleet::used
private

Definition at line 95 of file fleet.h.

Referenced by get_truck(), operator=(), and release_truck().


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