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

Defines the set of constraints which can be applied over a vehicle. More...

Inheritance diagram for gem::vrp::VehicleConstraints:
Collaboration diagram for gem::vrp::VehicleConstraints:

Public Member Functions

 VehicleConstraints ()=default
 Default constructor.
 VehicleConstraints (const VehicleConstraints &)=default
 Default copy constructor.
 VehicleConstraints (VehicleConstraints &&) noexcept=default
 Default move constructor noexcept is deduced.
VehicleConstraintsoperator= (const VehicleConstraints &)=default
 Default copy assignment operator.
VehicleConstraintsoperator= (VehicleConstraints &&) noexcept=default
 Default move assignment operator.
bool operator== (VehicleConstraints const &constr) const
 Compares two VehicleConstraints objects for equality.
bool operator!= (VehicleConstraints const &constr) const
 Compares two VehicleConstraints objects for equality.
const TimeRef getStartDate () const noexcept
 Retrieves the time when the vehicle starts its route.
VehicleConstraintssetStartDate (ITime &startDate) noexcept
 Set the date when the vehicle starts its route.
unsigned int getMaxNumberOfPackages () const noexcept
 Get the maximum number of packages that the vehicle can carry.
VehicleConstraintssetMaxNumberOfPackages (unsigned int maxNumberOfPackages) noexcept
 Set the maximum number of packages that the vehicle can carry.
unsigned int getMinNumberOfOrders () const noexcept
 Get the minimum number of orders that the vehicle must visit.
VehicleConstraintssetMinNumberOfOrders (unsigned int minNumberOfOrders) noexcept
 Set the minimum number of orders that the vehicle must visit.
unsigned int getMaxNumberOfOrders () const noexcept
 Get the maximum number of orders that the vehicle can visit.
VehicleConstraintssetMaxNumberOfOrders (unsigned int maxNumberOfOrders) noexcept
 Set the maximum number of orders that the vehicle can visit; excluding the start orders which is visited by default.
float getMinDistance () const noexcept
 Get the minimum distance that the vehicle must travel (in the same distance unit as the one set with the ConfigurationParameters).
VehicleConstraintssetMinDistance (float minDistance) noexcept
 Set the minimum distance that the vehicle must travel (in the same distance unit as the one set with the ConfigurationParameters).
float getMaxDistance () const noexcept
 Get the maximum distance that the vehicle can travel (in the same distance unit as the one set with the ConfigurationParameters).
VehicleConstraintssetMaxDistance (float maxDistance) noexcept
 Set the maximum distance that the vehicle can travel (in the same distance unit as the one set with the ConfigurationParameters).
float getMaxRevenue () const noexcept
 Get the maximum revenue that the vehicle can collect in total.
VehicleConstraintssetMaxRevenue (float maxRevenue) noexcept
 Set the maximum revenue that the vehicle can collect in total, from all the customers.
float getFuelPrice () const noexcept
 Get the price for 1 liter of fuel or 1 kWh for electric engine.

Detailed Description

Defines the set of constraints which can be applied over a vehicle.

Implements share-read / copy-on-write Api object over IVehicleConstraints.

Member Function Documentation

◆ getFuelPrice()

float gem::vrp::VehicleConstraints::getFuelPrice ( ) const
inlinenoexcept

Get the price for 1 liter of fuel or 1 kWh for electric engine.

The fuel price is set using the method Service::addFuelPrices().

Returns
The price for the vehicle's fuel type for 1 liter or 1kWh, depending on the fuel type's unit

◆ getMaxDistance()

float gem::vrp::VehicleConstraints::getMaxDistance ( ) const
inlinenoexcept

Get the maximum distance that the vehicle can travel (in the same distance unit as the one set with the ConfigurationParameters).

Returns
The maximum distance that the vehicle can travel as decimal
See also
ConfigurationParameters::setDistanceUnit()

◆ getMaxNumberOfOrders()

unsigned int gem::vrp::VehicleConstraints::getMaxNumberOfOrders ( ) const
inlinenoexcept

Get the maximum number of orders that the vehicle can visit.

Returns
The maximum number of orders that the vehicle can visit as unsigned int

◆ getMaxNumberOfPackages()

unsigned int gem::vrp::VehicleConstraints::getMaxNumberOfPackages ( ) const
inlinenoexcept

Get the maximum number of packages that the vehicle can carry.

Returns
The maximum number of packages the vehicle can carry as unsigned int

◆ getMaxRevenue()

float gem::vrp::VehicleConstraints::getMaxRevenue ( ) const
inlinenoexcept

Get the maximum revenue that the vehicle can collect in total.

Returns
The maximum revenue that the vehicle can collect as decimal

◆ getMinDistance()

float gem::vrp::VehicleConstraints::getMinDistance ( ) const
inlinenoexcept

Get the minimum distance that the vehicle must travel (in the same distance unit as the one set with the ConfigurationParameters).

Returns
The minimum distance that the vehicle must travel as decimal
See also
ConfigurationParameters::setDistanceUnit()

◆ getMinNumberOfOrders()

unsigned int gem::vrp::VehicleConstraints::getMinNumberOfOrders ( ) const
inlinenoexcept

Get the minimum number of orders that the vehicle must visit.

Returns
The minimum number of orders that the vehicle must visit as unsigned int

◆ getStartDate()

const TimeRef gem::vrp::VehicleConstraints::getStartDate ( ) const
inlinenoexcept

Retrieves the time when the vehicle starts its route.

Returns
The time as a TimeRef.

◆ operator!=()

bool gem::vrp::VehicleConstraints::operator!= ( VehicleConstraints const & constr) const
inline

Compares two VehicleConstraints objects for equality.

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

◆ operator=() [1/2]

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

Default copy assignment operator.

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

Returns
A reference to the current object.

◆ operator=() [2/2]

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

Default move assignment operator.

Moves the contents of another VehicleConstraints object into this one.

Returns
A reference to the current object.

◆ operator==()

bool gem::vrp::VehicleConstraints::operator== ( VehicleConstraints const & constr) const
inline

Compares two VehicleConstraints objects for equality.

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

◆ setMaxDistance()

VehicleConstraints & gem::vrp::VehicleConstraints::setMaxDistance ( float maxDistance)
inlinenoexcept

Set the maximum distance that the vehicle can travel (in the same distance unit as the one set with the ConfigurationParameters).

By default it is 99999999.

Parameters
maxDistanceThe maximum distance that the vehicle can travel
Returns
A reference to this VehicleConstraints object after modification.
See also
ConfigurationParameters::setDistanceUnit()

◆ setMaxNumberOfOrders()

VehicleConstraints & gem::vrp::VehicleConstraints::setMaxNumberOfOrders ( unsigned int maxNumberOfOrders)
inlinenoexcept

Set the maximum number of orders that the vehicle can visit; excluding the start orders which is visited by default.

By default it is int max.

Parameters
maxNumberOfOrdersthe maximum number of orders that the vehicle can visit
Returns
A reference to this VehicleConstraints object after modification.

◆ setMaxNumberOfPackages()

VehicleConstraints & gem::vrp::VehicleConstraints::setMaxNumberOfPackages ( unsigned int maxNumberOfPackages)
inlinenoexcept

Set the maximum number of packages that the vehicle can carry.

By default it is 99999999.

Parameters
maxNumberOfPackageshe maximum number of packages that the vehicle can carry
Returns
A reference to this VehicleConstraints object after modification.

◆ setMaxRevenue()

VehicleConstraints & gem::vrp::VehicleConstraints::setMaxRevenue ( float maxRevenue)
inlinenoexcept

Set the maximum revenue that the vehicle can collect in total, from all the customers.

By default it is 99999999.

Parameters
maxRevenueThe maximum revenue that the vehicle can collect
Returns
A reference to this VehicleConstraints object after modification.

◆ setMinDistance()

VehicleConstraints & gem::vrp::VehicleConstraints::setMinDistance ( float minDistance)
inlinenoexcept

Set the minimum distance that the vehicle must travel (in the same distance unit as the one set with the ConfigurationParameters).

By default it is 0.

Parameters
minDistanceThe minimum distance that the vehicle must travel
Returns
A reference to this VehicleConstraints object after modification.
See also
ConfigurationParameters::setDistanceUnit()

◆ setMinNumberOfOrders()

VehicleConstraints & gem::vrp::VehicleConstraints::setMinNumberOfOrders ( unsigned int minNumberOfOrders)
inlinenoexcept

Set the minimum number of orders that the vehicle must visit.

By default it is 0.

Parameters
minNumberOfOrdersthe minimum number of orders that the vehicle must visit
Returns
A reference to this VehicleConstraints object after modification.

◆ setStartDate()

VehicleConstraints & gem::vrp::VehicleConstraints::setStartDate ( ITime & startDate)
inlinenoexcept

Set the date when the vehicle starts its route.

By default it is the current UTC date.

Parameters
startDateThe start date of the vehicle
Returns
A reference to this VehicleConstraints object after modification.