Interface ShipmentOrBuilder (1.30.0)

public interface ShipmentOrBuilder extends MessageOrBuilder

Implements

MessageOrBuilder

Methods

containsLoadDemands(String key)

public abstract boolean containsLoadDemands(String key)

Load demands of the shipment (for example weight, volume, number of pallets etc). The keys in the map should be identifiers describing the type of the corresponding load, ideally also including the units. For example: "weight_kg", "volume_gallons", "pallet_count", etc. If a given key does not appear in the map, the corresponding load is considered as null.

map<string, .google.cloud.optimization.v1.Shipment.Load> load_demands = 14;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

getAllowedVehicleIndices(int index)

public abstract int getAllowedVehicleIndices(int index)

The set of vehicles that may perform this shipment. If empty, all vehicles may perform it. Vehicles are given by their index in the ShipmentModel's vehicles list.

repeated int32 allowed_vehicle_indices = 5;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
int

The allowedVehicleIndices at the given index.

getAllowedVehicleIndicesCount()

public abstract int getAllowedVehicleIndicesCount()

The set of vehicles that may perform this shipment. If empty, all vehicles may perform it. Vehicles are given by their index in the ShipmentModel's vehicles list.

repeated int32 allowed_vehicle_indices = 5;

Returns
TypeDescription
int

The count of allowedVehicleIndices.

getAllowedVehicleIndicesList()

public abstract List<Integer> getAllowedVehicleIndicesList()

The set of vehicles that may perform this shipment. If empty, all vehicles may perform it. Vehicles are given by their index in the ShipmentModel's vehicles list.

repeated int32 allowed_vehicle_indices = 5;

Returns
TypeDescription
List<Integer>

A list containing the allowedVehicleIndices.

getCostsPerVehicle(int index)

public abstract double getCostsPerVehicle(int index)

Specifies the cost that is incurred when this shipment is delivered by each vehicle. If specified, it must have EITHER:

  • the same number of elements as costs_per_vehicle_indices. costs_per_vehicle[i] corresponds to vehicle costs_per_vehicle_indices[i] of the model.
  • the same number of elements as there are vehicles in the model. The i-th element corresponds to vehicle #i of the model.

    These costs must be in the same unit as penalty_cost and must not be negative. Leave this field empty, if there are no such costs.

repeated double costs_per_vehicle = 6;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
double

The costsPerVehicle at the given index.

getCostsPerVehicleCount()

public abstract int getCostsPerVehicleCount()

Specifies the cost that is incurred when this shipment is delivered by each vehicle. If specified, it must have EITHER:

  • the same number of elements as costs_per_vehicle_indices. costs_per_vehicle[i] corresponds to vehicle costs_per_vehicle_indices[i] of the model.
  • the same number of elements as there are vehicles in the model. The i-th element corresponds to vehicle #i of the model.

    These costs must be in the same unit as penalty_cost and must not be negative. Leave this field empty, if there are no such costs.

repeated double costs_per_vehicle = 6;

Returns
TypeDescription
int

The count of costsPerVehicle.

getCostsPerVehicleIndices(int index)

public abstract int getCostsPerVehicleIndices(int index)

Indices of the vehicles to which costs_per_vehicle applies. If non-empty, it must have the same number of elements as costs_per_vehicle. A vehicle index may not be specified more than once. If a vehicle is excluded from costs_per_vehicle_indices, its cost is zero.

repeated int32 costs_per_vehicle_indices = 7;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
int

The costsPerVehicleIndices at the given index.

getCostsPerVehicleIndicesCount()

public abstract int getCostsPerVehicleIndicesCount()

Indices of the vehicles to which costs_per_vehicle applies. If non-empty, it must have the same number of elements as costs_per_vehicle. A vehicle index may not be specified more than once. If a vehicle is excluded from costs_per_vehicle_indices, its cost is zero.

repeated int32 costs_per_vehicle_indices = 7;

Returns
TypeDescription
int

The count of costsPerVehicleIndices.

getCostsPerVehicleIndicesList()

public abstract List<Integer> getCostsPerVehicleIndicesList()

Indices of the vehicles to which costs_per_vehicle applies. If non-empty, it must have the same number of elements as costs_per_vehicle. A vehicle index may not be specified more than once. If a vehicle is excluded from costs_per_vehicle_indices, its cost is zero.

repeated int32 costs_per_vehicle_indices = 7;

Returns
TypeDescription
List<Integer>

A list containing the costsPerVehicleIndices.

getCostsPerVehicleList()

public abstract List<Double> getCostsPerVehicleList()

Specifies the cost that is incurred when this shipment is delivered by each vehicle. If specified, it must have EITHER:

  • the same number of elements as costs_per_vehicle_indices. costs_per_vehicle[i] corresponds to vehicle costs_per_vehicle_indices[i] of the model.
  • the same number of elements as there are vehicles in the model. The i-th element corresponds to vehicle #i of the model.

    These costs must be in the same unit as penalty_cost and must not be negative. Leave this field empty, if there are no such costs.

repeated double costs_per_vehicle = 6;

Returns
TypeDescription
List<Double>

A list containing the costsPerVehicle.

getDeliveries(int index)

public abstract Shipment.VisitRequest getDeliveries(int index)

Set of delivery alternatives associated to the shipment. If not specified, the vehicle only needs to visit a location corresponding to the pickups.

repeated .google.cloud.optimization.v1.Shipment.VisitRequest deliveries = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
Shipment.VisitRequest

getDeliveriesCount()

public abstract int getDeliveriesCount()

Set of delivery alternatives associated to the shipment. If not specified, the vehicle only needs to visit a location corresponding to the pickups.

repeated .google.cloud.optimization.v1.Shipment.VisitRequest deliveries = 2;

Returns
TypeDescription
int

getDeliveriesList()

public abstract List<Shipment.VisitRequest> getDeliveriesList()

Set of delivery alternatives associated to the shipment. If not specified, the vehicle only needs to visit a location corresponding to the pickups.

repeated .google.cloud.optimization.v1.Shipment.VisitRequest deliveries = 2;

Returns
TypeDescription
List<VisitRequest>

getDeliveriesOrBuilder(int index)

public abstract Shipment.VisitRequestOrBuilder getDeliveriesOrBuilder(int index)

Set of delivery alternatives associated to the shipment. If not specified, the vehicle only needs to visit a location corresponding to the pickups.

repeated .google.cloud.optimization.v1.Shipment.VisitRequest deliveries = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
Shipment.VisitRequestOrBuilder

getDeliveriesOrBuilderList()

public abstract List<? extends Shipment.VisitRequestOrBuilder> getDeliveriesOrBuilderList()

Set of delivery alternatives associated to the shipment. If not specified, the vehicle only needs to visit a location corresponding to the pickups.

repeated .google.cloud.optimization.v1.Shipment.VisitRequest deliveries = 2;

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

getDemands(int index) (deprecated)

public abstract CapacityQuantity getDemands(int index)

Deprecated: Use Shipment.load_demands instead.

repeated .google.cloud.optimization.v1.CapacityQuantity demands = 3 [deprecated = true];

Parameter
NameDescription
indexint
Returns
TypeDescription
CapacityQuantity

getDemandsCount() (deprecated)

public abstract int getDemandsCount()

Deprecated: Use Shipment.load_demands instead.

repeated .google.cloud.optimization.v1.CapacityQuantity demands = 3 [deprecated = true];

Returns
TypeDescription
int

getDemandsList() (deprecated)

public abstract List<CapacityQuantity> getDemandsList()

Deprecated: Use Shipment.load_demands instead.

repeated .google.cloud.optimization.v1.CapacityQuantity demands = 3 [deprecated = true];

Returns
TypeDescription
List<CapacityQuantity>

getDemandsOrBuilder(int index) (deprecated)

public abstract CapacityQuantityOrBuilder getDemandsOrBuilder(int index)

Deprecated: Use Shipment.load_demands instead.

repeated .google.cloud.optimization.v1.CapacityQuantity demands = 3 [deprecated = true];

Parameter
NameDescription
indexint
Returns
TypeDescription
CapacityQuantityOrBuilder

getDemandsOrBuilderList() (deprecated)

public abstract List<? extends CapacityQuantityOrBuilder> getDemandsOrBuilderList()

Deprecated: Use Shipment.load_demands instead.

repeated .google.cloud.optimization.v1.CapacityQuantity demands = 3 [deprecated = true];

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

getIgnore()

public abstract boolean getIgnore()

If true, skip this shipment, but don't apply a penalty_cost.

Ignoring a shipment results in a validation error when there are any shipment_type_requirements in the model.

Ignoring a shipment that is performed in injected_first_solution_routes or injected_solution_constraint is permitted; the solver removes the related pickup/delivery visits from the performing route. precedence_rules that reference ignored shipments will also be ignored.

bool ignore = 13;

Returns
TypeDescription
boolean

The ignore.

getLabel()

public abstract String getLabel()

Specifies a label for this shipment. This label is reported in the response in the shipment_label of the corresponding ShipmentRoute.Visit.

string label = 12;

Returns
TypeDescription
String

The label.

getLabelBytes()

public abstract ByteString getLabelBytes()

Specifies a label for this shipment. This label is reported in the response in the shipment_label of the corresponding ShipmentRoute.Visit.

string label = 12;

Returns
TypeDescription
ByteString

The bytes for label.

getLoadDemands() (deprecated)

public abstract Map<String,Shipment.Load> getLoadDemands()

Use #getLoadDemandsMap() instead.

Returns
TypeDescription
Map<String,Load>

getLoadDemandsCount()

public abstract int getLoadDemandsCount()

Load demands of the shipment (for example weight, volume, number of pallets etc). The keys in the map should be identifiers describing the type of the corresponding load, ideally also including the units. For example: "weight_kg", "volume_gallons", "pallet_count", etc. If a given key does not appear in the map, the corresponding load is considered as null.

map<string, .google.cloud.optimization.v1.Shipment.Load> load_demands = 14;

Returns
TypeDescription
int

getLoadDemandsMap()

public abstract Map<String,Shipment.Load> getLoadDemandsMap()

Load demands of the shipment (for example weight, volume, number of pallets etc). The keys in the map should be identifiers describing the type of the corresponding load, ideally also including the units. For example: "weight_kg", "volume_gallons", "pallet_count", etc. If a given key does not appear in the map, the corresponding load is considered as null.

map<string, .google.cloud.optimization.v1.Shipment.Load> load_demands = 14;

Returns
TypeDescription
Map<String,Load>

getLoadDemandsOrDefault(String key, Shipment.Load defaultValue)

public abstract Shipment.Load getLoadDemandsOrDefault(String key, Shipment.Load defaultValue)

Load demands of the shipment (for example weight, volume, number of pallets etc). The keys in the map should be identifiers describing the type of the corresponding load, ideally also including the units. For example: "weight_kg", "volume_gallons", "pallet_count", etc. If a given key does not appear in the map, the corresponding load is considered as null.

map<string, .google.cloud.optimization.v1.Shipment.Load> load_demands = 14;

Parameters
NameDescription
keyString
defaultValueShipment.Load
Returns
TypeDescription
Shipment.Load

getLoadDemandsOrThrow(String key)

public abstract Shipment.Load getLoadDemandsOrThrow(String key)

Load demands of the shipment (for example weight, volume, number of pallets etc). The keys in the map should be identifiers describing the type of the corresponding load, ideally also including the units. For example: "weight_kg", "volume_gallons", "pallet_count", etc. If a given key does not appear in the map, the corresponding load is considered as null.

map<string, .google.cloud.optimization.v1.Shipment.Load> load_demands = 14;

Parameter
NameDescription
keyString
Returns
TypeDescription
Shipment.Load

getPenaltyCost()

public abstract double getPenaltyCost()

If the shipment is not completed, this penalty is added to the overall cost of the routes. A shipment is considered completed if one of its pickup and delivery alternatives is visited. The cost may be expressed in the same unit used for all other cost-related fields in the model and must be positive.

IMPORTANT: If this penalty is not specified, it is considered infinite, i.e. the shipment must be completed.

optional double penalty_cost = 4;

Returns
TypeDescription
double

The penaltyCost.

getPickupToDeliveryAbsoluteDetourLimit()

public abstract Duration getPickupToDeliveryAbsoluteDetourLimit()

Specifies the maximum absolute detour time compared to the shortest path from pickup to delivery. If specified, it must be nonnegative, and the shipment must contain at least a pickup and a delivery.

For example, let t be the shortest time taken to go from the selected pickup alternative directly to the selected delivery alternative. Then setting pickup_to_delivery_absolute_detour_limit enforces:

<code><code> start_time(delivery) - start_time(pickup) &lt;= t + pickup_to_delivery_absolute_detour_limit </code></code>

If both relative and absolute limits are specified on the same shipment, the more constraining limit is used for each possible pickup/delivery pair. As of 2017/10, detours are only supported when travel durations do not depend on vehicles.

.google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9;

Returns
TypeDescription
Duration

The pickupToDeliveryAbsoluteDetourLimit.

getPickupToDeliveryAbsoluteDetourLimitOrBuilder()

public abstract DurationOrBuilder getPickupToDeliveryAbsoluteDetourLimitOrBuilder()

Specifies the maximum absolute detour time compared to the shortest path from pickup to delivery. If specified, it must be nonnegative, and the shipment must contain at least a pickup and a delivery.

For example, let t be the shortest time taken to go from the selected pickup alternative directly to the selected delivery alternative. Then setting pickup_to_delivery_absolute_detour_limit enforces:

<code><code> start_time(delivery) - start_time(pickup) &lt;= t + pickup_to_delivery_absolute_detour_limit </code></code>

If both relative and absolute limits are specified on the same shipment, the more constraining limit is used for each possible pickup/delivery pair. As of 2017/10, detours are only supported when travel durations do not depend on vehicles.

.google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9;

Returns
TypeDescription
DurationOrBuilder

getPickupToDeliveryRelativeDetourLimit()

public abstract double getPickupToDeliveryRelativeDetourLimit()

Specifies the maximum relative detour time compared to the shortest path from pickup to delivery. If specified, it must be nonnegative, and the shipment must contain at least a pickup and a delivery.

For example, let t be the shortest time taken to go from the selected pickup alternative directly to the selected delivery alternative. Then setting pickup_to_delivery_relative_detour_limit enforces:

<code><code> start_time(delivery) - start_time(pickup) &lt;= std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit)) </code></code>

If both relative and absolute limits are specified on the same shipment, the more constraining limit is used for each possible pickup/delivery pair. As of 2017/10, detours are only supported when travel durations do not depend on vehicles.

optional double pickup_to_delivery_relative_detour_limit = 8;

Returns
TypeDescription
double

The pickupToDeliveryRelativeDetourLimit.

getPickupToDeliveryTimeLimit()

public abstract Duration getPickupToDeliveryTimeLimit()

Specifies the maximum duration from start of pickup to start of delivery of a shipment. If specified, it must be nonnegative, and the shipment must contain at least a pickup and a delivery. This does not depend on which alternatives are selected for pickup and delivery, nor on vehicle speed. This can be specified alongside maximum detour constraints: the solution will respect both specifications.

.google.protobuf.Duration pickup_to_delivery_time_limit = 10;

Returns
TypeDescription
Duration

The pickupToDeliveryTimeLimit.

getPickupToDeliveryTimeLimitOrBuilder()

public abstract DurationOrBuilder getPickupToDeliveryTimeLimitOrBuilder()

Specifies the maximum duration from start of pickup to start of delivery of a shipment. If specified, it must be nonnegative, and the shipment must contain at least a pickup and a delivery. This does not depend on which alternatives are selected for pickup and delivery, nor on vehicle speed. This can be specified alongside maximum detour constraints: the solution will respect both specifications.

.google.protobuf.Duration pickup_to_delivery_time_limit = 10;

Returns
TypeDescription
DurationOrBuilder

getPickups(int index)

public abstract Shipment.VisitRequest getPickups(int index)

Set of pickup alternatives associated to the shipment. If not specified, the vehicle only needs to visit a location corresponding to the deliveries.

repeated .google.cloud.optimization.v1.Shipment.VisitRequest pickups = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
Shipment.VisitRequest

getPickupsCount()

public abstract int getPickupsCount()

Set of pickup alternatives associated to the shipment. If not specified, the vehicle only needs to visit a location corresponding to the deliveries.

repeated .google.cloud.optimization.v1.Shipment.VisitRequest pickups = 1;

Returns
TypeDescription
int

getPickupsList()

public abstract List<Shipment.VisitRequest> getPickupsList()

Set of pickup alternatives associated to the shipment. If not specified, the vehicle only needs to visit a location corresponding to the deliveries.

repeated .google.cloud.optimization.v1.Shipment.VisitRequest pickups = 1;

Returns
TypeDescription
List<VisitRequest>

getPickupsOrBuilder(int index)

public abstract Shipment.VisitRequestOrBuilder getPickupsOrBuilder(int index)

Set of pickup alternatives associated to the shipment. If not specified, the vehicle only needs to visit a location corresponding to the deliveries.

repeated .google.cloud.optimization.v1.Shipment.VisitRequest pickups = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
Shipment.VisitRequestOrBuilder

getPickupsOrBuilderList()

public abstract List<? extends Shipment.VisitRequestOrBuilder> getPickupsOrBuilderList()

Set of pickup alternatives associated to the shipment. If not specified, the vehicle only needs to visit a location corresponding to the deliveries.

repeated .google.cloud.optimization.v1.Shipment.VisitRequest pickups = 1;

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

getShipmentType()

public abstract String getShipmentType()

Non-empty string specifying a "type" for this shipment. This feature can be used to define incompatibilities or requirements between shipment_types (see shipment_type_incompatibilities and shipment_type_requirements in ShipmentModel).

Differs from visit_types which is specified for a single visit: All pickup/deliveries belonging to the same shipment share the same shipment_type.

string shipment_type = 11;

Returns
TypeDescription
String

The shipmentType.

getShipmentTypeBytes()

public abstract ByteString getShipmentTypeBytes()

Non-empty string specifying a "type" for this shipment. This feature can be used to define incompatibilities or requirements between shipment_types (see shipment_type_incompatibilities and shipment_type_requirements in ShipmentModel).

Differs from visit_types which is specified for a single visit: All pickup/deliveries belonging to the same shipment share the same shipment_type.

string shipment_type = 11;

Returns
TypeDescription
ByteString

The bytes for shipmentType.

hasPenaltyCost()

public abstract boolean hasPenaltyCost()

If the shipment is not completed, this penalty is added to the overall cost of the routes. A shipment is considered completed if one of its pickup and delivery alternatives is visited. The cost may be expressed in the same unit used for all other cost-related fields in the model and must be positive.

IMPORTANT: If this penalty is not specified, it is considered infinite, i.e. the shipment must be completed.

optional double penalty_cost = 4;

Returns
TypeDescription
boolean

Whether the penaltyCost field is set.

hasPickupToDeliveryAbsoluteDetourLimit()

public abstract boolean hasPickupToDeliveryAbsoluteDetourLimit()

Specifies the maximum absolute detour time compared to the shortest path from pickup to delivery. If specified, it must be nonnegative, and the shipment must contain at least a pickup and a delivery.

For example, let t be the shortest time taken to go from the selected pickup alternative directly to the selected delivery alternative. Then setting pickup_to_delivery_absolute_detour_limit enforces:

<code><code> start_time(delivery) - start_time(pickup) &lt;= t + pickup_to_delivery_absolute_detour_limit </code></code>

If both relative and absolute limits are specified on the same shipment, the more constraining limit is used for each possible pickup/delivery pair. As of 2017/10, detours are only supported when travel durations do not depend on vehicles.

.google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9;

Returns
TypeDescription
boolean

Whether the pickupToDeliveryAbsoluteDetourLimit field is set.

hasPickupToDeliveryRelativeDetourLimit()

public abstract boolean hasPickupToDeliveryRelativeDetourLimit()

Specifies the maximum relative detour time compared to the shortest path from pickup to delivery. If specified, it must be nonnegative, and the shipment must contain at least a pickup and a delivery.

For example, let t be the shortest time taken to go from the selected pickup alternative directly to the selected delivery alternative. Then setting pickup_to_delivery_relative_detour_limit enforces:

<code><code> start_time(delivery) - start_time(pickup) &lt;= std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit)) </code></code>

If both relative and absolute limits are specified on the same shipment, the more constraining limit is used for each possible pickup/delivery pair. As of 2017/10, detours are only supported when travel durations do not depend on vehicles.

optional double pickup_to_delivery_relative_detour_limit = 8;

Returns
TypeDescription
boolean

Whether the pickupToDeliveryRelativeDetourLimit field is set.

hasPickupToDeliveryTimeLimit()

public abstract boolean hasPickupToDeliveryTimeLimit()

Specifies the maximum duration from start of pickup to start of delivery of a shipment. If specified, it must be nonnegative, and the shipment must contain at least a pickup and a delivery. This does not depend on which alternatives are selected for pickup and delivery, nor on vehicle speed. This can be specified alongside maximum detour constraints: the solution will respect both specifications.

.google.protobuf.Duration pickup_to_delivery_time_limit = 10;

Returns
TypeDescription
boolean

Whether the pickupToDeliveryTimeLimit field is set.