Maps SDK for C++ 1.0.0
Loading...
Searching...
No Matches
gem::vrp::VRPActualBreak Struct Reference

Represents an actual break that was taken by a vehicle during a route. More...

Public Member Functions

bool operator== (const VRPActualBreak &other) const
 Equality comparison operator.

Public Attributes

int duration = 0
 Duration of the break in seconds.
int startTime = 0
 Start time of the break in minutes from midnight.

Detailed Description

Represents an actual break that was taken by a vehicle during a route.

This struct holds the realized break information as part of a route's execution. Unlike VRPAvailableBreak (which defines when a break may occur), VRPActualBreak describes when a break did occur — i.e., the concrete start time and duration selected by the optimizer from the available break windows.

Actual breaks can be retrieved from a route after optimization via Route::getBreaks().

Example usage:

vrp::Route route = ...; // obtained from optimization solution
const auto& breaks = route.getBreaks();
for (const auto& actualBreak : breaks)
{
int startMinutes = actualBreak.startTime; // e.g. 720 = 12:00 PM
int durationSecs = actualBreak.duration; // e.g. 1800 = 30 minutes
}
A route is a part of the optimization's solution.
Definition GEM_VRP.h:4468
const std::vector< vrp::VRPActualBreak > & getBreaks() const noexcept
Retrieves the list of actual breaks associated with the current object.
Definition GEM_VRP.h:4720
See also
VRPAvailableBreak, Route::getBreaks(), Vehicle::setBreaks()

Member Function Documentation

◆ operator==()

bool gem::vrp::VRPActualBreak::operator== ( const VRPActualBreak & other) const
inline

Equality comparison operator.

Checks if two VRPActualBreak objects are equal.

Parameters
otherThe VRPActualBreak to compare against.
Returns
True if both startTime and duration are equal, false otherwise.

Member Data Documentation

◆ duration

int gem::vrp::VRPActualBreak::duration = 0

Duration of the break in seconds.

For example, a value of 1800 represents a 30-minute break.

◆ startTime

int gem::vrp::VRPActualBreak::startTime = 0

Start time of the break in minutes from midnight.

For example, a value of 720 represents 12:00 PM.