Maps SDK for C++ 1.0.0
Loading...
Searching...
No Matches
gem::vrp::RouteOrder Class Reference

Defines an order that was visited. More...

Inheritance diagram for gem::vrp::RouteOrder:
Collaboration diagram for gem::vrp::RouteOrder:

Public Member Functions

 RouteOrder (const Customer &customer)
 Constructs a RouteOrder object initialized with Customer information.
 RouteOrder (const RouteOrder &)=default
 Default copy constructor.
 RouteOrder (RouteOrder &&) noexcept=default
 Default move constructor noexcept is deduced.
RouteOrder & operator= (const RouteOrder &)=default
 Default copy assignment operator.
RouteOrder & operator= (RouteOrder &&) noexcept=default
 Default move assignment operator.
bool operator== (RouteOrder const &order) const
 Compares two RouteOrder objects for equality.
bool operator!= (RouteOrder const &order) const
 Compares two RouteOrder objects for equality.
const CoordinatesRef getMatchedCoordinates () const noexcept
 Retrieves the matched coordinates of the route order.
const CoordinatesRef getActualCoordinates () const noexcept
 Retrieves the actual coordinates of the driver.
unsigned int getIndexInRoute () const noexcept
 Get the index of the order in the route's orders list (the visiting order).
RouteOrder & setIndexInRoute (unsigned int indexInRoute) noexcept
 Set the index of the order in the route's orders list (the visiting order).
unsigned int getIndexInOptimization () const noexcept
 Get the index of the order in the optimization orders list.
const TimeRef getArrivalTime () const noexcept
 Get the vehicle arrival time at this order.
unsigned int getTimeToNextOrder () const noexcept
 Get the duration (in seconds) between the current order and the next one.
unsigned int getWaitTime () const noexcept
 Get the amount of time (in seconds) that the vehicle has to wait at the current order, in order to arrive at the next order between its time window.
int getNumberOfPackagesAtArrival () const noexcept
 Get the total collected packages until this order.
int getCollectedNumberOfPackages () const noexcept
 Get the number of packages collected at this order.
int getDeliveredNumberOfPackages () const noexcept
 Get the number of packages delivered at this order.
float getWeightAtArrival () const noexcept
 Get the total collected weight until this order.
float getCollectedWeight () const noexcept
 Get the weight collected at this order.
float getDeliveredWeight () const noexcept
 Get the weight delivered at this order.
float getCubeAtArrival () const noexcept
 Get the total collected cube until this order.
float getCollectedCube () const noexcept
 Get the cube collected at this order.
float getDeliveredCube () const noexcept
 Get the cube delivered at this order.
float getTraveledDistance () const noexcept
 Get the vehicle traveled distance until this order in the unit distance set in the ConfigurationParameters.
float getDistanceToNextOrder () const noexcept
 Get the distance between this order and the next one in the unit distance set in the ConfigurationParameters.
float getRevenueAtArrival () const noexcept
 Get the revenue collected until this order.
const TimeRef getVisitTime () const noexcept
 Get the time when the order was visited.
bool operator== (Order const &order) const
 Compares two Order objects for equality.
bool operator!= (Order const &order) const
 Compares two Order objects for equality.
LargeInteger getId () const noexcept
 Get the id of the order.
const CoordinatesRef getCoordinates () const noexcept
 Retrieves the coordinates of the order.
CoordinatesRef getCoordinates ()
 Provides direct access to modify the coordinates of the order.
OrdersetCoordinates (const Coordinates &coords) noexcept
 Set the coordinates of the order.
const StringRef getAlias () const noexcept
 Retrieves the alias of this order.
OrdersetAlias (const String &alias) noexcept
 Sets the alias for this order.
const StringRef getFirstName () const noexcept
 Retrieves the first name of the owner of the order.
OrdersetFirstName (const String &firstName) noexcept
 Sets the fist name of the owner of the order.
const StringRef getLastName () const noexcept
 Retrieves the last name of the owner of the order.
OrdersetLastName (const String &lastName) noexcept
 Sets the last name of the owner of the order.
const AddressInfoRef getAddress () const noexcept
 Retrieves the address associated with the order.
OrdersetAddress (const AddressInfo &address) noexcept
 Sets the address for the order's location.
const StringRef getPhoneNumber () const noexcept
 Retrieves the phone number of the owner of the order.
OrdersetPhoneNumber (const String &phoneNumber) noexcept
 Sets the phone number of the owner of the order, which the driver will use to contact him.
const CustomDataListRef getCustomData () const noexcept
 Get the custom data of the order.
OrdersetCustomData (const CustomDataList &list) noexcept
 Set the order's custom data.
unsigned int getNumberOfPackages () const noexcept
 Get the number of packages which has to be delivered at order or picked-up from the order depending on the order's type.
OrdersetNumberOfPackages (unsigned int numberOfPackages) noexcept
 Set the number of packages which has to be delivered at this order or picked-up from this order depending on the order's type.
float getWeight () const noexcept
 Get the weight which has to be delivered at order or picked-up from the order depending on the order's type.
OrdersetWeight (float weightKg) noexcept
 Set the weight which has to be delivered at order or picked-up from the order depending on the order's type.
float getCube () const noexcept
 Get the cube which has to be delivered at order or picked-up from the order depending on the order's type.
OrdersetCube (float cube) noexcept
 Set the cube which has to be delivered at order or picked-up from the order depending on the order's type.
std::pair< int, int > getTimeWindow () const noexcept
 Get the time window within which the order must be visited.
OrdersetTimeWindow (std::pair< int, int > timeWindowInMinutes) noexcept
 Set the time window within which the order must be visited.
unsigned int getServiceTime () const noexcept
 Get the amount of time (in seconds) that the vehicle has to stay at the current order (to load/unload the goods).
OrdersetServiceTime (unsigned int serviceTimeSeconds) noexcept
 Set the amount of time (in seconds) that the vehicle has to stay at the current order (to load/unload the goods).
EOrderType getType () const noexcept
 Get the order’s type.
OrdersetType (EOrderType orderType) noexcept
 Set the order’s type.
EOrderStatus getStatus () const noexcept
 Get the order’s status.
EOrderState getState () const noexcept
 Get the order’s state.
EOrderPriority getPriority () const noexcept
 Get the order’s priority.
OrdersetPriority (EOrderPriority orderPriority) noexcept
 Set the order’s priority.
float getRevenue () const noexcept
 Get the revenue which has to be received from the order.
OrdersetRevenue (float revenue) noexcept
 Set the revenue which has to be received from the order.
const TimeRef getCreationTime () const noexcept
 Get the date and time when the order was saved.
const CustomerRef getCustomer () const noexcept
 Get the Customer of the order.
OrdersetCustomer (const Customer &customer) noexcept
 Set the Customer of the order.
LargeInteger getDepotId () const noexcept
 Get the id of the depot(MiscLocation) where to which the order belongs.
OrdersetDepotId (LargeInteger depotId) noexcept
 Set the id of the depot where to which the order belongs.

Detailed Description

Defines an order that was visited.

It is a part of a resulted route, after the optimization of the problem.

Defines a route order. Implements share-read / copy-on-write Api object over IRouteOrder.

Constructor & Destructor Documentation

◆ RouteOrder()

gem::vrp::RouteOrder::RouteOrder ( const Customer & customer)
inline

Constructs a RouteOrder object initialized with Customer information.

Parameters
customerA Customer object containing the initial values for the order's coordinates, alias, first name, last name, phone number and address.

Member Function Documentation

◆ getActualCoordinates()

const CoordinatesRef gem::vrp::RouteOrder::getActualCoordinates ( ) const
inlinenoexcept

Retrieves the actual coordinates of the driver.

These coordinates represent the actual location of the order.

Returns
A constant reference to the Coordinates object representing the driver's location.

◆ getAddress()

const AddressInfoRef gem::vrp::Order::getAddress ( ) const
inlinenoexceptinherited

Retrieves the address associated with the order.

This address provides a human-readable location for the order's location, complementing the coordinates.

Returns
A constant reference to the AddressInfo object representing the order address.

◆ getAlias()

const StringRef gem::vrp::Order::getAlias ( ) const
inlinenoexceptinherited

Retrieves the alias of this order.

Returns
The alias as a StringRef.

◆ getArrivalTime()

const TimeRef gem::vrp::RouteOrder::getArrivalTime ( ) const
inlinenoexcept

Get the vehicle arrival time at this order.

Returns
Vehicle's expected arrival time at this order, as a TimeRef.

◆ getCollectedCube()

float gem::vrp::RouteOrder::getCollectedCube ( ) const
inlinenoexcept

Get the cube collected at this order.

Returns
The cubic volume of the packages collected from this order

◆ getCollectedNumberOfPackages()

int gem::vrp::RouteOrder::getCollectedNumberOfPackages ( ) const
inlinenoexcept

Get the number of packages collected at this order.

Returns
The number of packages collected from this order

◆ getCollectedWeight()

float gem::vrp::RouteOrder::getCollectedWeight ( ) const
inlinenoexcept

Get the weight collected at this order.

Returns
The weight of the packages collected from this order

◆ getCoordinates() [1/2]

CoordinatesRef gem::vrp::Order::getCoordinates ( )
inlineinherited

Provides direct access to modify the coordinates of the order.

This allows for setting or updating the geographical location of the order.

Returns
A reference to the Coordinates object for modification.

◆ getCoordinates() [2/2]

const CoordinatesRef gem::vrp::Order::getCoordinates ( ) const
inlinenoexceptinherited

Retrieves the coordinates of the order.

These coordinates represent the geographical location of the order.

Returns
A constant reference to the Coordinates object representing the order's location.

◆ getCreationTime()

const TimeRef gem::vrp::Order::getCreationTime ( ) const
inlinenoexceptinherited

Get the date and time when the order was saved.

Returns
The moment when the order was created, as a TimeRef reference.

◆ getCube()

float gem::vrp::Order::getCube ( ) const
inlinenoexceptinherited

Get the cube which has to be delivered at order or picked-up from the order depending on the order's type.

Returns
The total cubic volume of the packages picked up/delivered from this order.
See also
EOrderType

◆ getCubeAtArrival()

float gem::vrp::RouteOrder::getCubeAtArrival ( ) const
inlinenoexcept

Get the total collected cube until this order.

Returns
The total cubic volume of the vehicle's load in kg.

◆ getCustomData()

const CustomDataListRef gem::vrp::Order::getCustomData ( ) const
inlinenoexceptinherited

Get the custom data of the order.

Returns
a list of CustomData objects.

◆ getCustomer()

const CustomerRef gem::vrp::Order::getCustomer ( ) const
inlinenoexceptinherited

Get the Customer of the order.

Returns
The customer to which this order belongs as a reference to the Customer object.

◆ getDeliveredCube()

float gem::vrp::RouteOrder::getDeliveredCube ( ) const
inlinenoexcept

Get the cube delivered at this order.

Returns
The cubic volume of the packages delivered at this order.

◆ getDeliveredNumberOfPackages()

int gem::vrp::RouteOrder::getDeliveredNumberOfPackages ( ) const
inlinenoexcept

Get the number of packages delivered at this order.

Returns
The number of packages delivered at this order.

◆ getDeliveredWeight()

float gem::vrp::RouteOrder::getDeliveredWeight ( ) const
inlinenoexcept

Get the weight delivered at this order.

Returns
The weight of the packages delivered at this order.

◆ getDepotId()

LargeInteger gem::vrp::Order::getDepotId ( ) const
inlinenoexceptinherited

Get the id of the depot(MiscLocation) where to which the order belongs.

Returns
The depot id (from MiscLocation) to which this order belongs
See also
MiscLocation

◆ getDistanceToNextOrder()

float gem::vrp::RouteOrder::getDistanceToNextOrder ( ) const
inlinenoexcept

Get the distance between this order and the next one in the unit distance set in the ConfigurationParameters.

Returns
The distance until the next order

◆ getFirstName()

const StringRef gem::vrp::Order::getFirstName ( ) const
inlinenoexceptinherited

Retrieves the first name of the owner of the order.

Returns
The first name as a StringRef.

◆ getId()

LargeInteger gem::vrp::Order::getId ( ) const
inlinenoexceptinherited

Get the id of the order.

It is a unique identifier of the order and it is used for update or delete.

Returns
The id of the order as LargeInteger

◆ getIndexInOptimization()

unsigned int gem::vrp::RouteOrder::getIndexInOptimization ( ) const
inlinenoexcept

Get the index of the order in the optimization orders list.

Returns
The order's index in the optimization's orders list as unsigned int

◆ getIndexInRoute()

unsigned int gem::vrp::RouteOrder::getIndexInRoute ( ) const
inlinenoexcept

Get the index of the order in the route's orders list (the visiting order).

Returns
The order's visit index in the route as unsigned int.

◆ getLastName()

const StringRef gem::vrp::Order::getLastName ( ) const
inlinenoexceptinherited

Retrieves the last name of the owner of the order.

Returns
The last name as a StringRef.

◆ getMatchedCoordinates()

const CoordinatesRef gem::vrp::RouteOrder::getMatchedCoordinates ( ) const
inlinenoexcept

Retrieves the matched coordinates of the route order.

These coordinates represent the geographical matched location of the order.

Returns
A constant reference to the Coordinates object representing the order's location.

◆ getNumberOfPackages()

unsigned int gem::vrp::Order::getNumberOfPackages ( ) const
inlinenoexceptinherited

Get the number of packages which has to be delivered at order or picked-up from the order depending on the order's type.

The default value is 0.

Returns
The number of packages to be pickup/delivered as unsigned int.
See also
EOrderType.

◆ getNumberOfPackagesAtArrival()

int gem::vrp::RouteOrder::getNumberOfPackagesAtArrival ( ) const
inlinenoexcept

Get the total collected packages until this order.

Returns
The total number of packages collected until this order.

◆ getPhoneNumber()

const StringRef gem::vrp::Order::getPhoneNumber ( ) const
inlinenoexceptinherited

Retrieves the phone number of the owner of the order.

Returns
The phone number as a StringRef.

◆ getPriority()

EOrderPriority gem::vrp::Order::getPriority ( ) const
inlinenoexceptinherited

Get the order’s priority.

High priority orders will be the first to be visited if it is possible.

Returns
The priotiry of the order as a EOrderPriority value.

◆ getRevenue()

float gem::vrp::Order::getRevenue ( ) const
inlinenoexceptinherited

Get the revenue which has to be received from the order.

Returns
The revenue collected from this order

◆ getRevenueAtArrival()

float gem::vrp::RouteOrder::getRevenueAtArrival ( ) const
inlinenoexcept

Get the revenue collected until this order.

Returns
Total collected revenue until this order.

◆ getServiceTime()

unsigned int gem::vrp::Order::getServiceTime ( ) const
inlinenoexceptinherited

Get the amount of time (in seconds) that the vehicle has to stay at the current order (to load/unload the goods).

Returns
The amount of time the vehicle spends at this order in seconds.

◆ getState()

EOrderState gem::vrp::Order::getState ( ) const
inlinenoexceptinherited

Get the order’s state.

Returns
The state of the order as a EOrderStatus value.

◆ getStatus()

EOrderStatus gem::vrp::Order::getStatus ( ) const
inlinenoexceptinherited

Get the order’s status.

Returns
If the order is scheduled for a route or not as a EOrderStatus value.

◆ getTimeToNextOrder()

unsigned int gem::vrp::RouteOrder::getTimeToNextOrder ( ) const
inlinenoexcept

Get the duration (in seconds) between the current order and the next one.

Returns
The duration to the next order in seconds.

◆ getTimeWindow()

std::pair< int, int > gem::vrp::Order::getTimeWindow ( ) const
inlinenoexceptinherited

Get the time window within which the order must be visited.

The unit is minutes since midnight, for example the pair (480, 660) means that the order can be visited between 7:00 AM and 11:00 AM

In case the time window lasts more than 24 hours, the end time is calculated in minutes from the first day. For example for the time window 6:00 PM - 10:00 AM next day we will set the pair (1080, 2040)

Returns
a pair of two Time objects: the first one is the start of the time window and the second one is the end of the time window

◆ getTraveledDistance()

float gem::vrp::RouteOrder::getTraveledDistance ( ) const
inlinenoexcept

Get the vehicle traveled distance until this order in the unit distance set in the ConfigurationParameters.

Returns
Vehicle's traveled distance until this order.

◆ getType()

EOrderType gem::vrp::Order::getType ( ) const
inlinenoexceptinherited

Get the order’s type.

Returns
If the order is pickup or delivery as a EOrderType value.

◆ getVisitTime()

const TimeRef gem::vrp::RouteOrder::getVisitTime ( ) const
inlinenoexcept

Get the time when the order was visited.

Returns
The moment when this order was visited by the vehicle, in UTC, as TimeRef.

◆ getWaitTime()

unsigned int gem::vrp::RouteOrder::getWaitTime ( ) const
inlinenoexcept

Get the amount of time (in seconds) that the vehicle has to wait at the current order, in order to arrive at the next order between its time window.

Returns
Vehicle's amount of time to wait at this order in seconds.

◆ getWeight()

float gem::vrp::Order::getWeight ( ) const
inlinenoexceptinherited

Get the weight which has to be delivered at order or picked-up from the order depending on the order's type.

Returns
The total weight of the packages picked up/delivered from this order in kg.
See also
EOrderType

◆ getWeightAtArrival()

float gem::vrp::RouteOrder::getWeightAtArrival ( ) const
inlinenoexcept

Get the total collected weight until this order.

Returns
The total weight of the vehicle's load in kg.

◆ operator!=() [1/2]

bool gem::vrp::Order::operator!= ( Order const & order) const
inlineinherited

Compares two Order objects for equality.

Parameters
orderAnother Order object to compare against.
Returns
True if both Order objects represent the same data, false otherwise.

◆ operator!=() [2/2]

bool gem::vrp::RouteOrder::operator!= ( RouteOrder const & order) const
inline

Compares two RouteOrder objects for equality.

Parameters
orderAnother RouteOrder object to compare against.
Returns
True if both RouteOrder objects represent the same data, false otherwise.

◆ operator=() [1/2]

RouteOrder & gem::vrp::RouteOrder::operator= ( const RouteOrder & )
default

Default copy assignment operator.

Replaces the contents of this object with a copy of another RouteOrder object.

Returns
A reference to the current object.

◆ operator=() [2/2]

RouteOrder & gem::vrp::RouteOrder::operator= ( RouteOrder && )
defaultnoexcept

Default move assignment operator.

Moves the contents of another RouteOrder object into this one.

Returns
A reference to the current object.

◆ operator==() [1/2]

bool gem::vrp::Order::operator== ( Order const & order) const
inlineinherited

Compares two Order objects for equality.

Parameters
orderAnother Order object to compare against.
Returns
True if both Order objects represent the same data, false otherwise.

◆ operator==() [2/2]

bool gem::vrp::RouteOrder::operator== ( RouteOrder const & order) const
inline

Compares two RouteOrder objects for equality.

Parameters
orderAnother RouteOrder object to compare against.
Returns
True if both RouteOrder objects represent the same data, false otherwise.

◆ setAddress()

Order & gem::vrp::Order::setAddress ( const AddressInfo & address)
inlinenoexceptinherited

Sets the address for the order's location.

Parameters
addressThe new address for the order.
Returns
A reference to this Order object after the modification.

◆ setAlias()

Order & gem::vrp::Order::setAlias ( const String & alias)
inlinenoexceptinherited

Sets the alias for this order.

Parameters
aliasThe new alias as a String.
Returns
A reference to this Order object after modification.

◆ setCoordinates()

Order & gem::vrp::Order::setCoordinates ( const Coordinates & coords)
inlinenoexceptinherited

Set the coordinates of the order.

The coordinates cannot be updated, only set at the creation of the order.

Parameters
coordsThe new geographical coordinates for the order's location.
Returns
A reference to this Order object after the modification.

◆ setCube()

Order & gem::vrp::Order::setCube ( float cube)
inlinenoexceptinherited

Set the cube which has to be delivered at order or picked-up from the order depending on the order's type.

By default it is 0.

Parameters
cubeThe total cubic volume of the packages picked up/delivered from this order
Returns
A reference to this Order object after modification.
See also
EOrderType

◆ setCustomData()

Order & gem::vrp::Order::setCustomData ( const CustomDataList & list)
inlinenoexceptinherited

Set the order's custom data.

Used to set other descriptive data; e.g.: regular customer

Parameters
listThe custom data as CustomDataList
Returns
A reference to this Order object after modification.
See also
CustomDataList

◆ setCustomer()

Order & gem::vrp::Order::setCustomer ( const Customer & customer)
inlinenoexceptinherited

Set the Customer of the order.

Parameters
customerA reference to the Customer object
Returns
A reference to this Order object after modification.

◆ setDepotId()

Order & gem::vrp::Order::setDepotId ( LargeInteger depotId)
inlinenoexceptinherited

Set the id of the depot where to which the order belongs.

Parameters
depotIdThe id of the depot (from MiscLocation)
Returns
A reference to this Order object after modification.
See also
MiscLocation

◆ setFirstName()

Order & gem::vrp::Order::setFirstName ( const String & firstName)
inlinenoexceptinherited

Sets the fist name of the owner of the order.

Parameters
firstNameThe first name as a String.
Returns
A reference to this Order object after modification.

◆ setIndexInRoute()

RouteOrder & gem::vrp::RouteOrder::setIndexInRoute ( unsigned int indexInRoute)
inlinenoexcept

Set the index of the order in the route's orders list (the visiting order).

This method is used when you want to add a order in a route at a certain position.

Parameters
indexInRouteThe index where the order should be added in route
Returns
A reference to this RouteOrder object after modification.
See also
Route::addOrders()

◆ setLastName()

Order & gem::vrp::Order::setLastName ( const String & lastName)
inlinenoexceptinherited

Sets the last name of the owner of the order.

Parameters
lastNameThe last name as a String.
Returns
A reference to this Order object after modification.

◆ setNumberOfPackages()

Order & gem::vrp::Order::setNumberOfPackages ( unsigned int numberOfPackages)
inlinenoexceptinherited

Set the number of packages which has to be delivered at this order or picked-up from this order depending on the order's type.

By default it is 0.

Parameters
numberOfPackagesThe number of packages to be pickup or delivered.
Returns
A reference to this Order object after modification.
See also
EOrderType.

◆ setPhoneNumber()

Order & gem::vrp::Order::setPhoneNumber ( const String & phoneNumber)
inlinenoexceptinherited

Sets the phone number of the owner of the order, which the driver will use to contact him.

Parameters
phoneNumberThe last name as a String.
Returns
A reference to this Order object after modification.

◆ setPriority()

Order & gem::vrp::Order::setPriority ( EOrderPriority orderPriority)
inlinenoexceptinherited

Set the order’s priority.

By default it is EOrderPriority::OP_Low.

Parameters
orderPriorityThe order's priority as a EOrderPriority value
Returns
A reference to this Order object after modification.
See also
EOrderPriority

◆ setRevenue()

Order & gem::vrp::Order::setRevenue ( float revenue)
inlinenoexceptinherited

Set the revenue which has to be received from the order.

By default it is 0.

Parameters
revenueThe revenue collected from this order
Returns
A reference to this Order object after modification.

◆ setServiceTime()

Order & gem::vrp::Order::setServiceTime ( unsigned int serviceTimeSeconds)
inlinenoexceptinherited

Set the amount of time (in seconds) that the vehicle has to stay at the current order (to load/unload the goods).

By default it is 0.

Parameters
serviceTimeSecondsThe amount of time the vehicle spends at this order in seconds
Returns
A reference to this Order object after modification.

◆ setTimeWindow()

Order & gem::vrp::Order::setTimeWindow ( std::pair< int, int > timeWindowInMinutes)
inlinenoexceptinherited

Set the time window within which the order must be visited.

The unit is minutes since midnight, for example the pair (480, 660) means that the order can be visited between 7:00 AM and 11:00 AM

In case the time window lasts more than 24 hours, the end time is calculated in minutes from the first day. For example for the time window 6:00 PM - 10:00 AM next day we will set the pair (1080, 2040)

Parameters
timeWindowInMinutesa pair of two ints: the first one is the start of the time window and the second one is the end of the time window
Returns
A reference to this Order object after modification.

◆ setType()

Order & gem::vrp::Order::setType ( EOrderType orderType)
inlinenoexceptinherited

Set the order’s type.

By default it is EOrderType::OT_PickUp.

Parameters
orderTypeThe type of the order as a EOrderType value.
Returns
A reference to this Order object after modification.
See also
EOrderType

◆ setWeight()

Order & gem::vrp::Order::setWeight ( float weightKg)
inlinenoexceptinherited

Set the weight which has to be delivered at order or picked-up from the order depending on the order's type.

By default it is 0. The unit is kg.

Parameters
weightKgThe total weight of the packages picked up/delivered from this order
Returns
A reference to this Order object after modification.
See also
EOrderType