vrpRouting  0.3
vrprouting::problem::Tw_node Class Reference

Time window attributes of a node. More...

#include "tw_node.h"

Inheritance diagram for vrprouting::problem::Tw_node:
Collaboration diagram for vrprouting::problem::Tw_node:

Public Member Functions

 Tw_node ()=delete
 Creating a Tw_node is not permitted. More...
 
 Tw_node (const Tw_node &)=default
 Copy constructor. More...
 
 Tw_node (size_t id, const PickDeliveryOrders_t &data, const NodeType &type)
 Creating a Tw_node from a postgreSQL order. More...
 
 Tw_node (size_t id, const Vehicle_t &data, const NodeType &type)
 Creating a Tw_node from a postgreSQL vehicle. More...
 
TTimestamp arrival_j_closes_i (const Tw_node &I, Speed=1.0) const
 arrival time at This node, when arrived at I at closing time TODO refine description More...
 
TTimestamp arrival_j_opens_i (const Tw_node &I, Speed=1.0) const
 arrival time at This node, when arrived at I at opening time TODO refine description More...
 
TTimestamp closes () const
 Returns the closing time. More...
 
Amount demand () const
 Returns the demand associated with this node. More...
 
bool is_compatible_IJ (const Tw_node &I, Speed=1.0) const
 is possible to arrive to this after visiting other? More...
 
bool is_delivery () const
 Is the node a valid order's delivery node. More...
 
bool is_dump () const
 Is the node a valid vehicle's dumping node. More...
 
bool is_early_arrival (TTimestamp arrival_time) const
 True when arrivalTime is before it opens. More...
 
bool is_end () const
 Is the node a valid vehicle's ending node. More...
 
bool is_late_arrival (TTimestamp arrival_time) const
 True when arrivalTime is after it closes. More...
 
bool is_load () const
 Is the node a valid vehicle's loading node. More...
 
bool is_on_time (TTimestamp arrival_time) const
 True when arrivalTime in the time window. More...
 
bool is_partially_compatible_IJ (const Tw_node &I, Speed=1.0) const
 can arrive to this after visiting as late as possible I? TODO refine description More...
 
bool is_partially_waitTime_compatible_IJ (const Tw_node &I, Speed=1.0) const
 can arrive to this after visiting as late as possible I? TODO refine description More...
 
bool is_pickup () const
 Is the node a valid order's pickup node. More...
 
bool is_start () const
 Is the node a valid vehicle's starting node. More...
 
bool is_tight_compatible_IJ (const Tw_node &I, Speed=1.0) const
 can arrive to this after visiting as late as possible I? TODO refine description More...
 
bool is_valid () const
 is the node valid? More...
 
bool is_waitTime_compatible_IJ (const Tw_node &I, Speed=1.0) const
 can arrive to this after visiting as late as possible I? TODO refine description More...
 
TTimestamp opens () const
 Returns the opening time. More...
 
bool operator== (const Tw_node &rhs) const
 equality operator More...
 
int64_t order () const
 Returns the order to which it belongs. More...
 
TInterval service_time () const
 Returns the service time for this node. More...
 
TInterval travel_time_to (const Tw_node &, TTimestamp, Speed=1.0) const
 travel time to other node. More...
 
auto type () const
 Returns the type of this node. More...
 
std::string type_str () const
 returns a string code of the kind of node More...
 
TInterval window_length () const
 Returns the length of time between the opening and closing. More...
 

Static Public Attributes

static const Matrixm_time_matrix_ptr = nullptr
 

Protected Member Functions

void demand (Amount value)
 Sets the demand value to a new value. More...
 

Private Attributes

TTimestamp m_closes
 closing time of the node More...
 
Amount m_demand
 The demand for the Node. More...
 
int64_t m_id
 
size_t m_idx
 
TTimestamp m_opens
 opening time of the node More...
 
int64_t m_order { }
 order to which it belongs (idx) More...
 
TInterval m_service_time
 time it takes to be served More...
 
NodeType m_type
 The kind of Node. More...
 

Friends

std::ostream & operator<< (std::ostream &, const Tw_node &)
 Print the contents of a Twnode object. More...
 

Detailed Description

Time window attributes of a node.

A Time Window node is a Node with addition attributes and methods to to support Time Windows and to model a more complex Node need in many vehicle routing problems.

Most application specific code will extend this class and define the specific values and requirements for type and streetid.

Definition at line 54 of file tw_node.h.

Constructor & Destructor Documentation

◆ Tw_node() [1/4]

vrprouting::problem::Tw_node::Tw_node ( )
delete

Creating a Tw_node is not permitted.

◆ Tw_node() [2/4]

vrprouting::problem::Tw_node::Tw_node ( const Tw_node )
default

Copy constructor.

◆ Tw_node() [3/4]

vrprouting::problem::Tw_node::Tw_node ( size_t  id,
const PickDeliveryOrders_t data,
const NodeType type 
)

Creating a Tw_node from a postgreSQL order.

Parameters
[in]idthe internal id of the node
[in]datathe postgrSQL order information
[in]typethe kind of node to be created

Definition at line 313 of file tw_node.cpp.

316  :
317  Identifier(id, data.pick_node_id),
318  m_order(data.id),
319  m_opens(data.pick_open_t),
320  m_closes(data.pick_close_t),
322  m_demand(data.demand),
323  m_type(type) {
324  if (m_type == kDelivery) {
326  m_opens = data.deliver_open_t;
327  m_closes = data.deliver_close_t;
329  m_demand *= -1;
330  }
331  }

References PickDeliveryOrders_t::deliver_close_t, PickDeliveryOrders_t::deliver_node_id, PickDeliveryOrders_t::deliver_open_t, PickDeliveryOrders_t::deliver_service_t, vrprouting::problem::kDelivery, m_closes, m_demand, m_opens, m_service_time, m_type, and vrprouting::Identifier::reset_id().

◆ Tw_node() [4/4]

vrprouting::problem::Tw_node::Tw_node ( size_t  id,
const Vehicle_t data,
const NodeType type 
)

Creating a Tw_node from a postgreSQL vehicle.

Parameters
[in]idthe internal id of the node
[in]datathe postgrSQL vehicle information
[in]typethe kind of node to be created

Definition at line 338 of file tw_node.cpp.

341  :
342  Identifier(id, data.start_node_id),
343  m_opens(data.start_open_t),
344  m_closes(data.start_close_t),
346  m_demand(0),
347  m_type(type) {
348  if (m_type == kEnd) {
349  reset_id(data.end_node_id);
350  m_opens = data.end_open_t;
351  m_closes = data.end_close_t;
353  }
354  }

References Vehicle_t::end_close_t, Vehicle_t::end_node_id, Vehicle_t::end_open_t, Vehicle_t::end_service_t, vrprouting::problem::kEnd, m_closes, m_opens, m_service_time, m_type, and vrprouting::Identifier::reset_id().

Member Function Documentation

◆ arrival_j_closes_i()

TTimestamp vrprouting::problem::Tw_node::arrival_j_closes_i ( const Tw_node I,
Speed  speed = 1.0 
) const

arrival time at This node, when arrived at I at closing time TODO refine description

Parameters
[in]Ithe previous node before this node
[in]speed- speed used for calculation
Returns
the arrival time at this node after visiting I node when I closes

I -> this Value of TWC when arriving to this node after visiting node I at closing time

Definition at line 81 of file tw_node.cpp.

81  {
82  if (m_type == kStart) return (std::numeric_limits<TTimestamp>::max)();
83  return I.closes() + I.service_time() + I.travel_time_to(*this, I.closes() + I.service_time(), speed);
84 }

References closes(), vrprouting::problem::kStart, m_type, service_time(), and travel_time_to().

Referenced by is_partially_compatible_IJ(), and is_tight_compatible_IJ().

◆ arrival_j_opens_i()

TTimestamp vrprouting::problem::Tw_node::arrival_j_opens_i ( const Tw_node I,
Speed  speed = 1.0 
) const

arrival time at This node, when arrived at I at opening time TODO refine description

Parameters
[in]Ithe previous node before this node
[in]speed- speed used for calculation
Returns
the arrival time at this node after visiting I node when I opens

I -> this Value of TWC when arriving to this node after visiting node I at opening time

Definition at line 66 of file tw_node.cpp.

66  {
67  if (m_type == kStart) return (std::numeric_limits<TTimestamp>::max)();
68  return I.opens() + I.service_time() + I.travel_time_to(*this, I.opens() + I.service_time(), speed);
69 }

References vrprouting::problem::kStart, m_type, opens(), service_time(), and travel_time_to().

Referenced by is_compatible_IJ(), is_partially_compatible_IJ(), is_partially_waitTime_compatible_IJ(), is_tight_compatible_IJ(), and is_waitTime_compatible_IJ().

◆ closes()

TTimestamp vrprouting::problem::Tw_node::closes ( ) const
inline

Returns the closing time.

Definition at line 81 of file tw_node.h.

81 {return m_closes;}

References m_closes.

Referenced by arrival_j_closes_i(), is_delivery(), is_dump(), is_end(), is_load(), vrprouting::problem::Vehicle::is_ok(), is_pickup(), and is_start().

◆ demand() [1/2]

Amount vrprouting::problem::Tw_node::demand ( ) const
inline

Returns the demand associated with this node.

Definition at line 163 of file tw_node.h.

163 {return m_demand;}

References m_demand.

Referenced by vrprouting::problem::Vehicle_node::evaluate(), is_delivery(), is_dump(), is_end(), is_load(), is_pickup(), and is_start().

◆ demand() [2/2]

void vrprouting::problem::Tw_node::demand ( Amount  value)
inlineprotected

Sets the demand value to a new value.

Definition at line 170 of file tw_node.h.

170 {m_demand = value;}

References m_demand.

◆ id()

◆ idx()

◆ is_compatible_IJ()

bool vrprouting::problem::Tw_node::is_compatible_IJ ( const Tw_node I,
Speed  speed = 1.0 
) const

is possible to arrive to this after visiting other?

Parameters
[in]Inode visited before visiting this node
[in]speed- speed used for calculation
Returns
true when arriving this node after visiting node I does not cause a time window violation
false this node is a starting node (no node can be visited before a starting node)
false I node is an ending node (no node can be visited after an ending node)

Definition at line 94 of file tw_node.cpp.

94  {
95  /*
96  * I /-> kStart
97  */
98  if (m_type == kStart) return false;
99 
100  /*
101  * kEnd /-> (*this)
102  */
103  if (I.m_type == kEnd) return false;
104 
105  return !is_late_arrival(arrival_j_opens_i(I, speed));
106 }

References arrival_j_opens_i(), is_late_arrival(), vrprouting::problem::kEnd, vrprouting::problem::kStart, and m_type.

Referenced by vrprouting::problem::Vehicle::getPosHighLimit(), is_partially_compatible_IJ(), is_partially_waitTime_compatible_IJ(), is_tight_compatible_IJ(), vrprouting::problem::Order::is_valid(), is_waitTime_compatible_IJ(), and vrprouting::problem::Order::isCompatibleIJ().

◆ is_delivery()

bool vrprouting::problem::Tw_node::is_delivery ( ) const

Is the node a valid order's delivery node.

Returns
true when the node is a delivery node and is valid

Definition at line 210 of file tw_node.cpp.

210  {
211  return m_type == kDelivery
212  && (opens() < closes())
213  && (service_time() >= 0)
214  && (demand() < 0);
215 }

References closes(), demand(), vrprouting::problem::kDelivery, m_type, opens(), and service_time().

Referenced by vrprouting::problem::Order::is_valid(), and is_valid().

◆ is_dump()

bool vrprouting::problem::Tw_node::is_dump ( ) const

Is the node a valid vehicle's dumping node.

Returns
true when the node is a dump node and is valid

Definition at line 222 of file tw_node.cpp.

222  {
223  return m_type == kDump
224  && (opens() < closes())
225  && (service_time() >= 0)
226  && (demand() <= 0);
227 }

References closes(), demand(), vrprouting::problem::kDump, m_type, opens(), and service_time().

Referenced by vrprouting::problem::Vehicle_node::evaluate(), and is_valid().

◆ is_early_arrival()

bool vrprouting::problem::Tw_node::is_early_arrival ( TTimestamp  arrival_time) const
inline

True when arrivalTime is before it opens.

Definition at line 126 of file tw_node.h.

126  {
127  return arrival_time < m_opens;
128  }

References m_opens.

Referenced by vrprouting::problem::Vehicle_node::evaluate(), is_on_time(), is_partially_compatible_IJ(), is_partially_waitTime_compatible_IJ(), is_tight_compatible_IJ(), and is_waitTime_compatible_IJ().

◆ is_end()

bool vrprouting::problem::Tw_node::is_end ( ) const

Is the node a valid vehicle's ending node.

Returns
true when the node is an end node and is valid

Definition at line 245 of file tw_node.cpp.

245  {
246  return m_type == kEnd
247  && (opens() < closes())
248  && (service_time() >= 0)
249  && (demand() == 0);
250 }

References closes(), demand(), vrprouting::problem::kEnd, m_type, opens(), and service_time().

Referenced by vrprouting::problem::Fleet::add_vehicle(), vrprouting::problem::Vehicle::erase(), vrprouting::problem::Vehicle_node::has_cv(), and is_valid().

◆ is_late_arrival()

bool vrprouting::problem::Tw_node::is_late_arrival ( TTimestamp  arrival_time) const
inline

True when arrivalTime is after it closes.

Definition at line 121 of file tw_node.h.

121  {
122  return arrival_time > m_closes;
123  }

References m_closes.

Referenced by vrprouting::problem::Vehicle_node::deltaGeneratesTWV(), vrprouting::problem::Vehicle_node::has_twv(), is_compatible_IJ(), is_on_time(), is_partially_compatible_IJ(), and is_tight_compatible_IJ().

◆ is_load()

bool vrprouting::problem::Tw_node::is_load ( ) const

Is the node a valid vehicle's loading node.

Returns
true when the node is a load node and is valid

Definition at line 234 of file tw_node.cpp.

234  {
235  return m_type == kLoad
236  && (opens() < closes())
237  && (service_time() >= 0)
238  && (demand() >= 0);
239 }

References closes(), demand(), vrprouting::problem::kLoad, m_type, opens(), and service_time().

Referenced by is_valid().

◆ is_on_time()

bool vrprouting::problem::Tw_node::is_on_time ( TTimestamp  arrival_time) const
inline

True when arrivalTime in the time window.

Definition at line 131 of file tw_node.h.

131  {
132  return !is_early_arrival(arrival_time)
133  && !is_late_arrival(arrival_time);
134  }

References is_early_arrival(), and is_late_arrival().

◆ is_partially_compatible_IJ()

bool vrprouting::problem::Tw_node::is_partially_compatible_IJ ( const Tw_node I,
Speed  speed = 1.0 
) const

can arrive to this after visiting as late as possible I? TODO refine description

Parameters
[in]Inode visited before visiting this node
[in]speed- speed used for calculation
Returns
true when TODO TBD
false this node is TODO TBD
false I node is TODO TBD

Definition at line 116 of file tw_node.cpp.

116  {
117  return
118  is_compatible_IJ(I, speed)
119  && !is_early_arrival(arrival_j_opens_i(I, speed))
120  && is_late_arrival(arrival_j_closes_i(I, speed));
121 }

References arrival_j_closes_i(), arrival_j_opens_i(), is_compatible_IJ(), is_early_arrival(), and is_late_arrival().

◆ is_partially_waitTime_compatible_IJ()

bool vrprouting::problem::Tw_node::is_partially_waitTime_compatible_IJ ( const Tw_node I,
Speed  speed = 1.0 
) const

can arrive to this after visiting as late as possible I? TODO refine description

Parameters
[in]Inode visited before visiting this node
[in]speed- speed used for calculation
Returns
true when TODO TBD
false this node is TODO TBD
false I node is TODO TBD

Definition at line 146 of file tw_node.cpp.

148  {
149  return
150  is_compatible_IJ(I, speed)
151  && is_early_arrival(arrival_j_opens_i(I, speed));
152 }

References arrival_j_opens_i(), is_compatible_IJ(), and is_early_arrival().

◆ is_pickup()

bool vrprouting::problem::Tw_node::is_pickup ( ) const

Is the node a valid order's pickup node.

Returns
true when the node is a pickup node and is valid

Definition at line 199 of file tw_node.cpp.

199  {
200  return m_type == kPickup
201  && (opens() < closes())
202  && (service_time() >= 0)
203  && (demand() > 0);
204 }

References closes(), demand(), vrprouting::problem::kPickup, m_type, opens(), and service_time().

Referenced by vrprouting::problem::Order::is_valid(), and is_valid().

◆ is_start()

bool vrprouting::problem::Tw_node::is_start ( ) const

Is the node a valid vehicle's starting node.

Returns
true when the node is a starting node and is valid

Definition at line 187 of file tw_node.cpp.

187  {
188  return
189  m_type == kStart
190  && (opens() < closes())
191  && (service_time() >= 0)
192  && (demand() == 0);
193 }

References closes(), demand(), vrprouting::problem::kStart, m_type, opens(), and service_time().

Referenced by vrprouting::problem::Vehicle::erase(), vrprouting::problem::Vehicle_node::evaluate(), vrprouting::problem::Vehicle_node::has_cv(), and is_valid().

◆ is_tight_compatible_IJ()

bool vrprouting::problem::Tw_node::is_tight_compatible_IJ ( const Tw_node I,
Speed  speed = 1.0 
) const

can arrive to this after visiting as late as possible I? TODO refine description

Parameters
[in]Inode visited before visiting this node
[in]speed- speed used for calculation
Returns
true when TODO TBD
false this node is TODO TBD
false I node is TODO TBD

Definition at line 131 of file tw_node.cpp.

131  {
132  return
133  is_compatible_IJ(I, speed)
134  && !is_early_arrival(arrival_j_opens_i(I, speed))
135  && !is_late_arrival(arrival_j_closes_i(I, speed));
136 }

References arrival_j_closes_i(), arrival_j_opens_i(), is_compatible_IJ(), is_early_arrival(), and is_late_arrival().

◆ is_valid()

bool vrprouting::problem::Tw_node::is_valid ( ) const

is the node valid?

Returns
true when the node depending on the kind is a valid node

Definition at line 274 of file tw_node.cpp.

274  {
275  switch (type()) {
276  case kStart:
277  return is_start();
278  break;
279 
280  case kEnd:
281  return is_end();
282  break;
283 
284  case kDump:
285  return is_dump();
286  break;
287 
288  case kDelivery:
289  return is_delivery();
290  break;
291 
292  case kPickup:
293  return is_pickup();
294  break;
295 
296  case kLoad:
297  return is_load();
298  break;
299 
300  default:
301  return false;
302  break;
303  }
304 
305  return false;
306 }

References is_delivery(), is_dump(), is_end(), is_load(), is_pickup(), is_start(), vrprouting::problem::kDelivery, vrprouting::problem::kDump, vrprouting::problem::kEnd, vrprouting::problem::kLoad, vrprouting::problem::kPickup, vrprouting::problem::kStart, and type().

◆ is_waitTime_compatible_IJ()

bool vrprouting::problem::Tw_node::is_waitTime_compatible_IJ ( const Tw_node I,
Speed  speed = 1.0 
) const

can arrive to this after visiting as late as possible I? TODO refine description

Parameters
[in]Inode visited before visiting this node
[in]speed- speed used for calculation
Returns
true when TODO TBD
false this node is TODO TBD
false I node is TODO TBD

Definition at line 162 of file tw_node.cpp.

162  {
163  return
164  is_compatible_IJ(I, speed)
165  && is_early_arrival(arrival_j_opens_i(I, speed));
166 }

References arrival_j_opens_i(), is_compatible_IJ(), and is_early_arrival().

◆ opens()

TTimestamp vrprouting::problem::Tw_node::opens ( ) const
inline

◆ operator==()

bool vrprouting::problem::Tw_node::operator== ( const Tw_node other) const

equality operator

Returns
true when the other node is the same as this node
Parameters
[in]other

Definition at line 258 of file tw_node.cpp.

258  {
259  if (&other == this) return true;
260  return m_order == other.m_order
261  && m_opens == other.m_opens
262  && m_closes == other.m_closes
263  && m_service_time == other.m_service_time
264  && m_demand == other.m_demand
265  && m_type == other.m_type
266  && id() == other.id()
267  && idx() == other.idx();
268 }

References vrprouting::Identifier::id(), vrprouting::Identifier::idx(), m_closes, m_demand, m_opens, m_order, m_service_time, and m_type.

◆ order()

int64_t vrprouting::problem::Tw_node::order ( ) const
inline

Returns the order to which it belongs.

Definition at line 75 of file tw_node.h.

75 {return m_order;}

References m_order.

Referenced by vrprouting::problem::Vehicle_node::get_postgres_result().

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

◆ service_time()

TInterval vrprouting::problem::Tw_node::service_time ( ) const
inline

◆ travel_time_to()

TInterval vrprouting::problem::Tw_node::travel_time_to ( const Tw_node other,
TTimestamp  time,
Speed  speed = 1.0 
) const

travel time to other node.

Parameters
[in]other- pointer to the other Tw_node
[in]time- time of departure from previous node
[in]speed- speed used for calculation
Returns
the travel time from this to other]

Definition at line 51 of file tw_node.cpp.

51  {
52  pgassert(speed != 0);
53  return static_cast<TInterval>(static_cast<Speed>(m_time_matrix_ptr->travel_time(id(), other.id(), time)) / speed);
54 }

References vrprouting::Identifier::id(), m_time_matrix_ptr, pgassert, and vrprouting::problem::Matrix::travel_time().

Referenced by arrival_j_closes_i(), arrival_j_opens_i(), and vrprouting::problem::Vehicle_node::evaluate().

◆ type()

auto vrprouting::problem::Tw_node::type ( ) const
inline

Returns the type of this node.

Definition at line 87 of file tw_node.h.

87 {return m_type;}

References m_type.

Referenced by vrprouting::problem::Vehicle_node::get_postgres_result(), is_valid(), and type_str().

◆ type_str()

std::string vrprouting::problem::Tw_node::type_str ( ) const

returns a string code of the kind of node

Returns
the short hand of the kind of node

Definition at line 171 of file tw_node.cpp.

171  {
172  switch (type()) {
173  case kStart: return "S";
174  case kEnd: return "E";
175  case kDump: return "D";
176  case kLoad: return "L";
177  case kPickup: return "P";
178  case kDelivery: return "D";
179  default: return "UNKNOWN";
180  }
181 }

References vrprouting::problem::kDelivery, vrprouting::problem::kDump, vrprouting::problem::kEnd, vrprouting::problem::kLoad, vrprouting::problem::kPickup, vrprouting::problem::kStart, and type().

Referenced by vrprouting::problem::operator<<().

◆ window_length()

TInterval vrprouting::problem::Tw_node::window_length ( ) const
inline

Returns the length of time between the opening and closing.

Definition at line 90 of file tw_node.h.

90 {return m_closes - m_opens;}

References m_closes, and m_opens.

Friends And Related Function Documentation

◆ operator<<

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

Print the contents of a Twnode object.

Returns
the printed information of the node
Parameters
[in]log
[in]n

Definition at line 362 of file tw_node.cpp.

362  {
363  log << n.id()
364  << "[opens = " << n.m_opens
365  << "\tcloses = " << n.m_closes
366  << "\tservice = " << n.m_service_time
367  << "\tdemand = " << n.m_demand
368  << "\ttype = " << n.type_str()
369  << "]"
370  << "\n";
371  return log;
372 }

Member Data Documentation

◆ m_closes

TTimestamp vrprouting::problem::Tw_node::m_closes
private

closing time of the node

Definition at line 180 of file tw_node.h.

Referenced by closes(), is_late_arrival(), vrprouting::problem::operator<<(), operator==(), Tw_node(), and window_length().

◆ m_demand

Amount vrprouting::problem::Tw_node::m_demand
private

The demand for the Node.

Definition at line 186 of file tw_node.h.

Referenced by demand(), vrprouting::problem::operator<<(), operator==(), and Tw_node().

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

TTimestamp vrprouting::problem::Tw_node::m_opens
private

opening time of the node

Definition at line 177 of file tw_node.h.

Referenced by is_early_arrival(), opens(), vrprouting::problem::operator<<(), operator==(), Tw_node(), and window_length().

◆ m_order

int64_t vrprouting::problem::Tw_node::m_order { }
private

order to which it belongs (idx)

Definition at line 174 of file tw_node.h.

Referenced by operator==(), and order().

◆ m_service_time

TInterval vrprouting::problem::Tw_node::m_service_time
private

time it takes to be served

Definition at line 183 of file tw_node.h.

Referenced by vrprouting::problem::operator<<(), operator==(), service_time(), and Tw_node().

◆ m_time_matrix_ptr

const Matrix * vrprouting::problem::Tw_node::m_time_matrix_ptr = nullptr
static

Definition at line 139 of file tw_node.h.

Referenced by vrprouting::problem::Orders::Orders(), and travel_time_to().

◆ m_type

NodeType vrprouting::problem::Tw_node::m_type
private

The documentation for this class was generated from the following files:
PickDeliveryOrders_t::deliver_node_id
Id deliver_node_id
Deliver y coordinate: used in stand alone program for benchmarks.
Definition: pickDeliveryOrders_t.h:72
vrprouting::problem::Matrix::travel_time
TInterval travel_time(Id, Id, TTimestamp) const
retrun the travel time times when using the time dependant multipliers
Definition: matrix.cpp:233
vrprouting::problem::kDump
@ kDump
dump site, empties truck
Definition: node_types.h:39
vrprouting::problem::Tw_node::m_order
int64_t m_order
order to which it belongs (idx)
Definition: tw_node.h:174
Vehicle_t::start_node_id
Id start_node_id
Stops size.
Definition: vehicle_t.h:58
vrprouting::problem::Tw_node::is_delivery
bool is_delivery() const
Is the node a valid order's delivery node.
Definition: tw_node.cpp:210
vrprouting::problem::Tw_node::arrival_j_opens_i
TTimestamp arrival_j_opens_i(const Tw_node &I, Speed=1.0) const
arrival time at This node, when arrived at I at opening time TODO refine description
Definition: tw_node.cpp:66
vrprouting::Identifier::Identifier
Identifier()=default
vrprouting::problem::Tw_node::m_closes
TTimestamp m_closes
closing time of the node
Definition: tw_node.h:180
Vehicle_t::end_node_id
Id end_node_id
Definition: vehicle_t.h:65
vrprouting::Identifier::id
int64_t id() const
get the original id
Definition: identifier.cpp:42
vrprouting::problem::kStart
@ kStart
starting site
Definition: node_types.h:36
vrprouting::Identifier::m_id
int64_t m_id
Definition: identifier.h:87
vrprouting::problem::Tw_node::demand
Amount demand() const
Returns the demand associated with this node.
Definition: tw_node.h:163
vrprouting::problem::Tw_node::closes
TTimestamp closes() const
Returns the closing time.
Definition: tw_node.h:81
PickDeliveryOrders_t::deliver_close_t
TTimestamp deliver_close_t
Deliver open time.
Definition: pickDeliveryOrders_t.h:75
vrprouting::Identifier::m_idx
size_t m_idx
Definition: identifier.h:86
vrprouting::problem::kDelivery
@ kDelivery
delivery site
Definition: node_types.h:38
Vehicle_t::start_open_t
TTimestamp start_open_t
Start node's identifier.
Definition: vehicle_t.h:59
pgassert
#define pgassert(expr)
Uses the standard assert syntax.
Definition: pgr_assert.h:95
vrprouting::problem::Tw_node::service_time
TInterval service_time() const
Returns the service time for this node.
Definition: tw_node.h:84
vrprouting::problem::Tw_node::is_dump
bool is_dump() const
Is the node a valid vehicle's dumping node.
Definition: tw_node.cpp:222
Vehicle_t::end_open_t
TTimestamp end_open_t
End node's identifier.
Definition: vehicle_t.h:66
vrprouting::problem::Tw_node::type
auto type() const
Returns the type of this node.
Definition: tw_node.h:87
Speed
double Speed
Definition: typedefs.h:76
vrprouting::problem::Tw_node::is_late_arrival
bool is_late_arrival(TTimestamp arrival_time) const
True when arrivalTime is after it closes.
Definition: tw_node.h:121
PickDeliveryOrders_t::id
Id id
Definition: pickDeliveryOrders_t.h:59
PickDeliveryOrders_t::pick_node_id
Id pick_node_id
Pick y coordinate: used in stand alone program for benchmarks.
Definition: pickDeliveryOrders_t.h:64
PickDeliveryOrders_t::pick_open_t
TTimestamp pick_open_t
Pickup node identifier.
Definition: pickDeliveryOrders_t.h:66
vrprouting::problem::kLoad
@ kLoad
load site, fills the truck
Definition: node_types.h:40
vrprouting::Identifier::idx
size_t idx() const
get the internal index
Definition: identifier.cpp:37
vrprouting::problem::Tw_node::is_pickup
bool is_pickup() const
Is the node a valid order's pickup node.
Definition: tw_node.cpp:199
vrprouting::problem::Tw_node::is_compatible_IJ
bool is_compatible_IJ(const Tw_node &I, Speed=1.0) const
is possible to arrive to this after visiting other?
Definition: tw_node.cpp:94
Vehicle_t::start_close_t
TTimestamp start_close_t
Start open time.
Definition: vehicle_t.h:60
vrprouting::problem::kPickup
@ kPickup
pickup site
Definition: node_types.h:37
vrprouting::problem::kEnd
@ kEnd
ending site
Definition: node_types.h:41
vrprouting::problem::Tw_node::m_demand
Amount m_demand
The demand for the Node.
Definition: tw_node.h:186
PickDeliveryOrders_t::pick_service_t
TInterval pick_service_t
Pickup close time.
Definition: pickDeliveryOrders_t.h:68
PickDeliveryOrders_t::deliver_open_t
TTimestamp deliver_open_t
Deliver node identifier.
Definition: pickDeliveryOrders_t.h:74
PickDeliveryOrders_t::deliver_service_t
TInterval deliver_service_t
Deliver close time.
Definition: pickDeliveryOrders_t.h:76
vrprouting::problem::Tw_node::arrival_j_closes_i
TTimestamp arrival_j_closes_i(const Tw_node &I, Speed=1.0) const
arrival time at This node, when arrived at I at closing time TODO refine description
Definition: tw_node.cpp:81
vrprouting::problem::Tw_node::is_end
bool is_end() const
Is the node a valid vehicle's ending node.
Definition: tw_node.cpp:245
Vehicle_t::end_close_t
TTimestamp end_close_t
End open time.
Definition: vehicle_t.h:67
PickDeliveryOrders_t::pick_close_t
TTimestamp pick_close_t
Pickup open time.
Definition: pickDeliveryOrders_t.h:67
TInterval
int64_t TInterval
Definition: typedefs.h:72
vrprouting::problem::Tw_node::m_time_matrix_ptr
static const Matrix * m_time_matrix_ptr
Definition: tw_node.h:139
vrprouting::problem::Tw_node::m_service_time
TInterval m_service_time
time it takes to be served
Definition: tw_node.h:183
vrprouting::problem::Tw_node::is_load
bool is_load() const
Is the node a valid vehicle's loading node.
Definition: tw_node.cpp:234
vrprouting::problem::Tw_node::is_early_arrival
bool is_early_arrival(TTimestamp arrival_time) const
True when arrivalTime is before it opens.
Definition: tw_node.h:126
vrprouting::problem::Tw_node::opens
TTimestamp opens() const
Returns the opening time.
Definition: tw_node.h:78
Vehicle_t::end_service_t
TInterval end_service_t
End close time.
Definition: vehicle_t.h:68
Vehicle_t::start_service_t
TInterval start_service_t
Start close time.
Definition: vehicle_t.h:61
vrprouting::Identifier::reset_id
void reset_id(int64_t)
change the original id
Definition: identifier.cpp:47
vrprouting::problem::Tw_node::is_start
bool is_start() const
Is the node a valid vehicle's starting node.
Definition: tw_node.cpp:187
vrprouting::problem::Tw_node::m_type
NodeType m_type
The kind of Node.
Definition: tw_node.h:189
PickDeliveryOrders_t::demand
PAmount demand
Order's identifier.
Definition: pickDeliveryOrders_t.h:60
vrprouting::problem::Tw_node::m_opens
TTimestamp m_opens
opening time of the node
Definition: tw_node.h:177