Class Vehicle (1.10.0)

public final class Vehicle extends GeneratedMessageV3 implements VehicleOrBuilder

Models a vehicle in a shipment problem. Solving a shipment problem will build a route starting from start_location and ending at end_location for this vehicle. A route is a sequence of visits (see ShipmentRoute).

Protobuf type google.cloud.optimization.v1.Vehicle

Implements

VehicleOrBuilder

Static Fields

BREAK_RULE_FIELD_NUMBER

public static final int BREAK_RULE_FIELD_NUMBER
Field Value
TypeDescription
int

BREAK_RULE_INDICES_FIELD_NUMBER

public static final int BREAK_RULE_INDICES_FIELD_NUMBER
Field Value
TypeDescription
int

CAPACITIES_FIELD_NUMBER

public static final int CAPACITIES_FIELD_NUMBER
Field Value
TypeDescription
int

COST_PER_HOUR_FIELD_NUMBER

public static final int COST_PER_HOUR_FIELD_NUMBER
Field Value
TypeDescription
int

COST_PER_KILOMETER_FIELD_NUMBER

public static final int COST_PER_KILOMETER_FIELD_NUMBER
Field Value
TypeDescription
int

COST_PER_TRAVELED_HOUR_FIELD_NUMBER

public static final int COST_PER_TRAVELED_HOUR_FIELD_NUMBER
Field Value
TypeDescription
int

END_LOAD_INTERVALS_FIELD_NUMBER

public static final int END_LOAD_INTERVALS_FIELD_NUMBER
Field Value
TypeDescription
int

END_LOCATION_FIELD_NUMBER

public static final int END_LOCATION_FIELD_NUMBER
Field Value
TypeDescription
int

END_TAGS_FIELD_NUMBER

public static final int END_TAGS_FIELD_NUMBER
Field Value
TypeDescription
int

END_TIME_WINDOWS_FIELD_NUMBER

public static final int END_TIME_WINDOWS_FIELD_NUMBER
Field Value
TypeDescription
int

END_WAYPOINT_FIELD_NUMBER

public static final int END_WAYPOINT_FIELD_NUMBER
Field Value
TypeDescription
int

EXTRA_VISIT_DURATION_FOR_VISIT_TYPE_FIELD_NUMBER

public static final int EXTRA_VISIT_DURATION_FOR_VISIT_TYPE_FIELD_NUMBER
Field Value
TypeDescription
int

FIXED_COST_FIELD_NUMBER

public static final int FIXED_COST_FIELD_NUMBER
Field Value
TypeDescription
int

IGNORE_FIELD_NUMBER

public static final int IGNORE_FIELD_NUMBER
Field Value
TypeDescription
int

LABEL_FIELD_NUMBER

public static final int LABEL_FIELD_NUMBER
Field Value
TypeDescription
int

LOAD_LIMITS_FIELD_NUMBER

public static final int LOAD_LIMITS_FIELD_NUMBER
Field Value
TypeDescription
int

ROUTE_DISTANCE_LIMIT_FIELD_NUMBER

public static final int ROUTE_DISTANCE_LIMIT_FIELD_NUMBER
Field Value
TypeDescription
int

ROUTE_DURATION_LIMIT_FIELD_NUMBER

public static final int ROUTE_DURATION_LIMIT_FIELD_NUMBER
Field Value
TypeDescription
int

START_LOAD_INTERVALS_FIELD_NUMBER

public static final int START_LOAD_INTERVALS_FIELD_NUMBER
Field Value
TypeDescription
int

START_LOCATION_FIELD_NUMBER

public static final int START_LOCATION_FIELD_NUMBER
Field Value
TypeDescription
int

START_TAGS_FIELD_NUMBER

public static final int START_TAGS_FIELD_NUMBER
Field Value
TypeDescription
int

START_TIME_WINDOWS_FIELD_NUMBER

public static final int START_TIME_WINDOWS_FIELD_NUMBER
Field Value
TypeDescription
int

START_WAYPOINT_FIELD_NUMBER

public static final int START_WAYPOINT_FIELD_NUMBER
Field Value
TypeDescription
int

TRAVEL_DURATION_LIMIT_FIELD_NUMBER

public static final int TRAVEL_DURATION_LIMIT_FIELD_NUMBER
Field Value
TypeDescription
int

TRAVEL_DURATION_MULTIPLE_FIELD_NUMBER

public static final int TRAVEL_DURATION_MULTIPLE_FIELD_NUMBER
Field Value
TypeDescription
int

TRAVEL_MODE_FIELD_NUMBER

public static final int TRAVEL_MODE_FIELD_NUMBER
Field Value
TypeDescription
int

UNLOADING_POLICY_FIELD_NUMBER

public static final int UNLOADING_POLICY_FIELD_NUMBER
Field Value
TypeDescription
int

USED_IF_ROUTE_IS_EMPTY_FIELD_NUMBER

public static final int USED_IF_ROUTE_IS_EMPTY_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Vehicle getDefaultInstance()
Returns
TypeDescription
Vehicle

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static Vehicle.Builder newBuilder()
Returns
TypeDescription
Vehicle.Builder

newBuilder(Vehicle prototype)

public static Vehicle.Builder newBuilder(Vehicle prototype)
Parameter
NameDescription
prototypeVehicle
Returns
TypeDescription
Vehicle.Builder

parseDelimitedFrom(InputStream input)

public static Vehicle parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Vehicle
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Vehicle parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Vehicle
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static Vehicle parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
Vehicle
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Vehicle parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Vehicle
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Vehicle parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
Vehicle
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Vehicle parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Vehicle
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Vehicle parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
Vehicle
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Vehicle parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Vehicle
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static Vehicle parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Vehicle
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Vehicle parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Vehicle
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static Vehicle parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
Vehicle
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Vehicle parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Vehicle
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<Vehicle> parser()
Returns
TypeDescription
Parser<Vehicle>

Methods

containsExtraVisitDurationForVisitType(String key)

public boolean containsExtraVisitDurationForVisitType(String key)

Specifies a map from visit_types strings to durations. The duration is time in addition to VisitRequest.duration to be taken at visits with the specified visit_types. This extra visit duration adds cost if cost_per_hour is specified. Keys (i.e. visit_types) cannot be empty strings. If a visit request has multiple types, a duration will be added for each type in the map.

map<string, .google.protobuf.Duration> extra_visit_duration_for_visit_type = 24;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

containsLoadLimits(String key)

public boolean containsLoadLimits(String key)

Capacities of the vehicle (weight, volume, # of pallets for example). The keys in the map are the identifiers of the type of load, consistent with the keys of the Shipment.load_demands field. If a given key is absent from this map, the corresponding capacity is considered to be limitless.

map<string, .google.cloud.optimization.v1.Vehicle.LoadLimit> load_limits = 30;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getBreakRule()

public BreakRule getBreakRule()

Describes the break schedule to be enforced on this vehicle. If empty, no breaks will be scheduled for this vehicle.

.google.cloud.optimization.v1.BreakRule break_rule = 25;

Returns
TypeDescription
BreakRule

The breakRule.

getBreakRuleIndices(int index) (deprecated)

public int getBreakRuleIndices(int index)

Deprecated. google.cloud.optimization.v1.Vehicle.break_rule_indices is deprecated. See google/cloud/optimization/v1/fleet_routing.proto;l=1443

Deprecated: No longer used. Indices in the break_rule field in the source ShipmentModel. They correspond to break rules enforced on the vehicle. As of 2018/03, at most one rule index per vehicle can be specified.

repeated int32 break_rule_indices = 29 [deprecated = true];

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
int

The breakRuleIndices at the given index.

getBreakRuleIndicesCount() (deprecated)

public int getBreakRuleIndicesCount()

Deprecated. google.cloud.optimization.v1.Vehicle.break_rule_indices is deprecated. See google/cloud/optimization/v1/fleet_routing.proto;l=1443

Deprecated: No longer used. Indices in the break_rule field in the source ShipmentModel. They correspond to break rules enforced on the vehicle. As of 2018/03, at most one rule index per vehicle can be specified.

repeated int32 break_rule_indices = 29 [deprecated = true];

Returns
TypeDescription
int

The count of breakRuleIndices.

getBreakRuleIndicesList() (deprecated)

public List<Integer> getBreakRuleIndicesList()

Deprecated. google.cloud.optimization.v1.Vehicle.break_rule_indices is deprecated. See google/cloud/optimization/v1/fleet_routing.proto;l=1443

Deprecated: No longer used. Indices in the break_rule field in the source ShipmentModel. They correspond to break rules enforced on the vehicle. As of 2018/03, at most one rule index per vehicle can be specified.

repeated int32 break_rule_indices = 29 [deprecated = true];

Returns
TypeDescription
List<Integer>

A list containing the breakRuleIndices.

getBreakRuleOrBuilder()

public BreakRuleOrBuilder getBreakRuleOrBuilder()

Describes the break schedule to be enforced on this vehicle. If empty, no breaks will be scheduled for this vehicle.

.google.cloud.optimization.v1.BreakRule break_rule = 25;

Returns
TypeDescription
BreakRuleOrBuilder

getCapacities(int index)

public CapacityQuantity getCapacities(int index)

Deprecated: Use Vehicle.load_limits instead.

repeated .google.cloud.optimization.v1.CapacityQuantity capacities = 13 [deprecated = true];

Parameter
NameDescription
indexint
Returns
TypeDescription
CapacityQuantity

getCapacitiesCount()

public int getCapacitiesCount()

Deprecated: Use Vehicle.load_limits instead.

repeated .google.cloud.optimization.v1.CapacityQuantity capacities = 13 [deprecated = true];

Returns
TypeDescription
int

getCapacitiesList()

public List<CapacityQuantity> getCapacitiesList()

Deprecated: Use Vehicle.load_limits instead.

repeated .google.cloud.optimization.v1.CapacityQuantity capacities = 13 [deprecated = true];

Returns
TypeDescription
List<CapacityQuantity>

getCapacitiesOrBuilder(int index)

public CapacityQuantityOrBuilder getCapacitiesOrBuilder(int index)

Deprecated: Use Vehicle.load_limits instead.

repeated .google.cloud.optimization.v1.CapacityQuantity capacities = 13 [deprecated = true];

Parameter
NameDescription
indexint
Returns
TypeDescription
CapacityQuantityOrBuilder

getCapacitiesOrBuilderList()

public List<? extends CapacityQuantityOrBuilder> getCapacitiesOrBuilderList()

Deprecated: Use Vehicle.load_limits instead.

repeated .google.cloud.optimization.v1.CapacityQuantity capacities = 13 [deprecated = true];

Returns
TypeDescription
List<? extends com.google.cloud.optimization.v1.CapacityQuantityOrBuilder>

getCostPerHour()

public double getCostPerHour()

Vehicle costs: all costs add up and must be in the same unit as Shipment.penalty_cost. Cost per hour of the vehicle route. This cost is applied to the total time taken by the route, and includes travel time, waiting time, and visit time. Using cost_per_hour instead of just cost_per_traveled_hour may result in additional latency.

double cost_per_hour = 16;

Returns
TypeDescription
double

The costPerHour.

getCostPerKilometer()

public double getCostPerKilometer()

Cost per kilometer of the vehicle route. This cost is applied to the distance reported in the ShipmentRoute.transitions and does not apply to any distance implicitly traveled from the arrival_location to the departure_location of a single VisitRequest.

double cost_per_kilometer = 18;

Returns
TypeDescription
double

The costPerKilometer.

getCostPerTraveledHour()

public double getCostPerTraveledHour()

Cost per traveled hour of the vehicle route. This cost is applied only to travel time taken by the route (i.e., that reported in ShipmentRoute.transitions), and excludes waiting time and visit time.

double cost_per_traveled_hour = 17;

Returns
TypeDescription
double

The costPerTraveledHour.

getDefaultInstanceForType()

public Vehicle getDefaultInstanceForType()
Returns
TypeDescription
Vehicle

getEndLoadIntervals(int index)

public CapacityQuantityInterval getEndLoadIntervals(int index)

Deprecated: Use Vehicle.LoadLimit.end_load_interval instead.

repeated .google.cloud.optimization.v1.CapacityQuantityInterval end_load_intervals = 15 [deprecated = true];

Parameter
NameDescription
indexint
Returns
TypeDescription
CapacityQuantityInterval

getEndLoadIntervalsCount()

public int getEndLoadIntervalsCount()

Deprecated: Use Vehicle.LoadLimit.end_load_interval instead.

repeated .google.cloud.optimization.v1.CapacityQuantityInterval end_load_intervals = 15 [deprecated = true];

Returns
TypeDescription
int

getEndLoadIntervalsList()

public List<CapacityQuantityInterval> getEndLoadIntervalsList()

Deprecated: Use Vehicle.LoadLimit.end_load_interval instead.

repeated .google.cloud.optimization.v1.CapacityQuantityInterval end_load_intervals = 15 [deprecated = true];

Returns
TypeDescription
List<CapacityQuantityInterval>

getEndLoadIntervalsOrBuilder(int index)

public CapacityQuantityIntervalOrBuilder getEndLoadIntervalsOrBuilder(int index)

Deprecated: Use Vehicle.LoadLimit.end_load_interval instead.

repeated .google.cloud.optimization.v1.CapacityQuantityInterval end_load_intervals = 15 [deprecated = true];

Parameter
NameDescription
indexint
Returns
TypeDescription
CapacityQuantityIntervalOrBuilder

getEndLoadIntervalsOrBuilderList()

public List<? extends CapacityQuantityIntervalOrBuilder> getEndLoadIntervalsOrBuilderList()

Deprecated: Use Vehicle.LoadLimit.end_load_interval instead.

repeated .google.cloud.optimization.v1.CapacityQuantityInterval end_load_intervals = 15 [deprecated = true];

Returns
TypeDescription
List<? extends com.google.cloud.optimization.v1.CapacityQuantityIntervalOrBuilder>

getEndLocation()

public LatLng getEndLocation()

Geographic location where the vehicle ends after it has completed its last VisitRequest. If not specified the vehicle's ShipmentRoute ends immediately when it completes its last VisitRequest. If the shipment model has duration and distance matrices, end_location must not be specified.

.google.type.LatLng end_location = 5;

Returns
TypeDescription
com.google.type.LatLng

The endLocation.

getEndLocationOrBuilder()

public LatLngOrBuilder getEndLocationOrBuilder()

Geographic location where the vehicle ends after it has completed its last VisitRequest. If not specified the vehicle's ShipmentRoute ends immediately when it completes its last VisitRequest. If the shipment model has duration and distance matrices, end_location must not be specified.

.google.type.LatLng end_location = 5;

Returns
TypeDescription
com.google.type.LatLngOrBuilder

getEndTags(int index)

public String getEndTags(int index)

Specifies tags attached to the end of the vehicle's route. Empty or duplicate strings are not allowed.

repeated string end_tags = 8;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The endTags at the given index.

getEndTagsBytes(int index)

public ByteString getEndTagsBytes(int index)

Specifies tags attached to the end of the vehicle's route. Empty or duplicate strings are not allowed.

repeated string end_tags = 8;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the endTags at the given index.

getEndTagsCount()

public int getEndTagsCount()

Specifies tags attached to the end of the vehicle's route. Empty or duplicate strings are not allowed.

repeated string end_tags = 8;

Returns
TypeDescription
int

The count of endTags.

getEndTagsList()

public ProtocolStringList getEndTagsList()

Specifies tags attached to the end of the vehicle's route. Empty or duplicate strings are not allowed.

repeated string end_tags = 8;

Returns
TypeDescription
ProtocolStringList

A list containing the endTags.

getEndTimeWindows(int index)

public TimeWindow getEndTimeWindows(int index)

Time windows during which the vehicle may arrive at its end location. They must be within the global time limits (see ShipmentModel.global_* fields). If unspecified, there is no limitation besides those global time limits. Time windows belonging to the same repeated field must be disjoint, i.e. no time window can overlap with or be adjacent to another, and they must be in chronological order. cost_per_hour_after_soft_end_time and soft_end_time can only be set if there is a single time window.

repeated .google.cloud.optimization.v1.TimeWindow end_time_windows = 10;

Parameter
NameDescription
indexint
Returns
TypeDescription
TimeWindow

getEndTimeWindowsCount()

public int getEndTimeWindowsCount()

Time windows during which the vehicle may arrive at its end location. They must be within the global time limits (see ShipmentModel.global_* fields). If unspecified, there is no limitation besides those global time limits. Time windows belonging to the same repeated field must be disjoint, i.e. no time window can overlap with or be adjacent to another, and they must be in chronological order. cost_per_hour_after_soft_end_time and soft_end_time can only be set if there is a single time window.

repeated .google.cloud.optimization.v1.TimeWindow end_time_windows = 10;

Returns
TypeDescription
int

getEndTimeWindowsList()

public List<TimeWindow> getEndTimeWindowsList()

Time windows during which the vehicle may arrive at its end location. They must be within the global time limits (see ShipmentModel.global_* fields). If unspecified, there is no limitation besides those global time limits. Time windows belonging to the same repeated field must be disjoint, i.e. no time window can overlap with or be adjacent to another, and they must be in chronological order. cost_per_hour_after_soft_end_time and soft_end_time can only be set if there is a single time window.

repeated .google.cloud.optimization.v1.TimeWindow end_time_windows = 10;

Returns
TypeDescription
List<TimeWindow>

getEndTimeWindowsOrBuilder(int index)

public TimeWindowOrBuilder getEndTimeWindowsOrBuilder(int index)

Time windows during which the vehicle may arrive at its end location. They must be within the global time limits (see ShipmentModel.global_* fields). If unspecified, there is no limitation besides those global time limits. Time windows belonging to the same repeated field must be disjoint, i.e. no time window can overlap with or be adjacent to another, and they must be in chronological order. cost_per_hour_after_soft_end_time and soft_end_time can only be set if there is a single time window.

repeated .google.cloud.optimization.v1.TimeWindow end_time_windows = 10;

Parameter
NameDescription
indexint
Returns
TypeDescription
TimeWindowOrBuilder

getEndTimeWindowsOrBuilderList()

public List<? extends TimeWindowOrBuilder> getEndTimeWindowsOrBuilderList()

Time windows during which the vehicle may arrive at its end location. They must be within the global time limits (see ShipmentModel.global_* fields). If unspecified, there is no limitation besides those global time limits. Time windows belonging to the same repeated field must be disjoint, i.e. no time window can overlap with or be adjacent to another, and they must be in chronological order. cost_per_hour_after_soft_end_time and soft_end_time can only be set if there is a single time window.

repeated .google.cloud.optimization.v1.TimeWindow end_time_windows = 10;

Returns
TypeDescription
List<? extends com.google.cloud.optimization.v1.TimeWindowOrBuilder>

getEndWaypoint()

public Waypoint getEndWaypoint()

Waypoint representing a geographic location where the vehicle ends after it has completed its last VisitRequest. If neither end_waypoint nor end_location is specified, the vehicle's ShipmentRoute ends immediately when it completes its last VisitRequest. If the shipment model has duration and distance matrices, end_waypoint must not be specified.

.google.cloud.optimization.v1.Waypoint end_waypoint = 6;

Returns
TypeDescription
Waypoint

The endWaypoint.

getEndWaypointOrBuilder()

public WaypointOrBuilder getEndWaypointOrBuilder()

Waypoint representing a geographic location where the vehicle ends after it has completed its last VisitRequest. If neither end_waypoint nor end_location is specified, the vehicle's ShipmentRoute ends immediately when it completes its last VisitRequest. If the shipment model has duration and distance matrices, end_waypoint must not be specified.

.google.cloud.optimization.v1.Waypoint end_waypoint = 6;

Returns
TypeDescription
WaypointOrBuilder

getExtraVisitDurationForVisitType()

public Map<String,Duration> getExtraVisitDurationForVisitType()
Returns
TypeDescription
Map<String,Duration>

getExtraVisitDurationForVisitTypeCount()

public int getExtraVisitDurationForVisitTypeCount()

Specifies a map from visit_types strings to durations. The duration is time in addition to VisitRequest.duration to be taken at visits with the specified visit_types. This extra visit duration adds cost if cost_per_hour is specified. Keys (i.e. visit_types) cannot be empty strings. If a visit request has multiple types, a duration will be added for each type in the map.

map<string, .google.protobuf.Duration> extra_visit_duration_for_visit_type = 24;

Returns
TypeDescription
int

getExtraVisitDurationForVisitTypeMap()

public Map<String,Duration> getExtraVisitDurationForVisitTypeMap()

Specifies a map from visit_types strings to durations. The duration is time in addition to VisitRequest.duration to be taken at visits with the specified visit_types. This extra visit duration adds cost if cost_per_hour is specified. Keys (i.e. visit_types) cannot be empty strings. If a visit request has multiple types, a duration will be added for each type in the map.

map<string, .google.protobuf.Duration> extra_visit_duration_for_visit_type = 24;

Returns
TypeDescription
Map<String,Duration>

getExtraVisitDurationForVisitTypeOrDefault(String key, Duration defaultValue)

public Duration getExtraVisitDurationForVisitTypeOrDefault(String key, Duration defaultValue)

Specifies a map from visit_types strings to durations. The duration is time in addition to VisitRequest.duration to be taken at visits with the specified visit_types. This extra visit duration adds cost if cost_per_hour is specified. Keys (i.e. visit_types) cannot be empty strings. If a visit request has multiple types, a duration will be added for each type in the map.

map<string, .google.protobuf.Duration> extra_visit_duration_for_visit_type = 24;

Parameters
NameDescription
keyString
defaultValueDuration
Returns
TypeDescription
Duration

getExtraVisitDurationForVisitTypeOrThrow(String key)

public Duration getExtraVisitDurationForVisitTypeOrThrow(String key)

Specifies a map from visit_types strings to durations. The duration is time in addition to VisitRequest.duration to be taken at visits with the specified visit_types. This extra visit duration adds cost if cost_per_hour is specified. Keys (i.e. visit_types) cannot be empty strings. If a visit request has multiple types, a duration will be added for each type in the map.

map<string, .google.protobuf.Duration> extra_visit_duration_for_visit_type = 24;

Parameter
NameDescription
keyString
Returns
TypeDescription
Duration

getFixedCost()

public double getFixedCost()

Fixed cost applied if this vehicle is used to handle a shipment.

double fixed_cost = 19;

Returns
TypeDescription
double

The fixedCost.

getIgnore()

public boolean getIgnore()

If true, used_if_route_is_empty must be false, and this vehicle will remain unused. If a shipment is performed by an ignored vehicle in injected_first_solution_routes, it is skipped in the first solution but is free to be performed in the response. If a shipment is performed by an ignored vehicle in injected_solution_constraint and any related pickup/delivery is constrained to remain on the vehicle (i.e., not relaxed to level RELAX_ALL_AFTER_THRESHOLD), it is skipped in the response. If a shipment has a non-empty allowed_vehicle_indices field and all of the allowed vehicles are ignored, it is skipped in the response.

bool ignore = 28;

Returns
TypeDescription
boolean

The ignore.

getLabel()

public String getLabel()

Specifies a label for this vehicle. This label is reported in the response as the vehicle_label of the corresponding ShipmentRoute.

string label = 27;

Returns
TypeDescription
String

The label.

getLabelBytes()

public ByteString getLabelBytes()

Specifies a label for this vehicle. This label is reported in the response as the vehicle_label of the corresponding ShipmentRoute.

string label = 27;

Returns
TypeDescription
ByteString

The bytes for label.

getLoadLimits()

public Map<String,Vehicle.LoadLimit> getLoadLimits()

Use #getLoadLimitsMap() instead.

Returns
TypeDescription
Map<String,LoadLimit>

getLoadLimitsCount()

public int getLoadLimitsCount()

Capacities of the vehicle (weight, volume, # of pallets for example). The keys in the map are the identifiers of the type of load, consistent with the keys of the Shipment.load_demands field. If a given key is absent from this map, the corresponding capacity is considered to be limitless.

map<string, .google.cloud.optimization.v1.Vehicle.LoadLimit> load_limits = 30;

Returns
TypeDescription
int

getLoadLimitsMap()

public Map<String,Vehicle.LoadLimit> getLoadLimitsMap()

Capacities of the vehicle (weight, volume, # of pallets for example). The keys in the map are the identifiers of the type of load, consistent with the keys of the Shipment.load_demands field. If a given key is absent from this map, the corresponding capacity is considered to be limitless.

map<string, .google.cloud.optimization.v1.Vehicle.LoadLimit> load_limits = 30;

Returns
TypeDescription
Map<String,LoadLimit>

getLoadLimitsOrDefault(String key, Vehicle.LoadLimit defaultValue)

public Vehicle.LoadLimit getLoadLimitsOrDefault(String key, Vehicle.LoadLimit defaultValue)

Capacities of the vehicle (weight, volume, # of pallets for example). The keys in the map are the identifiers of the type of load, consistent with the keys of the Shipment.load_demands field. If a given key is absent from this map, the corresponding capacity is considered to be limitless.

map<string, .google.cloud.optimization.v1.Vehicle.LoadLimit> load_limits = 30;

Parameters
NameDescription
keyString
defaultValueVehicle.LoadLimit
Returns
TypeDescription
Vehicle.LoadLimit

getLoadLimitsOrThrow(String key)

public Vehicle.LoadLimit getLoadLimitsOrThrow(String key)

Capacities of the vehicle (weight, volume, # of pallets for example). The keys in the map are the identifiers of the type of load, consistent with the keys of the Shipment.load_demands field. If a given key is absent from this map, the corresponding capacity is considered to be limitless.

map<string, .google.cloud.optimization.v1.Vehicle.LoadLimit> load_limits = 30;

Parameter
NameDescription
keyString
Returns
TypeDescription
Vehicle.LoadLimit

getParserForType()

public Parser<Vehicle> getParserForType()
Returns
TypeDescription
Parser<Vehicle>
Overrides

getRouteDistanceLimit()

public DistanceLimit getRouteDistanceLimit()

Limit applied to the total distance of the vehicle's route. In a given OptimizeToursResponse, the route distance is the sum of all its transitions.travel_distance_meters.

.google.cloud.optimization.v1.DistanceLimit route_distance_limit = 23;

Returns
TypeDescription
DistanceLimit

The routeDistanceLimit.

getRouteDistanceLimitOrBuilder()

public DistanceLimitOrBuilder getRouteDistanceLimitOrBuilder()

Limit applied to the total distance of the vehicle's route. In a given OptimizeToursResponse, the route distance is the sum of all its transitions.travel_distance_meters.

.google.cloud.optimization.v1.DistanceLimit route_distance_limit = 23;

Returns
TypeDescription
DistanceLimitOrBuilder

getRouteDurationLimit()

public Vehicle.DurationLimit getRouteDurationLimit()

Limit applied to the total duration of the vehicle's route. In a given OptimizeToursResponse, the route duration of a vehicle is the difference between its vehicle_end_time and vehicle_start_time.

.google.cloud.optimization.v1.Vehicle.DurationLimit route_duration_limit = 21;

Returns
TypeDescription
Vehicle.DurationLimit

The routeDurationLimit.

getRouteDurationLimitOrBuilder()

public Vehicle.DurationLimitOrBuilder getRouteDurationLimitOrBuilder()

Limit applied to the total duration of the vehicle's route. In a given OptimizeToursResponse, the route duration of a vehicle is the difference between its vehicle_end_time and vehicle_start_time.

.google.cloud.optimization.v1.Vehicle.DurationLimit route_duration_limit = 21;

Returns
TypeDescription
Vehicle.DurationLimitOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getStartLoadIntervals(int index)

public CapacityQuantityInterval getStartLoadIntervals(int index)

Deprecated: Use Vehicle.LoadLimit.start_load_interval instead.

repeated .google.cloud.optimization.v1.CapacityQuantityInterval start_load_intervals = 14 [deprecated = true];

Parameter
NameDescription
indexint
Returns
TypeDescription
CapacityQuantityInterval

getStartLoadIntervalsCount()

public int getStartLoadIntervalsCount()

Deprecated: Use Vehicle.LoadLimit.start_load_interval instead.

repeated .google.cloud.optimization.v1.CapacityQuantityInterval start_load_intervals = 14 [deprecated = true];

Returns
TypeDescription
int

getStartLoadIntervalsList()

public List<CapacityQuantityInterval> getStartLoadIntervalsList()

Deprecated: Use Vehicle.LoadLimit.start_load_interval instead.

repeated .google.cloud.optimization.v1.CapacityQuantityInterval start_load_intervals = 14 [deprecated = true];

Returns
TypeDescription
List<CapacityQuantityInterval>

getStartLoadIntervalsOrBuilder(int index)

public CapacityQuantityIntervalOrBuilder getStartLoadIntervalsOrBuilder(int index)

Deprecated: Use Vehicle.LoadLimit.start_load_interval instead.

repeated .google.cloud.optimization.v1.CapacityQuantityInterval start_load_intervals = 14 [deprecated = true];

Parameter
NameDescription
indexint
Returns
TypeDescription
CapacityQuantityIntervalOrBuilder

getStartLoadIntervalsOrBuilderList()

public List<? extends CapacityQuantityIntervalOrBuilder> getStartLoadIntervalsOrBuilderList()

Deprecated: Use Vehicle.LoadLimit.start_load_interval instead.

repeated .google.cloud.optimization.v1.CapacityQuantityInterval start_load_intervals = 14 [deprecated = true];

Returns
TypeDescription
List<? extends com.google.cloud.optimization.v1.CapacityQuantityIntervalOrBuilder>

getStartLocation()

public LatLng getStartLocation()

Geographic location where the vehicle starts before picking up any shipments. If not specified, the vehicle starts at its first pickup. If the shipment model has duration and distance matrices, start_location must not be specified.

.google.type.LatLng start_location = 3;

Returns
TypeDescription
com.google.type.LatLng

The startLocation.

getStartLocationOrBuilder()

public LatLngOrBuilder getStartLocationOrBuilder()

Geographic location where the vehicle starts before picking up any shipments. If not specified, the vehicle starts at its first pickup. If the shipment model has duration and distance matrices, start_location must not be specified.

.google.type.LatLng start_location = 3;

Returns
TypeDescription
com.google.type.LatLngOrBuilder

getStartTags(int index)

public String getStartTags(int index)

Specifies tags attached to the start of the vehicle's route. Empty or duplicate strings are not allowed.

repeated string start_tags = 7;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The startTags at the given index.

getStartTagsBytes(int index)

public ByteString getStartTagsBytes(int index)

Specifies tags attached to the start of the vehicle's route. Empty or duplicate strings are not allowed.

repeated string start_tags = 7;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the startTags at the given index.

getStartTagsCount()

public int getStartTagsCount()

Specifies tags attached to the start of the vehicle's route. Empty or duplicate strings are not allowed.

repeated string start_tags = 7;

Returns
TypeDescription
int

The count of startTags.

getStartTagsList()

public ProtocolStringList getStartTagsList()

Specifies tags attached to the start of the vehicle's route. Empty or duplicate strings are not allowed.

repeated string start_tags = 7;

Returns
TypeDescription
ProtocolStringList

A list containing the startTags.

getStartTimeWindows(int index)

public TimeWindow getStartTimeWindows(int index)

Time windows during which the vehicle may depart its start location. They must be within the global time limits (see ShipmentModel.global_* fields). If unspecified, there is no limitation besides those global time limits. Time windows belonging to the same repeated field must be disjoint, i.e. no time window can overlap with or be adjacent to another, and they must be in chronological order. cost_per_hour_after_soft_end_time and soft_end_time can only be set if there is a single time window.

repeated .google.cloud.optimization.v1.TimeWindow start_time_windows = 9;

Parameter
NameDescription
indexint
Returns
TypeDescription
TimeWindow

getStartTimeWindowsCount()

public int getStartTimeWindowsCount()

Time windows during which the vehicle may depart its start location. They must be within the global time limits (see ShipmentModel.global_* fields). If unspecified, there is no limitation besides those global time limits. Time windows belonging to the same repeated field must be disjoint, i.e. no time window can overlap with or be adjacent to another, and they must be in chronological order. cost_per_hour_after_soft_end_time and soft_end_time can only be set if there is a single time window.

repeated .google.cloud.optimization.v1.TimeWindow start_time_windows = 9;

Returns
TypeDescription
int

getStartTimeWindowsList()

public List<TimeWindow> getStartTimeWindowsList()

Time windows during which the vehicle may depart its start location. They must be within the global time limits (see ShipmentModel.global_* fields). If unspecified, there is no limitation besides those global time limits. Time windows belonging to the same repeated field must be disjoint, i.e. no time window can overlap with or be adjacent to another, and they must be in chronological order. cost_per_hour_after_soft_end_time and soft_end_time can only be set if there is a single time window.

repeated .google.cloud.optimization.v1.TimeWindow start_time_windows = 9;

Returns
TypeDescription
List<TimeWindow>

getStartTimeWindowsOrBuilder(int index)

public TimeWindowOrBuilder getStartTimeWindowsOrBuilder(int index)

Time windows during which the vehicle may depart its start location. They must be within the global time limits (see ShipmentModel.global_* fields). If unspecified, there is no limitation besides those global time limits. Time windows belonging to the same repeated field must be disjoint, i.e. no time window can overlap with or be adjacent to another, and they must be in chronological order. cost_per_hour_after_soft_end_time and soft_end_time can only be set if there is a single time window.

repeated .google.cloud.optimization.v1.TimeWindow start_time_windows = 9;

Parameter
NameDescription
indexint
Returns
TypeDescription
TimeWindowOrBuilder

getStartTimeWindowsOrBuilderList()

public List<? extends TimeWindowOrBuilder> getStartTimeWindowsOrBuilderList()

Time windows during which the vehicle may depart its start location. They must be within the global time limits (see ShipmentModel.global_* fields). If unspecified, there is no limitation besides those global time limits. Time windows belonging to the same repeated field must be disjoint, i.e. no time window can overlap with or be adjacent to another, and they must be in chronological order. cost_per_hour_after_soft_end_time and soft_end_time can only be set if there is a single time window.

repeated .google.cloud.optimization.v1.TimeWindow start_time_windows = 9;

Returns
TypeDescription
List<? extends com.google.cloud.optimization.v1.TimeWindowOrBuilder>

getStartWaypoint()

public Waypoint getStartWaypoint()

Waypoint representing a geographic location where the vehicle starts before picking up any shipments. If neither start_waypoint nor start_location is specified, the vehicle starts at its first pickup. If the shipment model has duration and distance matrices, start_waypoint must not be specified.

.google.cloud.optimization.v1.Waypoint start_waypoint = 4;

Returns
TypeDescription
Waypoint

The startWaypoint.

getStartWaypointOrBuilder()

public WaypointOrBuilder getStartWaypointOrBuilder()

Waypoint representing a geographic location where the vehicle starts before picking up any shipments. If neither start_waypoint nor start_location is specified, the vehicle starts at its first pickup. If the shipment model has duration and distance matrices, start_waypoint must not be specified.

.google.cloud.optimization.v1.Waypoint start_waypoint = 4;

Returns
TypeDescription
WaypointOrBuilder

getTravelDurationLimit()

public Vehicle.DurationLimit getTravelDurationLimit()

Limit applied to the travel duration of the vehicle's route. In a given OptimizeToursResponse, the route travel duration is the sum of all its transitions.travel_duration.

.google.cloud.optimization.v1.Vehicle.DurationLimit travel_duration_limit = 22;

Returns
TypeDescription
Vehicle.DurationLimit

The travelDurationLimit.

getTravelDurationLimitOrBuilder()

public Vehicle.DurationLimitOrBuilder getTravelDurationLimitOrBuilder()

Limit applied to the travel duration of the vehicle's route. In a given OptimizeToursResponse, the route travel duration is the sum of all its transitions.travel_duration.

.google.cloud.optimization.v1.Vehicle.DurationLimit travel_duration_limit = 22;

Returns
TypeDescription
Vehicle.DurationLimitOrBuilder

getTravelDurationMultiple()

public double getTravelDurationMultiple()

Specifies a multiplicative factor that can be used to increase or decrease travel times of this vehicle. For example, setting this to 2.0 means that this vehicle is slower and has travel times that are twice what they are for standard vehicles. This multiple does not affect visit durations. It does affect cost if cost_per_hour or cost_per_traveled_hour are specified. This must be in the range [0.001, 1000.0]. If unset, the vehicle is standard, and this multiple is considered 1.0. WARNING: Travel times will be rounded to the nearest second after this multiple is applied but before performing any numerical operations, thus, a small multiple may result in a loss of precision. See also extra_visit_duration_for_visit_type below.

optional double travel_duration_multiple = 11;

Returns
TypeDescription
double

The travelDurationMultiple.

getTravelMode()

public Vehicle.TravelMode getTravelMode()

The travel mode which affects the roads usable by the vehicle and its speed. See also travel_duration_multiple.

.google.cloud.optimization.v1.Vehicle.TravelMode travel_mode = 1;

Returns
TypeDescription
Vehicle.TravelMode

The travelMode.

getTravelModeValue()

public int getTravelModeValue()

The travel mode which affects the roads usable by the vehicle and its speed. See also travel_duration_multiple.

.google.cloud.optimization.v1.Vehicle.TravelMode travel_mode = 1;

Returns
TypeDescription
int

The enum numeric value on the wire for travelMode.

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

getUnloadingPolicy()

public Vehicle.UnloadingPolicy getUnloadingPolicy()

Unloading policy enforced on the vehicle.

.google.cloud.optimization.v1.Vehicle.UnloadingPolicy unloading_policy = 12;

Returns
TypeDescription
Vehicle.UnloadingPolicy

The unloadingPolicy.

getUnloadingPolicyValue()

public int getUnloadingPolicyValue()

Unloading policy enforced on the vehicle.

.google.cloud.optimization.v1.Vehicle.UnloadingPolicy unloading_policy = 12;

Returns
TypeDescription
int

The enum numeric value on the wire for unloadingPolicy.

getUsedIfRouteIsEmpty()

public boolean getUsedIfRouteIsEmpty()

This field only applies to vehicles when their route does not serve any shipments. It indicates if the vehicle should be considered as used or not in this case. If true, the vehicle goes from its start to its end location even if it doesn't serve any shipments, and time and distance costs resulting from its start --> end travel are taken into account. Otherwise, it doesn't travel from its start to its end location, and no break_rule or delay (from TransitionAttributes) are scheduled for this vehicle. In this case, the vehicle's ShipmentRoute doesn't contain any information except for the vehicle index and label.

bool used_if_route_is_empty = 20;

Returns
TypeDescription
boolean

The usedIfRouteIsEmpty.

hasBreakRule()

public boolean hasBreakRule()

Describes the break schedule to be enforced on this vehicle. If empty, no breaks will be scheduled for this vehicle.

.google.cloud.optimization.v1.BreakRule break_rule = 25;

Returns
TypeDescription
boolean

Whether the breakRule field is set.

hasEndLocation()

public boolean hasEndLocation()

Geographic location where the vehicle ends after it has completed its last VisitRequest. If not specified the vehicle's ShipmentRoute ends immediately when it completes its last VisitRequest. If the shipment model has duration and distance matrices, end_location must not be specified.

.google.type.LatLng end_location = 5;

Returns
TypeDescription
boolean

Whether the endLocation field is set.

hasEndWaypoint()

public boolean hasEndWaypoint()

Waypoint representing a geographic location where the vehicle ends after it has completed its last VisitRequest. If neither end_waypoint nor end_location is specified, the vehicle's ShipmentRoute ends immediately when it completes its last VisitRequest. If the shipment model has duration and distance matrices, end_waypoint must not be specified.

.google.cloud.optimization.v1.Waypoint end_waypoint = 6;

Returns
TypeDescription
boolean

Whether the endWaypoint field is set.

hasRouteDistanceLimit()

public boolean hasRouteDistanceLimit()

Limit applied to the total distance of the vehicle's route. In a given OptimizeToursResponse, the route distance is the sum of all its transitions.travel_distance_meters.

.google.cloud.optimization.v1.DistanceLimit route_distance_limit = 23;

Returns
TypeDescription
boolean

Whether the routeDistanceLimit field is set.

hasRouteDurationLimit()

public boolean hasRouteDurationLimit()

Limit applied to the total duration of the vehicle's route. In a given OptimizeToursResponse, the route duration of a vehicle is the difference between its vehicle_end_time and vehicle_start_time.

.google.cloud.optimization.v1.Vehicle.DurationLimit route_duration_limit = 21;

Returns
TypeDescription
boolean

Whether the routeDurationLimit field is set.

hasStartLocation()

public boolean hasStartLocation()

Geographic location where the vehicle starts before picking up any shipments. If not specified, the vehicle starts at its first pickup. If the shipment model has duration and distance matrices, start_location must not be specified.

.google.type.LatLng start_location = 3;

Returns
TypeDescription
boolean

Whether the startLocation field is set.

hasStartWaypoint()

public boolean hasStartWaypoint()

Waypoint representing a geographic location where the vehicle starts before picking up any shipments. If neither start_waypoint nor start_location is specified, the vehicle starts at its first pickup. If the shipment model has duration and distance matrices, start_waypoint must not be specified.

.google.cloud.optimization.v1.Waypoint start_waypoint = 4;

Returns
TypeDescription
boolean

Whether the startWaypoint field is set.

hasTravelDurationLimit()

public boolean hasTravelDurationLimit()

Limit applied to the travel duration of the vehicle's route. In a given OptimizeToursResponse, the route travel duration is the sum of all its transitions.travel_duration.

.google.cloud.optimization.v1.Vehicle.DurationLimit travel_duration_limit = 22;

Returns
TypeDescription
boolean

Whether the travelDurationLimit field is set.

hasTravelDurationMultiple()

public boolean hasTravelDurationMultiple()

Specifies a multiplicative factor that can be used to increase or decrease travel times of this vehicle. For example, setting this to 2.0 means that this vehicle is slower and has travel times that are twice what they are for standard vehicles. This multiple does not affect visit durations. It does affect cost if cost_per_hour or cost_per_traveled_hour are specified. This must be in the range [0.001, 1000.0]. If unset, the vehicle is standard, and this multiple is considered 1.0. WARNING: Travel times will be rounded to the nearest second after this multiple is applied but before performing any numerical operations, thus, a small multiple may result in a loss of precision. See also extra_visit_duration_for_visit_type below.

optional double travel_duration_multiple = 11;

Returns
TypeDescription
boolean

Whether the travelDurationMultiple field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public Vehicle.Builder newBuilderForType()
Returns
TypeDescription
Vehicle.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Vehicle.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
Vehicle.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public Vehicle.Builder toBuilder()
Returns
TypeDescription
Vehicle.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides Exceptions
TypeDescription
IOException