vrpRouting  0.3
vrprouting::problem::Vehicle Class Reference

Vehicle with time windows. More...

#include "vehicle.h"

Inheritance diagram for vrprouting::problem::Vehicle:
Collaboration diagram for vrprouting::problem::Vehicle:

Public Member Functions

PAmount capacity () const
 returns the capacity of the vehicle More...
 
int cvTot () const
 
TInterval duration () const
 duration of vehicle while not in a "depot" More...
 
bool empty () const
 
const Vehicle_nodeend_site () const
 
std::vector< Solution_rtget_postgres_result (int vid) const
 
std::vector< Idget_stops () const
 
bool has_cv () const
 
bool has_twv () const
 
void invariant () const
 
bool is_feasible () const
 
bool is_ok () const
 
bool is_phony () const
 
bool is_real () const
 
size_t length () const
 
std::string path_str () const
 
Speed speed () const
 the speed of the vehicle More...
 
const Vehicle_nodestart_site () const
 
std::string tau () const
 
TInterval total_service_time () const
 total time spent moving from one node to another More...
 
TInterval total_travel_time () const
 total time spent moving from one node to another More...
 
TInterval total_wait_time () const
 duration of vehicle while waiting for a node to open More...
 
int twvTot () const
 

Protected Member Functions

 Vehicle ()=delete
 
 Vehicle (const Vehicle &)=default
 
 Vehicle (Idx idx, Id id, const Vehicle_node &p_starting_site, const Vehicle_node &p_ending_site, PAmount p_capacity, Speed p_speed=1.0)
 
std::pair< size_t, size_t > drop_position_limits (const Vehicle_node &node) const
 
void erase (const Vehicle_node &node)
 deletes a node if it exists More...
 
void erase (size_t pos)
 
void erase_node (size_t pos)
 
void evaluate ()
 
void evaluate (size_t from)
 
size_t getDropPosLowLimit (const Vehicle_node &node) const
 
size_t getPosHighLimit (const Vehicle_node &node) const
 Get the highest position on the path where node can be placed. More...
 
size_t getPosLowLimit (const Vehicle_node &node) const
 Get the lowest position on the path where node can be placed. More...
 
void insert (size_t pos, const Vehicle_node &node)
 
void insert_node (size_t pos, const Vehicle_node &node)
 
void pop_back ()
 
void pop_front ()
 
std::pair< size_t, size_t > position_limits (const Vehicle_node &node) const
 Get the limits to insert the node. More...
 
void push_back (const Vehicle_node &node)
 
void push_back_node (const Vehicle_node &node)
 
void push_front (const Vehicle_node &node)
 
void push_front_node (const Vehicle_node &node)
 
void swap (size_t i, size_t j)
 

Protected Attributes

elements
 STL member. More...
 
int m_user_cv {0}
 Time window violations on solution. More...
 
int m_user_twv {0}
 Time window violations on solution. More...
 

Private Attributes

PAmount m_capacity
 
int64_t m_id
 
size_t m_idx
 
Speed m_speed = 1.0
 

Friends

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

Detailed Description

Vehicle with time windows.

General functionality for a vehicle in a PROBLEM problem

Recommended use:

Class my_vehicle : public vehicle

A vehicle is a sequence of N from starting site to ending site. has: capacity

Definition at line 61 of file vehicle.h.

Constructor & Destructor Documentation

◆ Vehicle() [1/3]

vrprouting::problem::Vehicle::Vehicle ( )
protecteddelete

◆ Vehicle() [2/3]

vrprouting::problem::Vehicle::Vehicle ( const Vehicle )
protecteddefault

◆ Vehicle() [3/3]

vrprouting::problem::Vehicle::Vehicle ( Idx  idx,
Id  id,
const Vehicle_node p_starting_site,
const Vehicle_node p_ending_site,
PAmount  p_capacity,
Speed  p_speed = 1.0 
)
protected

Definition at line 235 of file vehicle.cpp.

241  :
242  Identifier(idx, id),
243  m_capacity(p_capacity),
244  m_speed(p_speed) {
245  std::deque<Vehicle_node>::push_back(p_starting_site);
246  std::deque<Vehicle_node>::push_back(p_ending_site);
247  evaluate();
248  }

References evaluate().

Member Function Documentation

◆ capacity()

PAmount vrprouting::problem::Vehicle::capacity ( ) const

returns the capacity of the vehicle

Returns
the capacity of the vehicle

Definition at line 66 of file vehicle.cpp.

66 {return m_capacity;}

References m_capacity.

Referenced by evaluate().

◆ cvTot()

int vrprouting::problem::Vehicle::cvTot ( ) const

◆ drop_position_limits()

std::pair< size_t, size_t > vrprouting::problem::Vehicle::drop_position_limits ( const Vehicle_node node) const
protected

Definition at line 426 of file vehicle.cpp.

426  {
427  size_t high = getPosHighLimit(node);
428  size_t low = getDropPosLowLimit(node);
429  return std::make_pair(low, high);
430 }

References getDropPosLowLimit(), and getPosHighLimit().

Referenced by vrprouting::problem::Vehicle_pickDeliver::semiLIFO().

◆ duration()

TInterval vrprouting::problem::Vehicle::duration ( ) const

duration of vehicle while not in a "depot"

Returns
0 when the Vehicle is phony
duration of vehicle while not in a stop or ending site

Definition at line 72 of file vehicle.cpp.

72 {return is_phony()? 0 : back().arrival_time() - front().departure_time();}

References is_phony().

Referenced by vrprouting::problem::Solution::duration(), vrprouting::problem::operator<(), and tau().

◆ empty()

bool vrprouting::problem::Vehicle::empty ( ) const

◆ end_site()

const Vehicle_node & vrprouting::problem::Vehicle::end_site ( ) const

Definition at line 124 of file vehicle.cpp.

124 {return back();}

Referenced by is_ok().

◆ erase() [1/2]

void vrprouting::problem::Vehicle::erase ( const Vehicle_node node)
protected

deletes a node if it exists

Parameters
[in]node
Precondition
the node can not be S or E
S .... [node.idx()] .... E
Postcondition
S .... .... E

Definition at line 184 of file vehicle.cpp.

184  {
185  pgassert(!node.is_start() && !node.is_end());
186 #if 0
187  /* TODO this works, but somehow gives docqueries give different results */
188  std::deque<Vehicle_node>::erase(
189  std::remove_if(begin(), end(),
190  [&](const Vehicle_node& n) {return n.idx() == idx();}), end());
191  evaluate();
192 #else
193  for (size_t pos = 0 ; pos < size() ; ++pos) {
194  if (node.idx() == at(pos).idx()) {
195  erase(pos);
196  break;
197  }
198  }
199 #endif
200 }

References erase(), evaluate(), vrprouting::Identifier::idx(), vrprouting::problem::Tw_node::is_end(), vrprouting::problem::Tw_node::is_start(), and pgassert.

◆ erase() [2/2]

void vrprouting::problem::Vehicle::erase ( size_t  pos)
protected

Definition at line 172 of file vehicle.cpp.

172  {
173  erase_node(pos);
174  evaluate(pos);
175 }

References erase_node(), and evaluate().

Referenced by erase().

◆ erase_node()

void vrprouting::problem::Vehicle::erase_node ( size_t  pos)
protected

Definition at line 152 of file vehicle.cpp.

152  {
153  using difference_type = std::vector<double>::difference_type;
154  pgassert(pos < size() - 1 && static_cast<difference_type>(pos) > 0);
155  std::deque<Vehicle_node>::erase(std::deque<Vehicle_node>::begin() + static_cast<difference_type>(pos));
156 }

References pgassert.

Referenced by erase(), vrprouting::problem::Vehicle_pickDeliver::hillClimb(), pop_back(), and pop_front().

◆ evaluate() [1/2]

◆ evaluate() [2/2]

void vrprouting::problem::Vehicle::evaluate ( size_t  from)
protected
Parameters
[in]fromThe position in the path for evaluation to the end of the path.

Definition at line 131 of file vehicle.cpp.

131  {
132  invariant();
133  // preconditions
134  pgassert(from < size());
135 
136  using difference_type = std::vector<Vehicle_node>::difference_type;
137  auto node = begin() + static_cast<difference_type>(from);
138 
139  while (node != end()) {
140  if (node == begin()) {
141  node->evaluate(capacity());
142  } else {
143  node->evaluate(*(node - 1), capacity(), speed());
144  }
145 
146  ++node;
147  }
148  invariant();
149 }

References capacity(), invariant(), pgassert, and speed().

◆ get_postgres_result()

std::vector< Solution_rt > vrprouting::problem::Vehicle::get_postgres_result ( int  vid) const
Returns
the vehicle's path in a structure for postgres
Parameters
[in]vidit is the vid-th vehicle in the solution

Definition at line 292 of file vehicle.cpp.

292  {
293  std::vector<Solution_rt> result;
294  int stop_seq(1);
295  for (const auto &p_stop : *this) {
296  result.push_back(p_stop.get_postgres_result(vid, id(), stop_seq));
297  ++stop_seq;
298  }
299  return result;
300 }

◆ get_stops()

std::vector< Id > vrprouting::problem::Vehicle::get_stops ( ) const
Returns
container for postgres

Definition at line 306 of file vehicle.cpp.

306  {
307  if (is_phony()) return std::vector<Id>();
308  std::vector<Id> result;
309  for (const auto &p_stop : *this) {
310  if (p_stop.is_start() || p_stop.is_end()) continue;
311  result.push_back(p_stop.order());
312  }
313  return result;
314 }

References is_phony().

◆ getDropPosLowLimit()

size_t vrprouting::problem::Vehicle::getDropPosLowLimit ( const Vehicle_node node) const
protected

Definition at line 331 of file vehicle.cpp.

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

References invariant(), and speed().

Referenced by drop_position_limits().

◆ getPosHighLimit()

size_t vrprouting::problem::Vehicle::getPosHighLimit ( const Vehicle_node node) const
protected

Get the highest position on the path where node can be placed.

Definition at line 397 of file vehicle.cpp.

397  {
398  invariant();
399 
400  size_t low = 0;
401  size_t high = size();
402  size_t high_limit = low;
403 
404  /* I == m_path[high_limit] */
405  while (high_limit < high
406  && nodeJ.is_compatible_IJ(at(high_limit), speed())) {
407  ++high_limit;
408  }
409 
410  invariant();
411  return high_limit;
412 }

References invariant(), vrprouting::problem::Tw_node::is_compatible_IJ(), and speed().

Referenced by drop_position_limits(), and position_limits().

◆ getPosLowLimit()

size_t vrprouting::problem::Vehicle::getPosLowLimit ( const Vehicle_node nodeI) const
protected

Get the lowest position on the path where node can be placed.

Returns
the lowest position where the node can be placed
Parameters
[in]nodeIstart searching from postition low = pos(E)

S 1 2 3 4 5 6 7 ..... E node -> E node -> ... node -> 7 node -> 6 node -> 5 node /-> 4

return low_limit = 5

Definition at line 366 of file vehicle.cpp.

366  {
367  invariant();
368 
369  size_t low = 0;
370  size_t high = size();
371  size_t low_limit = high;
372 
373  /* J == m_path[low_limit - 1] */
374  while (low_limit > low
375  && at(low_limit - 1).is_compatible_IJ(nodeI)) {
376  --low_limit;
377  }
378 
379  invariant();
380  return low_limit;
381 }

References invariant().

Referenced by position_limits().

◆ has_cv()

bool vrprouting::problem::Vehicle::has_cv ( ) const

Definition at line 98 of file vehicle.cpp.

98 {return cvTot() > m_user_cv;}

References cvTot(), and m_user_cv.

Referenced by is_feasible(), and vrprouting::problem::Vehicle_pickDeliver::semiLIFO().

◆ has_twv()

bool vrprouting::problem::Vehicle::has_twv ( ) const

Definition at line 96 of file vehicle.cpp.

96 {return twvTot() > m_user_twv;}

References m_user_twv, and twvTot().

Referenced by is_feasible(), and vrprouting::problem::Vehicle_pickDeliver::semiLIFO().

◆ id()

◆ idx()

◆ insert()

void vrprouting::problem::Vehicle::insert ( size_t  pos,
const Vehicle_node node 
)
protected

◆ insert_node()

void vrprouting::problem::Vehicle::insert_node ( size_t  pos,
const Vehicle_node node 
)
protected

Definition at line 158 of file vehicle.cpp.

158  {
159  using difference_type = std::vector<double>::difference_type;
160  pgassert(pos < size() && static_cast<difference_type>(pos) > 0);
161  std::deque<Vehicle_node>::insert(std::deque<Vehicle_node>::begin() + static_cast<difference_type>(pos), node);
162 }

References pgassert.

Referenced by insert(), vrprouting::problem::Vehicle_pickDeliver::push_back(), push_back(), push_back_node(), vrprouting::problem::Vehicle_pickDeliver::push_front(), push_front(), and push_front_node().

◆ invariant()

void vrprouting::problem::Vehicle::invariant ( ) const

◆ is_feasible()

bool vrprouting::problem::Vehicle::is_feasible ( ) const

◆ is_ok()

bool vrprouting::problem::Vehicle::is_ok ( ) const

Definition at line 106 of file vehicle.cpp.

106  {
107  return (start_site().opens() <= start_site().closes())
108  && (end_site().opens() <= end_site().closes())
109  && (m_capacity > 0);
110 }

References vrprouting::problem::Tw_node::closes(), end_site(), m_capacity, vrprouting::problem::Tw_node::opens(), and start_site().

◆ is_phony()

◆ is_real()

bool vrprouting::problem::Vehicle::is_real ( ) const

Definition at line 118 of file vehicle.cpp.

118 {return !is_phony();}

References is_phony().

◆ length()

size_t vrprouting::problem::Vehicle::length ( ) const

Definition at line 114 of file vehicle.cpp.

114 {return size() - 2;}

◆ path_str()

std::string vrprouting::problem::Vehicle::path_str ( ) const

Definition at line 272 of file vehicle.cpp.

272  {
273  std::ostringstream key;
274 
275  for (const auto &p_stop : *this) {
276  if (!(p_stop == front())) key << ",";
277 
278  if (p_stop.is_start() || p_stop.is_end()) {
279  key << p_stop.type_str();
280  } else {
281  key << p_stop.type_str() << p_stop.order();
282  }
283  }
284  return key.str();
285 }

◆ pop_back()

void vrprouting::problem::Vehicle::pop_back ( )
protected

Definition at line 218 of file vehicle.cpp.

218  {
219  erase_node(size() - 2);
220  evaluate(size() - 1);
221 }

References erase_node(), and evaluate().

◆ pop_front()

void vrprouting::problem::Vehicle::pop_front ( )
protected

Definition at line 223 of file vehicle.cpp.

223  {
224  erase_node(1);
225  evaluate();
226 }

References erase_node(), and evaluate().

◆ position_limits()

std::pair< size_t, size_t > vrprouting::problem::Vehicle::position_limits ( const Vehicle_node node) const
protected

Get the limits to insert the node.

Returns
the upper and lower position on the path where the node can be inserted
Parameters
[in]nodeto try to be tested

Definition at line 419 of file vehicle.cpp.

419  {
420  size_t high = getPosHighLimit(node);
421  size_t low = getPosLowLimit(node);
422  return std::make_pair(low, high);
423 }

References getPosHighLimit(), and getPosLowLimit().

Referenced by vrprouting::problem::Vehicle_pickDeliver::hillClimb().

◆ push_back()

void vrprouting::problem::Vehicle::push_back ( const Vehicle_node node)
protected

Definition at line 208 of file vehicle.cpp.

208  {
209  insert_node(size() - 1, node);
210  evaluate(size() - 2);
211 }

References evaluate(), and insert_node().

◆ push_back_node()

void vrprouting::problem::Vehicle::push_back_node ( const Vehicle_node node)
protected

Definition at line 164 of file vehicle.cpp.

164  {
165  insert_node(1, node);
166 }

References insert_node().

◆ push_front()

void vrprouting::problem::Vehicle::push_front ( const Vehicle_node node)
protected

Definition at line 213 of file vehicle.cpp.

213  {
214  insert_node(1, node);
215  evaluate();
216 }

References evaluate(), and insert_node().

◆ push_front_node()

void vrprouting::problem::Vehicle::push_front_node ( const Vehicle_node node)
protected

Definition at line 168 of file vehicle.cpp.

168  {
169  insert_node(size() - 1, node);
170 }

References insert_node().

◆ reset_id()

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

change the original id

Definition at line 47 of file identifier.cpp.

47  {
48  m_id = _id;
49 }

References vrprouting::Identifier::m_id.

Referenced by vrprouting::problem::Tw_node::Tw_node().

◆ speed()

Speed vrprouting::problem::Vehicle::speed ( ) const

the speed of the vehicle

Returns
the value of the speed

When the matrix is a time matrix: speed should be in t / t^2 When the matrix is a distance matrix: speed should be in d / t^2

where: d = distance units t = time units

The calculated value of the traveling time will become tt(a, b) = matrix(a,b) / speed;

Definition at line 63 of file vehicle.cpp.

63 {return m_speed;}

References m_speed.

Referenced by evaluate(), getDropPosLowLimit(), and getPosHighLimit().

◆ start_site()

const Vehicle_node & vrprouting::problem::Vehicle::start_site ( ) const

Definition at line 122 of file vehicle.cpp.

122 {return front();}

Referenced by is_ok().

◆ swap()

void vrprouting::problem::Vehicle::swap ( size_t  i,
size_t  j 
)
protected

Definition at line 228 of file vehicle.cpp.

228  {
229  pgassert(i < size() - 1 && i > 0);
230  pgassert(j < size() - 1 && j > 0);
231  std::swap(at(i), at(j));
232  i < j ? evaluate(i) : evaluate(j);
233 }

References evaluate(), and pgassert.

Referenced by vrprouting::problem::Vehicle_pickDeliver::hillClimb().

◆ tau()

std::string vrprouting::problem::Vehicle::tau ( ) const

Definition at line 251 of file vehicle.cpp.

251  {
252  invariant();
253  std::ostringstream log;
254  log << "truck " << id() << "(" << idx() << ")" << " (";
255  for (const auto &p_stop : *this) {
256  if (!(p_stop == front())) log << ", ";
257  p_stop.is_start() || p_stop.is_end()?
258  log << p_stop.type_str() << id() :
259  log << p_stop.type_str() << p_stop.order();
260  }
261  log << std::fixed << std::setprecision(4) << ")\t"
262  << "twv=" << twvTot()
263  << " cv=" << cvTot()
264  << " wait=" << total_wait_time()
265  << " duration=" << duration()
266  << " tt=" << total_travel_time()
267  << "\t";
268  return log.str();
269 }

References cvTot(), duration(), vrprouting::Identifier::id(), vrprouting::Identifier::idx(), invariant(), total_travel_time(), total_wait_time(), and twvTot().

Referenced by vrprouting::problem::Vehicle_pickDeliver::set_initial_solution().

◆ total_service_time()

TInterval vrprouting::problem::Vehicle::total_service_time ( ) const

total time spent moving from one node to another

Returns
duration of vehicle while moving for a node to open
0 when the Vehicle is phony

Definition at line 90 of file vehicle.cpp.

90 {return is_phony()? 0 : back().total_service_time();}

References is_phony().

Referenced by vrprouting::problem::Solution::total_service_time().

◆ total_travel_time()

TInterval vrprouting::problem::Vehicle::total_travel_time ( ) const

total time spent moving from one node to another

Returns
total time vehicle spent moving from a node to another
0 when the Vehicle is phony

Definition at line 84 of file vehicle.cpp.

84 {return is_phony()? 0 : back().total_travel_time();}

References is_phony().

Referenced by vrprouting::problem::Vehicle_pickDeliver::objective(), vrprouting::problem::operator<(), tau(), and vrprouting::problem::Solution::total_travel_time().

◆ total_wait_time()

TInterval vrprouting::problem::Vehicle::total_wait_time ( ) const

duration of vehicle while waiting for a node to open

Returns
duration of vehicle while waiting for a node to open
0 when the Vehicle is phony

Definition at line 78 of file vehicle.cpp.

78 {return is_phony()? 0 : back().total_wait_time(); }

References is_phony().

Referenced by vrprouting::problem::operator<(), tau(), and vrprouting::problem::Solution::wait_time().

◆ twvTot()

int vrprouting::problem::Vehicle::twvTot ( ) const

Friends And Related Function Documentation

◆ operator<

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

Definition at line 433 of file vehicle.cpp.

433  {
434  /*
435  * capacity violations
436  */
437  if (lhs.cvTot() < rhs.cvTot()) return true;
438  if (lhs.cvTot() > rhs.cvTot()) return false;
439 
440  /*
441  * time window violations
442  */
443  if (lhs.twvTot() < rhs.twvTot()) return true;
444  if (lhs.twvTot() > rhs.twvTot()) return false;
445 
446  /*
447  * waiting time
448  */
449  if (lhs.total_wait_time() < rhs.total_wait_time()) return true;
450  if (lhs.total_wait_time() > rhs.total_wait_time()) return false;
451 
452  /*
453  * travel time
454  */
455  if (lhs.total_travel_time() < rhs.total_travel_time()) return true;
456  if (lhs.total_travel_time() > rhs.total_travel_time()) return false;
457 
458  /*
459  * duration
460  */
461  if (lhs.duration() < rhs.duration()) return true;
462  if (lhs.duration() > rhs.duration()) return false;
463 
464  /*
465  * truck size
466  */
467  if (lhs.size() < rhs.size()) return true;
468  return false;
469 }

Member Data Documentation

◆ elements

T std::deque< T >::elements
inherited

STL member.

◆ m_capacity

PAmount vrprouting::problem::Vehicle::m_capacity
private

Definition at line 182 of file vehicle.h.

Referenced by capacity(), and is_ok().

◆ m_id

int64_t vrprouting::Identifier::m_id
privateinherited

Definition at line 87 of file identifier.h.

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

◆ m_idx

size_t vrprouting::Identifier::m_idx
privateinherited

Definition at line 86 of file identifier.h.

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

◆ m_speed

Speed vrprouting::problem::Vehicle::m_speed = 1.0
private

Definition at line 183 of file vehicle.h.

Referenced by speed().

◆ m_user_cv

int vrprouting::problem::Vehicle::m_user_cv {0}
protected

Time window violations on solution.

The user can give a solution that has capacity violations

Definition at line 179 of file vehicle.h.

Referenced by has_cv(), and vrprouting::problem::Vehicle_pickDeliver::set_initial_solution().

◆ m_user_twv

int vrprouting::problem::Vehicle::m_user_twv {0}
protected

Time window violations on solution.

The user can give a solution that has time window violations

Definition at line 173 of file vehicle.h.

Referenced by has_twv(), and vrprouting::problem::Vehicle_pickDeliver::set_initial_solution().


The documentation for this class was generated from the following files:
vrprouting::problem::Vehicle::m_speed
Speed m_speed
Definition: vehicle.h:183
vrprouting::problem::Vehicle::twvTot
int twvTot() const
Definition: vehicle.cpp:92
vrprouting::problem::Vehicle::evaluate
void evaluate()
Definition: vehicle.cpp:126
vrprouting::problem::Vehicle::invariant
void invariant() const
Definition: vehicle.cpp:100
vrprouting::Identifier::Identifier
Identifier()=default
vrprouting::problem::Vehicle::start_site
const Vehicle_node & start_site() const
Definition: vehicle.cpp:122
vrprouting::Identifier::id
int64_t id() const
get the original id
Definition: identifier.cpp:42
vrprouting::Identifier::m_id
int64_t m_id
Definition: identifier.h:87
vrprouting::problem::Vehicle::has_twv
bool has_twv() const
Definition: vehicle.cpp:96
vrprouting::problem::Tw_node::closes
TTimestamp closes() const
Returns the closing time.
Definition: tw_node.h:81
vrprouting::problem::Vehicle::m_user_cv
int m_user_cv
Time window violations on solution.
Definition: vehicle.h:179
vrprouting::Identifier::m_idx
size_t m_idx
Definition: identifier.h:86
vrprouting::problem::Vehicle::getDropPosLowLimit
size_t getDropPosLowLimit(const Vehicle_node &node) const
Definition: vehicle.cpp:331
vrprouting::problem::Vehicle::is_phony
bool is_phony() const
Definition: vehicle.cpp:116
pgassert
#define pgassert(expr)
Uses the standard assert syntax.
Definition: pgr_assert.h:95
vrprouting::problem::Vehicle::end_site
const Vehicle_node & end_site() const
Definition: vehicle.cpp:124
vrprouting::problem::Vehicle::m_user_twv
int m_user_twv
Time window violations on solution.
Definition: vehicle.h:173
vrprouting::problem::Vehicle::getPosHighLimit
size_t getPosHighLimit(const Vehicle_node &node) const
Get the highest position on the path where node can be placed.
Definition: vehicle.cpp:397
vrprouting::Identifier::idx
size_t idx() const
get the internal index
Definition: identifier.cpp:37
vrprouting::problem::Vehicle::m_capacity
PAmount m_capacity
Definition: vehicle.h:182
vrprouting::problem::Vehicle::cvTot
int cvTot() const
Definition: vehicle.cpp:94
vrprouting::problem::Vehicle::total_wait_time
TInterval total_wait_time() const
duration of vehicle while waiting for a node to open
Definition: vehicle.cpp:78
vrprouting::problem::Vehicle::duration
TInterval duration() const
duration of vehicle while not in a "depot"
Definition: vehicle.cpp:72
vrprouting::problem::Vehicle::erase
void erase(size_t pos)
Definition: vehicle.cpp:172
vrprouting::problem::Vehicle::total_travel_time
TInterval total_travel_time() const
total time spent moving from one node to another
Definition: vehicle.cpp:84
vrprouting::problem::Vehicle::erase_node
void erase_node(size_t pos)
Definition: vehicle.cpp:152
vrprouting::problem::Vehicle::insert_node
void insert_node(size_t pos, const Vehicle_node &node)
Definition: vehicle.cpp:158
vrprouting::problem::Vehicle::getPosLowLimit
size_t getPosLowLimit(const Vehicle_node &node) const
Get the lowest position on the path where node can be placed.
Definition: vehicle.cpp:366
vrprouting::problem::Vehicle::capacity
PAmount capacity() const
returns the capacity of the vehicle
Definition: vehicle.cpp:66
vrprouting::problem::Vehicle::has_cv
bool has_cv() const
Definition: vehicle.cpp:98
vrprouting::problem::Vehicle::speed
Speed speed() const
the speed of the vehicle
Definition: vehicle.cpp:63
vrprouting::problem::Tw_node::opens
TTimestamp opens() const
Returns the opening time.
Definition: tw_node.h:78