Search for content

Trip Sections and Position in Trips

Trip section numbers and positions in trips are tools for the user to specify positions of stops at customer locations within a trip.

Scenarios trip sections

Which scenarios can be modelled by trip section numbers?

  • Some customers are promised to be visited early in the trip, e.g.:
    • Set tripSectionNumber of customer locations that have to be visited early to 1.
    • Set tripSectionNumber of all other customer locations to 2.
  • The planner wants deliveries at customer locations to be before pickups at customer locations, e.g.:
    • Set tripSectionNumber of customer locations for delivery to 1.
    • Set tripSectionNumber of customer locations for pickup to 2.
    • You may have to duplicate a customer location if it is used both, for pickup and delivery.
  • Some stops may be added to a given route. They may be added only at the end of a route, e.g.:
    • Set tripSectionNumber of customer locations of a given route to 1.
    • Set tripSectionNumber of customer locations that have to be added to 2.

Scenarios position in trips

Which scenarios can be modelled by position in trips?

  • A certain extraordinary customer location must be the first customer of a trip:
    • Set positionInTrip of this customer location to FIRST_CUSTOMER_STOP*.
  • A certain extraordinary customer location must be the last customer of a trip:
    • Set positionInTrip of this customer location to LAST_CUSTOMER_STOP**.

 

*FIRST_CUSTOMER_STOP: A stop at a customer location with this position type has to be the very first customer stop in its trip.

**LAST_CUSTOMER_STOP: A stop at a customer location with this position type has to be the very last customer stop in its trip.

Influence sequence of customer stops

How can the sequence of customer stops within a trip be influenced?

  • A stop at a customer location with a specific tripSectionNumber will always be after other stops with a specific lower tripSectionNumber, within the same trip.
  • A stop at a customer location with a specific tripSectionNumber will always be before other stops with a specific higher tripSectionNumber, within the same trip.
  • A stop at a customer location with a positionInTrip of type FIRST_CUSTOMER_STOP will always be the very first customer stop in its trip.
  • A stop at a customer location with a positionInTrip of type LAST_CUSTOMER_STOP will always be the very last customer stop in its trip.

Notes: Trip section numbers and position in trips cannot be set both at the same stop of a customer location. 
It is valid to set none of the two values. In this case, no particular restriction concerning its customer stop position is implied by this location.

Examples

The following examples show valid or invalid positions of customer stops within a trip in different scenarios.
 

Example for valid positions of customer stops within a trip

 valid positions of customer stops

Valid positions of customer stops are:

  • Customer locations with specified tripSectionNumber must have a non-decreasing trip section number within a trip.
  • Customer locations with specified tripSectionNumber can be equal within a trip, for example, tripSectionNumber 1 ➞ tripSectionNumber 1 is permissible.
  • Customer locations with specified tripSectionNumber do not have to be subsequent within a trip, for example, tripSectionNumber 1 ➞ tripSectionNumber 5 is permissible.
  • A customer location with a specified position in a trip of type FIRST_CUSTOMER_STOP has to be the very first customer stop within the trip. However, depot stop(s) can precede within the same trip.

Note: Customer locations without specified tripSectionNumber are not considered for the trip section restriction.

Example for valid positions of customer stops within each trip of a multi-trip scenario

valid positions of customer stops multi-trip

Valid positions of customer stops are:

  • The tripSectionNumber and positionInTrip restrictions consider each trip separately, even if there are multiple trips in one route (see also Routes and Trips):
    • A trip can have a stop at a customer location with a lower tripSectionNumber than a previous stop in a previous trip, for example, tripSectionNumber 5 in trip "A"➞...➞ tripSectionNumber 1 in trip "B" is permissible.
    • A stop at a customer location with positionInTrip of type LAST_CUSTOMER_STOP can be the last customer stop of the trip without being the last customer stop of the route (analogously to the case FIRST_CUSTOMER_STOP).
  • Customer locations with the same tripSectionNumber can be in different trips, for example, tripSectionNumber 1 is valid in trip "A" and trip "B.

Example for invalid trip sections within a trip

invalid trip sections within a trip

Invalid positions of customer stops are:

  • A customer location has a lower specified tripSectionNumber than the customer location of a previous stop within the same trip, for example, tripSectionNumber 5 ➞ tripSectionNumber 1 is not permitted.

 

Example for invalid first position of customer stop within a trip

invalid first position of customer stop within a trip

 

Invalid positions of customer stops are:

  • A customer location with a specified positionInTrip of type FIRST_CUSTOMER_STOP is not the very first customer stop in its trip.
    A customer location with positionInTrip of type FIRST_CUSTOMER_STOP must be the very first customer stop of the trip. A customer stop before a customer stops with positionInTrip of type FIRST_CUSTOMER_STOP within the same trip is not allowed, no matter what attributes the previous stop has.
     

Notes: This also applies if neither a tripSectionNumber nor a positionInTrip is defined. This holds analogously for the type LAST_CUSTOMER_STOP.

Example for invalid last position of customer stop within a trip

invalid last position of customer stop within a trip

Invalid positions of customer stops are:

  • A customer location with a specified positionInTrip of type LAST_CUSTOMER_STOP is not the very last customer stop in its trip.
    A customer location with positionInTrip of type LAST_CUSTOMER_STOP must be the very last customer stop of the trip. A customer stop after a customer stops with positionInTrip of type LAST_CUSTOMER_STOP within the same trip is not allowed, no matter which attributes the next stop has.

Notes: This also applies if the positionInTrip is also of type LAST_CUSTOMER_STOP. This holds analogously for the type FIRST_CUSTOMER_STOP.