- 1.53.0 (latest)
- 1.52.0
- 1.51.0
- 1.50.0
- 1.49.0
- 1.47.0
- 1.46.0
- 1.45.0
- 1.44.0
- 1.43.0
- 1.42.0
- 1.41.0
- 1.40.0
- 1.39.0
- 1.38.0
- 1.37.0
- 1.35.0
- 1.34.0
- 1.33.0
- 1.32.0
- 1.31.0
- 1.30.0
- 1.29.0
- 1.28.0
- 1.27.0
- 1.26.0
- 1.25.0
- 1.22.0
- 1.21.0
- 1.20.0
- 1.19.0
- 1.18.0
- 1.17.0
- 1.16.0
- 1.15.0
- 1.14.0
- 1.13.0
- 1.12.0
- 1.11.0
- 1.10.0
- 1.9.0
- 1.7.0
- 1.6.0
- 1.5.0
- 1.4.0
- 1.3.0
- 1.2.0
- 1.1.14
- 0.1.2
public static final class ShipmentModel.Builder extends GeneratedMessageV3.Builder<ShipmentModel.Builder> implements ShipmentModelOrBuilder
A shipment model contains a set of shipments which must be performed by a set of vehicles, while minimizing the overall cost, which is the sum of:
- the cost of routing the vehicles (sum of cost per total time, cost per travel time, and fixed cost over all vehicles).
- the unperformed shipment penalties.
- the cost of the global duration of the shipments
Protobuf type google.cloud.optimization.v1.ShipmentModel
Inheritance
Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessageV3.Builder > ShipmentModel.BuilderImplements
ShipmentModelOrBuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Type | Description |
Descriptor |
Methods
addAllBreakRules(Iterable<? extends ShipmentModel.BreakRule> values)
public ShipmentModel.Builder addAllBreakRules(Iterable<? extends ShipmentModel.BreakRule> values)
Deprecated: No longer used.
Set of break rules used in the model.
Each vehicle specifies the BreakRule
that applies to it via the
Vehicle.break_rule_indices field (which must be a singleton).
repeated .google.cloud.optimization.v1.ShipmentModel.BreakRule break_rules = 15 [deprecated = true];
Name | Description |
values | Iterable<? extends com.google.cloud.optimization.v1.ShipmentModel.BreakRule> |
Type | Description |
ShipmentModel.Builder |
addAllDurationDistanceMatrices(Iterable<? extends ShipmentModel.DurationDistanceMatrix> values)
public ShipmentModel.Builder addAllDurationDistanceMatrices(Iterable<? extends ShipmentModel.DurationDistanceMatrix> values)
Specifies duration and distance matrices used in the model. If this field
is empty, Google Maps or geodesic distances will be used instead, depending
on the value of the use_geodesic_distances
field. If it is not empty,
use_geodesic_distances
cannot be true and neither
duration_distance_matrix_src_tags
nor duration_distance_matrix_dst_tags
can be empty.
Usage examples:
- There are two locations: locA and locB.
- 1 vehicle starting its route at locA and ending it at locA.
- 1 pickup visit request at locB.
`
model { vehicles { start_tags: "locA" end_tags: "locA" } shipments { pickups { tags: "locB" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_dst_tags: "locA" duration_distance_matrix_dst_tags: "locB" duration_distance_matrices { rows { # from: locA durations { seconds: 0 } meters: 0 # to: locA durations { seconds: 100 } meters: 1000 # to: locB } rows { # from: locB durations { seconds: 102 } meters: 990 # to: locA durations { seconds: 0 } meters: 0 # to: locB } } }
- There are three locations: locA, locB and locC.
- 1 vehicle starting its route at locA and ending it at locB, using matrix "fast".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "slow".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "fast".
- 1 pickup visit request at locC.
`model { vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } shipments { pickups { tags: "locC" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_src_tags: "locC" duration_distance_matrix_dst_tags: "locB" duration_distance_matrix_dst_tags: "locC" duration_distance_matrices { vehicle_start_tag: "fast" rows { # from: locA durations { seconds: 1000 } meters: 2000 # to: locB durations { seconds: 600 } meters: 1000 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 700 } meters: 1200 # to: locC } rows { # from: locC durations { seconds: 702 } meters: 1190 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } duration_distance_matrices { vehicle_start_tag: "slow" rows { # from: locA durations { seconds: 1800 } meters: 2001 # to: locB durations { seconds: 900 } meters: 1002 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 1000 } meters: 1202 # to: locC } rows { # from: locC durations { seconds: 1001 } meters: 1195 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } }
repeated .google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8;
Name | Description |
values | Iterable<? extends com.google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix> |
Type | Description |
ShipmentModel.Builder |
addAllDurationDistanceMatrixDstTags(Iterable<String> values)
public ShipmentModel.Builder addAllDurationDistanceMatrixDstTags(Iterable<String> values)
Tags defining the destinations of the duration and distance matrices;
duration_distance_matrices(i).rows(j).durations(k)
(resp.
duration_distance_matrices(i).rows(j).meters(k))
defines the duration
(resp. the distance) of the travel from visits with tag
duration_distance_matrix_src_tags(j)
to visits with tag
duration_distance_matrix_dst_tags(k)
in matrix i.
Tags correspond to
VisitRequest.tags
or Vehicle.start_tags.
A given VisitRequest
or Vehicle
must match exactly one tag in this
field. Note that a Vehicle
's source, destination and matrix tags may be
the same; similarly a VisitRequest
's source and destination tags may be
the same. All tags must be different and cannot be empty strings. If this
field is not empty, then duration_distance_matrices
must not be empty.
repeated string duration_distance_matrix_dst_tags = 10;
Name | Description |
values | Iterable<String> The durationDistanceMatrixDstTags to add. |
Type | Description |
ShipmentModel.Builder | This builder for chaining. |
addAllDurationDistanceMatrixSrcTags(Iterable<String> values)
public ShipmentModel.Builder addAllDurationDistanceMatrixSrcTags(Iterable<String> values)
Tags defining the sources of the duration and distance matrices;
duration_distance_matrices(i).rows(j)
defines durations and distances
from visits with tag duration_distance_matrix_src_tags(j)
to other visits
in matrix i.
Tags correspond to
VisitRequest.tags
or Vehicle.start_tags.
A given VisitRequest
or Vehicle
must match exactly one tag in this
field. Note that a Vehicle
's source, destination and matrix tags may be
the same; similarly a VisitRequest
's source and destination tags may be
the same. All tags must be different and cannot be empty strings. If this
field is not empty, then duration_distance_matrices
must not be empty.
repeated string duration_distance_matrix_src_tags = 9;
Name | Description |
values | Iterable<String> The durationDistanceMatrixSrcTags to add. |
Type | Description |
ShipmentModel.Builder | This builder for chaining. |
addAllPrecedenceRules(Iterable<? extends ShipmentModel.PrecedenceRule> values)
public ShipmentModel.Builder addAllPrecedenceRules(Iterable<? extends ShipmentModel.PrecedenceRule> values)
Set of precedence rules which must be enforced in the model.
repeated .google.cloud.optimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14;
Name | Description |
values | Iterable<? extends com.google.cloud.optimization.v1.ShipmentModel.PrecedenceRule> |
Type | Description |
ShipmentModel.Builder |
addAllShipmentTypeIncompatibilities(Iterable<? extends ShipmentTypeIncompatibility> values)
public ShipmentModel.Builder addAllShipmentTypeIncompatibilities(Iterable<? extends ShipmentTypeIncompatibility> values)
Sets of incompatible shipment_types (see ShipmentTypeIncompatibility
).
repeated .google.cloud.optimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12;
Name | Description |
values | Iterable<? extends com.google.cloud.optimization.v1.ShipmentTypeIncompatibility> |
Type | Description |
ShipmentModel.Builder |
addAllShipmentTypeRequirements(Iterable<? extends ShipmentTypeRequirement> values)
public ShipmentModel.Builder addAllShipmentTypeRequirements(Iterable<? extends ShipmentTypeRequirement> values)
Sets of shipment_type
requirements (see ShipmentTypeRequirement
).
repeated .google.cloud.optimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13;
Name | Description |
values | Iterable<? extends com.google.cloud.optimization.v1.ShipmentTypeRequirement> |
Type | Description |
ShipmentModel.Builder |
addAllShipments(Iterable<? extends Shipment> values)
public ShipmentModel.Builder addAllShipments(Iterable<? extends Shipment> values)
Set of shipments which must be performed in the model.
repeated .google.cloud.optimization.v1.Shipment shipments = 1;
Name | Description |
values | Iterable<? extends com.google.cloud.optimization.v1.Shipment> |
Type | Description |
ShipmentModel.Builder |
addAllTransitionAttributes(Iterable<? extends TransitionAttributes> values)
public ShipmentModel.Builder addAllTransitionAttributes(Iterable<? extends TransitionAttributes> values)
Transition attributes added to the model.
repeated .google.cloud.optimization.v1.TransitionAttributes transition_attributes = 11;
Name | Description |
values | Iterable<? extends com.google.cloud.optimization.v1.TransitionAttributes> |
Type | Description |
ShipmentModel.Builder |
addAllVehicles(Iterable<? extends Vehicle> values)
public ShipmentModel.Builder addAllVehicles(Iterable<? extends Vehicle> values)
Set of vehicles which can be used to perform visits.
repeated .google.cloud.optimization.v1.Vehicle vehicles = 2;
Name | Description |
values | Iterable<? extends com.google.cloud.optimization.v1.Vehicle> |
Type | Description |
ShipmentModel.Builder |
addBreakRules(ShipmentModel.BreakRule value)
public ShipmentModel.Builder addBreakRules(ShipmentModel.BreakRule value)
Deprecated: No longer used.
Set of break rules used in the model.
Each vehicle specifies the BreakRule
that applies to it via the
Vehicle.break_rule_indices field (which must be a singleton).
repeated .google.cloud.optimization.v1.ShipmentModel.BreakRule break_rules = 15 [deprecated = true];
Name | Description |
value | ShipmentModel.BreakRule |
Type | Description |
ShipmentModel.Builder |
addBreakRules(ShipmentModel.BreakRule.Builder builderForValue)
public ShipmentModel.Builder addBreakRules(ShipmentModel.BreakRule.Builder builderForValue)
Deprecated: No longer used.
Set of break rules used in the model.
Each vehicle specifies the BreakRule
that applies to it via the
Vehicle.break_rule_indices field (which must be a singleton).
repeated .google.cloud.optimization.v1.ShipmentModel.BreakRule break_rules = 15 [deprecated = true];
Name | Description |
builderForValue | ShipmentModel.BreakRule.Builder |
Type | Description |
ShipmentModel.Builder |
addBreakRules(int index, ShipmentModel.BreakRule value)
public ShipmentModel.Builder addBreakRules(int index, ShipmentModel.BreakRule value)
Deprecated: No longer used.
Set of break rules used in the model.
Each vehicle specifies the BreakRule
that applies to it via the
Vehicle.break_rule_indices field (which must be a singleton).
repeated .google.cloud.optimization.v1.ShipmentModel.BreakRule break_rules = 15 [deprecated = true];
Name | Description |
index | int |
value | ShipmentModel.BreakRule |
Type | Description |
ShipmentModel.Builder |
addBreakRules(int index, ShipmentModel.BreakRule.Builder builderForValue)
public ShipmentModel.Builder addBreakRules(int index, ShipmentModel.BreakRule.Builder builderForValue)
Deprecated: No longer used.
Set of break rules used in the model.
Each vehicle specifies the BreakRule
that applies to it via the
Vehicle.break_rule_indices field (which must be a singleton).
repeated .google.cloud.optimization.v1.ShipmentModel.BreakRule break_rules = 15 [deprecated = true];
Name | Description |
index | int |
builderForValue | ShipmentModel.BreakRule.Builder |
Type | Description |
ShipmentModel.Builder |
addBreakRulesBuilder()
public ShipmentModel.BreakRule.Builder addBreakRulesBuilder()
Deprecated: No longer used.
Set of break rules used in the model.
Each vehicle specifies the BreakRule
that applies to it via the
Vehicle.break_rule_indices field (which must be a singleton).
repeated .google.cloud.optimization.v1.ShipmentModel.BreakRule break_rules = 15 [deprecated = true];
Type | Description |
ShipmentModel.BreakRule.Builder |
addBreakRulesBuilder(int index)
public ShipmentModel.BreakRule.Builder addBreakRulesBuilder(int index)
Deprecated: No longer used.
Set of break rules used in the model.
Each vehicle specifies the BreakRule
that applies to it via the
Vehicle.break_rule_indices field (which must be a singleton).
repeated .google.cloud.optimization.v1.ShipmentModel.BreakRule break_rules = 15 [deprecated = true];
Name | Description |
index | int |
Type | Description |
ShipmentModel.BreakRule.Builder |
addDurationDistanceMatrices(ShipmentModel.DurationDistanceMatrix value)
public ShipmentModel.Builder addDurationDistanceMatrices(ShipmentModel.DurationDistanceMatrix value)
Specifies duration and distance matrices used in the model. If this field
is empty, Google Maps or geodesic distances will be used instead, depending
on the value of the use_geodesic_distances
field. If it is not empty,
use_geodesic_distances
cannot be true and neither
duration_distance_matrix_src_tags
nor duration_distance_matrix_dst_tags
can be empty.
Usage examples:
- There are two locations: locA and locB.
- 1 vehicle starting its route at locA and ending it at locA.
- 1 pickup visit request at locB.
`
model { vehicles { start_tags: "locA" end_tags: "locA" } shipments { pickups { tags: "locB" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_dst_tags: "locA" duration_distance_matrix_dst_tags: "locB" duration_distance_matrices { rows { # from: locA durations { seconds: 0 } meters: 0 # to: locA durations { seconds: 100 } meters: 1000 # to: locB } rows { # from: locB durations { seconds: 102 } meters: 990 # to: locA durations { seconds: 0 } meters: 0 # to: locB } } }
- There are three locations: locA, locB and locC.
- 1 vehicle starting its route at locA and ending it at locB, using matrix "fast".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "slow".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "fast".
- 1 pickup visit request at locC.
`model { vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } shipments { pickups { tags: "locC" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_src_tags: "locC" duration_distance_matrix_dst_tags: "locB" duration_distance_matrix_dst_tags: "locC" duration_distance_matrices { vehicle_start_tag: "fast" rows { # from: locA durations { seconds: 1000 } meters: 2000 # to: locB durations { seconds: 600 } meters: 1000 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 700 } meters: 1200 # to: locC } rows { # from: locC durations { seconds: 702 } meters: 1190 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } duration_distance_matrices { vehicle_start_tag: "slow" rows { # from: locA durations { seconds: 1800 } meters: 2001 # to: locB durations { seconds: 900 } meters: 1002 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 1000 } meters: 1202 # to: locC } rows { # from: locC durations { seconds: 1001 } meters: 1195 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } }
repeated .google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8;
Name | Description |
value | ShipmentModel.DurationDistanceMatrix |
Type | Description |
ShipmentModel.Builder |
addDurationDistanceMatrices(ShipmentModel.DurationDistanceMatrix.Builder builderForValue)
public ShipmentModel.Builder addDurationDistanceMatrices(ShipmentModel.DurationDistanceMatrix.Builder builderForValue)
Specifies duration and distance matrices used in the model. If this field
is empty, Google Maps or geodesic distances will be used instead, depending
on the value of the use_geodesic_distances
field. If it is not empty,
use_geodesic_distances
cannot be true and neither
duration_distance_matrix_src_tags
nor duration_distance_matrix_dst_tags
can be empty.
Usage examples:
- There are two locations: locA and locB.
- 1 vehicle starting its route at locA and ending it at locA.
- 1 pickup visit request at locB.
`
model { vehicles { start_tags: "locA" end_tags: "locA" } shipments { pickups { tags: "locB" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_dst_tags: "locA" duration_distance_matrix_dst_tags: "locB" duration_distance_matrices { rows { # from: locA durations { seconds: 0 } meters: 0 # to: locA durations { seconds: 100 } meters: 1000 # to: locB } rows { # from: locB durations { seconds: 102 } meters: 990 # to: locA durations { seconds: 0 } meters: 0 # to: locB } } }
- There are three locations: locA, locB and locC.
- 1 vehicle starting its route at locA and ending it at locB, using matrix "fast".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "slow".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "fast".
- 1 pickup visit request at locC.
`model { vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } shipments { pickups { tags: "locC" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_src_tags: "locC" duration_distance_matrix_dst_tags: "locB" duration_distance_matrix_dst_tags: "locC" duration_distance_matrices { vehicle_start_tag: "fast" rows { # from: locA durations { seconds: 1000 } meters: 2000 # to: locB durations { seconds: 600 } meters: 1000 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 700 } meters: 1200 # to: locC } rows { # from: locC durations { seconds: 702 } meters: 1190 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } duration_distance_matrices { vehicle_start_tag: "slow" rows { # from: locA durations { seconds: 1800 } meters: 2001 # to: locB durations { seconds: 900 } meters: 1002 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 1000 } meters: 1202 # to: locC } rows { # from: locC durations { seconds: 1001 } meters: 1195 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } }
repeated .google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8;
Name | Description |
builderForValue | ShipmentModel.DurationDistanceMatrix.Builder |
Type | Description |
ShipmentModel.Builder |
addDurationDistanceMatrices(int index, ShipmentModel.DurationDistanceMatrix value)
public ShipmentModel.Builder addDurationDistanceMatrices(int index, ShipmentModel.DurationDistanceMatrix value)
Specifies duration and distance matrices used in the model. If this field
is empty, Google Maps or geodesic distances will be used instead, depending
on the value of the use_geodesic_distances
field. If it is not empty,
use_geodesic_distances
cannot be true and neither
duration_distance_matrix_src_tags
nor duration_distance_matrix_dst_tags
can be empty.
Usage examples:
- There are two locations: locA and locB.
- 1 vehicle starting its route at locA and ending it at locA.
- 1 pickup visit request at locB.
`
model { vehicles { start_tags: "locA" end_tags: "locA" } shipments { pickups { tags: "locB" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_dst_tags: "locA" duration_distance_matrix_dst_tags: "locB" duration_distance_matrices { rows { # from: locA durations { seconds: 0 } meters: 0 # to: locA durations { seconds: 100 } meters: 1000 # to: locB } rows { # from: locB durations { seconds: 102 } meters: 990 # to: locA durations { seconds: 0 } meters: 0 # to: locB } } }
- There are three locations: locA, locB and locC.
- 1 vehicle starting its route at locA and ending it at locB, using matrix "fast".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "slow".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "fast".
- 1 pickup visit request at locC.
`model { vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } shipments { pickups { tags: "locC" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_src_tags: "locC" duration_distance_matrix_dst_tags: "locB" duration_distance_matrix_dst_tags: "locC" duration_distance_matrices { vehicle_start_tag: "fast" rows { # from: locA durations { seconds: 1000 } meters: 2000 # to: locB durations { seconds: 600 } meters: 1000 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 700 } meters: 1200 # to: locC } rows { # from: locC durations { seconds: 702 } meters: 1190 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } duration_distance_matrices { vehicle_start_tag: "slow" rows { # from: locA durations { seconds: 1800 } meters: 2001 # to: locB durations { seconds: 900 } meters: 1002 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 1000 } meters: 1202 # to: locC } rows { # from: locC durations { seconds: 1001 } meters: 1195 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } }
repeated .google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8;
Name | Description |
index | int |
value | ShipmentModel.DurationDistanceMatrix |
Type | Description |
ShipmentModel.Builder |
addDurationDistanceMatrices(int index, ShipmentModel.DurationDistanceMatrix.Builder builderForValue)
public ShipmentModel.Builder addDurationDistanceMatrices(int index, ShipmentModel.DurationDistanceMatrix.Builder builderForValue)
Specifies duration and distance matrices used in the model. If this field
is empty, Google Maps or geodesic distances will be used instead, depending
on the value of the use_geodesic_distances
field. If it is not empty,
use_geodesic_distances
cannot be true and neither
duration_distance_matrix_src_tags
nor duration_distance_matrix_dst_tags
can be empty.
Usage examples:
- There are two locations: locA and locB.
- 1 vehicle starting its route at locA and ending it at locA.
- 1 pickup visit request at locB.
`
model { vehicles { start_tags: "locA" end_tags: "locA" } shipments { pickups { tags: "locB" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_dst_tags: "locA" duration_distance_matrix_dst_tags: "locB" duration_distance_matrices { rows { # from: locA durations { seconds: 0 } meters: 0 # to: locA durations { seconds: 100 } meters: 1000 # to: locB } rows { # from: locB durations { seconds: 102 } meters: 990 # to: locA durations { seconds: 0 } meters: 0 # to: locB } } }
- There are three locations: locA, locB and locC.
- 1 vehicle starting its route at locA and ending it at locB, using matrix "fast".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "slow".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "fast".
- 1 pickup visit request at locC.
`model { vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } shipments { pickups { tags: "locC" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_src_tags: "locC" duration_distance_matrix_dst_tags: "locB" duration_distance_matrix_dst_tags: "locC" duration_distance_matrices { vehicle_start_tag: "fast" rows { # from: locA durations { seconds: 1000 } meters: 2000 # to: locB durations { seconds: 600 } meters: 1000 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 700 } meters: 1200 # to: locC } rows { # from: locC durations { seconds: 702 } meters: 1190 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } duration_distance_matrices { vehicle_start_tag: "slow" rows { # from: locA durations { seconds: 1800 } meters: 2001 # to: locB durations { seconds: 900 } meters: 1002 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 1000 } meters: 1202 # to: locC } rows { # from: locC durations { seconds: 1001 } meters: 1195 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } }
repeated .google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8;
Name | Description |
index | int |
builderForValue | ShipmentModel.DurationDistanceMatrix.Builder |
Type | Description |
ShipmentModel.Builder |
addDurationDistanceMatricesBuilder()
public ShipmentModel.DurationDistanceMatrix.Builder addDurationDistanceMatricesBuilder()
Specifies duration and distance matrices used in the model. If this field
is empty, Google Maps or geodesic distances will be used instead, depending
on the value of the use_geodesic_distances
field. If it is not empty,
use_geodesic_distances
cannot be true and neither
duration_distance_matrix_src_tags
nor duration_distance_matrix_dst_tags
can be empty.
Usage examples:
- There are two locations: locA and locB.
- 1 vehicle starting its route at locA and ending it at locA.
- 1 pickup visit request at locB.
`
model { vehicles { start_tags: "locA" end_tags: "locA" } shipments { pickups { tags: "locB" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_dst_tags: "locA" duration_distance_matrix_dst_tags: "locB" duration_distance_matrices { rows { # from: locA durations { seconds: 0 } meters: 0 # to: locA durations { seconds: 100 } meters: 1000 # to: locB } rows { # from: locB durations { seconds: 102 } meters: 990 # to: locA durations { seconds: 0 } meters: 0 # to: locB } } }
- There are three locations: locA, locB and locC.
- 1 vehicle starting its route at locA and ending it at locB, using matrix "fast".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "slow".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "fast".
- 1 pickup visit request at locC.
`model { vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } shipments { pickups { tags: "locC" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_src_tags: "locC" duration_distance_matrix_dst_tags: "locB" duration_distance_matrix_dst_tags: "locC" duration_distance_matrices { vehicle_start_tag: "fast" rows { # from: locA durations { seconds: 1000 } meters: 2000 # to: locB durations { seconds: 600 } meters: 1000 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 700 } meters: 1200 # to: locC } rows { # from: locC durations { seconds: 702 } meters: 1190 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } duration_distance_matrices { vehicle_start_tag: "slow" rows { # from: locA durations { seconds: 1800 } meters: 2001 # to: locB durations { seconds: 900 } meters: 1002 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 1000 } meters: 1202 # to: locC } rows { # from: locC durations { seconds: 1001 } meters: 1195 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } }
repeated .google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8;
Type | Description |
ShipmentModel.DurationDistanceMatrix.Builder |
addDurationDistanceMatricesBuilder(int index)
public ShipmentModel.DurationDistanceMatrix.Builder addDurationDistanceMatricesBuilder(int index)
Specifies duration and distance matrices used in the model. If this field
is empty, Google Maps or geodesic distances will be used instead, depending
on the value of the use_geodesic_distances
field. If it is not empty,
use_geodesic_distances
cannot be true and neither
duration_distance_matrix_src_tags
nor duration_distance_matrix_dst_tags
can be empty.
Usage examples:
- There are two locations: locA and locB.
- 1 vehicle starting its route at locA and ending it at locA.
- 1 pickup visit request at locB.
`
model { vehicles { start_tags: "locA" end_tags: "locA" } shipments { pickups { tags: "locB" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_dst_tags: "locA" duration_distance_matrix_dst_tags: "locB" duration_distance_matrices { rows { # from: locA durations { seconds: 0 } meters: 0 # to: locA durations { seconds: 100 } meters: 1000 # to: locB } rows { # from: locB durations { seconds: 102 } meters: 990 # to: locA durations { seconds: 0 } meters: 0 # to: locB } } }
- There are three locations: locA, locB and locC.
- 1 vehicle starting its route at locA and ending it at locB, using matrix "fast".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "slow".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "fast".
- 1 pickup visit request at locC.
`model { vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } shipments { pickups { tags: "locC" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_src_tags: "locC" duration_distance_matrix_dst_tags: "locB" duration_distance_matrix_dst_tags: "locC" duration_distance_matrices { vehicle_start_tag: "fast" rows { # from: locA durations { seconds: 1000 } meters: 2000 # to: locB durations { seconds: 600 } meters: 1000 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 700 } meters: 1200 # to: locC } rows { # from: locC durations { seconds: 702 } meters: 1190 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } duration_distance_matrices { vehicle_start_tag: "slow" rows { # from: locA durations { seconds: 1800 } meters: 2001 # to: locB durations { seconds: 900 } meters: 1002 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 1000 } meters: 1202 # to: locC } rows { # from: locC durations { seconds: 1001 } meters: 1195 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } }
repeated .google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8;
Name | Description |
index | int |
Type | Description |
ShipmentModel.DurationDistanceMatrix.Builder |
addDurationDistanceMatrixDstTags(String value)
public ShipmentModel.Builder addDurationDistanceMatrixDstTags(String value)
Tags defining the destinations of the duration and distance matrices;
duration_distance_matrices(i).rows(j).durations(k)
(resp.
duration_distance_matrices(i).rows(j).meters(k))
defines the duration
(resp. the distance) of the travel from visits with tag
duration_distance_matrix_src_tags(j)
to visits with tag
duration_distance_matrix_dst_tags(k)
in matrix i.
Tags correspond to
VisitRequest.tags
or Vehicle.start_tags.
A given VisitRequest
or Vehicle
must match exactly one tag in this
field. Note that a Vehicle
's source, destination and matrix tags may be
the same; similarly a VisitRequest
's source and destination tags may be
the same. All tags must be different and cannot be empty strings. If this
field is not empty, then duration_distance_matrices
must not be empty.
repeated string duration_distance_matrix_dst_tags = 10;
Name | Description |
value | String The durationDistanceMatrixDstTags to add. |
Type | Description |
ShipmentModel.Builder | This builder for chaining. |
addDurationDistanceMatrixDstTagsBytes(ByteString value)
public ShipmentModel.Builder addDurationDistanceMatrixDstTagsBytes(ByteString value)
Tags defining the destinations of the duration and distance matrices;
duration_distance_matrices(i).rows(j).durations(k)
(resp.
duration_distance_matrices(i).rows(j).meters(k))
defines the duration
(resp. the distance) of the travel from visits with tag
duration_distance_matrix_src_tags(j)
to visits with tag
duration_distance_matrix_dst_tags(k)
in matrix i.
Tags correspond to
VisitRequest.tags
or Vehicle.start_tags.
A given VisitRequest
or Vehicle
must match exactly one tag in this
field. Note that a Vehicle
's source, destination and matrix tags may be
the same; similarly a VisitRequest
's source and destination tags may be
the same. All tags must be different and cannot be empty strings. If this
field is not empty, then duration_distance_matrices
must not be empty.
repeated string duration_distance_matrix_dst_tags = 10;
Name | Description |
value | ByteString The bytes of the durationDistanceMatrixDstTags to add. |
Type | Description |
ShipmentModel.Builder | This builder for chaining. |
addDurationDistanceMatrixSrcTags(String value)
public ShipmentModel.Builder addDurationDistanceMatrixSrcTags(String value)
Tags defining the sources of the duration and distance matrices;
duration_distance_matrices(i).rows(j)
defines durations and distances
from visits with tag duration_distance_matrix_src_tags(j)
to other visits
in matrix i.
Tags correspond to
VisitRequest.tags
or Vehicle.start_tags.
A given VisitRequest
or Vehicle
must match exactly one tag in this
field. Note that a Vehicle
's source, destination and matrix tags may be
the same; similarly a VisitRequest
's source and destination tags may be
the same. All tags must be different and cannot be empty strings. If this
field is not empty, then duration_distance_matrices
must not be empty.
repeated string duration_distance_matrix_src_tags = 9;
Name | Description |
value | String The durationDistanceMatrixSrcTags to add. |
Type | Description |
ShipmentModel.Builder | This builder for chaining. |
addDurationDistanceMatrixSrcTagsBytes(ByteString value)
public ShipmentModel.Builder addDurationDistanceMatrixSrcTagsBytes(ByteString value)
Tags defining the sources of the duration and distance matrices;
duration_distance_matrices(i).rows(j)
defines durations and distances
from visits with tag duration_distance_matrix_src_tags(j)
to other visits
in matrix i.
Tags correspond to
VisitRequest.tags
or Vehicle.start_tags.
A given VisitRequest
or Vehicle
must match exactly one tag in this
field. Note that a Vehicle
's source, destination and matrix tags may be
the same; similarly a VisitRequest
's source and destination tags may be
the same. All tags must be different and cannot be empty strings. If this
field is not empty, then duration_distance_matrices
must not be empty.
repeated string duration_distance_matrix_src_tags = 9;
Name | Description |
value | ByteString The bytes of the durationDistanceMatrixSrcTags to add. |
Type | Description |
ShipmentModel.Builder | This builder for chaining. |
addPrecedenceRules(ShipmentModel.PrecedenceRule value)
public ShipmentModel.Builder addPrecedenceRules(ShipmentModel.PrecedenceRule value)
Set of precedence rules which must be enforced in the model.
repeated .google.cloud.optimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14;
Name | Description |
value | ShipmentModel.PrecedenceRule |
Type | Description |
ShipmentModel.Builder |
addPrecedenceRules(ShipmentModel.PrecedenceRule.Builder builderForValue)
public ShipmentModel.Builder addPrecedenceRules(ShipmentModel.PrecedenceRule.Builder builderForValue)
Set of precedence rules which must be enforced in the model.
repeated .google.cloud.optimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14;
Name | Description |
builderForValue | ShipmentModel.PrecedenceRule.Builder |
Type | Description |
ShipmentModel.Builder |
addPrecedenceRules(int index, ShipmentModel.PrecedenceRule value)
public ShipmentModel.Builder addPrecedenceRules(int index, ShipmentModel.PrecedenceRule value)
Set of precedence rules which must be enforced in the model.
repeated .google.cloud.optimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14;
Name | Description |
index | int |
value | ShipmentModel.PrecedenceRule |
Type | Description |
ShipmentModel.Builder |
addPrecedenceRules(int index, ShipmentModel.PrecedenceRule.Builder builderForValue)
public ShipmentModel.Builder addPrecedenceRules(int index, ShipmentModel.PrecedenceRule.Builder builderForValue)
Set of precedence rules which must be enforced in the model.
repeated .google.cloud.optimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14;
Name | Description |
index | int |
builderForValue | ShipmentModel.PrecedenceRule.Builder |
Type | Description |
ShipmentModel.Builder |
addPrecedenceRulesBuilder()
public ShipmentModel.PrecedenceRule.Builder addPrecedenceRulesBuilder()
Set of precedence rules which must be enforced in the model.
repeated .google.cloud.optimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14;
Type | Description |
ShipmentModel.PrecedenceRule.Builder |
addPrecedenceRulesBuilder(int index)
public ShipmentModel.PrecedenceRule.Builder addPrecedenceRulesBuilder(int index)
Set of precedence rules which must be enforced in the model.
repeated .google.cloud.optimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14;
Name | Description |
index | int |
Type | Description |
ShipmentModel.PrecedenceRule.Builder |
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public ShipmentModel.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Name | Description |
field | FieldDescriptor |
value | Object |
Type | Description |
ShipmentModel.Builder |
addShipmentTypeIncompatibilities(ShipmentTypeIncompatibility value)
public ShipmentModel.Builder addShipmentTypeIncompatibilities(ShipmentTypeIncompatibility value)
Sets of incompatible shipment_types (see ShipmentTypeIncompatibility
).
repeated .google.cloud.optimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12;
Name | Description |
value | ShipmentTypeIncompatibility |
Type | Description |
ShipmentModel.Builder |
addShipmentTypeIncompatibilities(ShipmentTypeIncompatibility.Builder builderForValue)
public ShipmentModel.Builder addShipmentTypeIncompatibilities(ShipmentTypeIncompatibility.Builder builderForValue)
Sets of incompatible shipment_types (see ShipmentTypeIncompatibility
).
repeated .google.cloud.optimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12;
Name | Description |
builderForValue | ShipmentTypeIncompatibility.Builder |
Type | Description |
ShipmentModel.Builder |
addShipmentTypeIncompatibilities(int index, ShipmentTypeIncompatibility value)
public ShipmentModel.Builder addShipmentTypeIncompatibilities(int index, ShipmentTypeIncompatibility value)
Sets of incompatible shipment_types (see ShipmentTypeIncompatibility
).
repeated .google.cloud.optimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12;
Name | Description |
index | int |
value | ShipmentTypeIncompatibility |
Type | Description |
ShipmentModel.Builder |
addShipmentTypeIncompatibilities(int index, ShipmentTypeIncompatibility.Builder builderForValue)
public ShipmentModel.Builder addShipmentTypeIncompatibilities(int index, ShipmentTypeIncompatibility.Builder builderForValue)
Sets of incompatible shipment_types (see ShipmentTypeIncompatibility
).
repeated .google.cloud.optimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12;
Name | Description |
index | int |
builderForValue | ShipmentTypeIncompatibility.Builder |
Type | Description |
ShipmentModel.Builder |
addShipmentTypeIncompatibilitiesBuilder()
public ShipmentTypeIncompatibility.Builder addShipmentTypeIncompatibilitiesBuilder()
Sets of incompatible shipment_types (see ShipmentTypeIncompatibility
).
repeated .google.cloud.optimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12;
Type | Description |
ShipmentTypeIncompatibility.Builder |
addShipmentTypeIncompatibilitiesBuilder(int index)
public ShipmentTypeIncompatibility.Builder addShipmentTypeIncompatibilitiesBuilder(int index)
Sets of incompatible shipment_types (see ShipmentTypeIncompatibility
).
repeated .google.cloud.optimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12;
Name | Description |
index | int |
Type | Description |
ShipmentTypeIncompatibility.Builder |
addShipmentTypeRequirements(ShipmentTypeRequirement value)
public ShipmentModel.Builder addShipmentTypeRequirements(ShipmentTypeRequirement value)
Sets of shipment_type
requirements (see ShipmentTypeRequirement
).
repeated .google.cloud.optimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13;
Name | Description |
value | ShipmentTypeRequirement |
Type | Description |
ShipmentModel.Builder |
addShipmentTypeRequirements(ShipmentTypeRequirement.Builder builderForValue)
public ShipmentModel.Builder addShipmentTypeRequirements(ShipmentTypeRequirement.Builder builderForValue)
Sets of shipment_type
requirements (see ShipmentTypeRequirement
).
repeated .google.cloud.optimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13;
Name | Description |
builderForValue | ShipmentTypeRequirement.Builder |
Type | Description |
ShipmentModel.Builder |
addShipmentTypeRequirements(int index, ShipmentTypeRequirement value)
public ShipmentModel.Builder addShipmentTypeRequirements(int index, ShipmentTypeRequirement value)
Sets of shipment_type
requirements (see ShipmentTypeRequirement
).
repeated .google.cloud.optimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13;
Name | Description |
index | int |
value | ShipmentTypeRequirement |
Type | Description |
ShipmentModel.Builder |
addShipmentTypeRequirements(int index, ShipmentTypeRequirement.Builder builderForValue)
public ShipmentModel.Builder addShipmentTypeRequirements(int index, ShipmentTypeRequirement.Builder builderForValue)
Sets of shipment_type
requirements (see ShipmentTypeRequirement
).
repeated .google.cloud.optimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13;
Name | Description |
index | int |
builderForValue | ShipmentTypeRequirement.Builder |
Type | Description |
ShipmentModel.Builder |
addShipmentTypeRequirementsBuilder()
public ShipmentTypeRequirement.Builder addShipmentTypeRequirementsBuilder()
Sets of shipment_type
requirements (see ShipmentTypeRequirement
).
repeated .google.cloud.optimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13;
Type | Description |
ShipmentTypeRequirement.Builder |
addShipmentTypeRequirementsBuilder(int index)
public ShipmentTypeRequirement.Builder addShipmentTypeRequirementsBuilder(int index)
Sets of shipment_type
requirements (see ShipmentTypeRequirement
).
repeated .google.cloud.optimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13;
Name | Description |
index | int |
Type | Description |
ShipmentTypeRequirement.Builder |
addShipments(Shipment value)
public ShipmentModel.Builder addShipments(Shipment value)
Set of shipments which must be performed in the model.
repeated .google.cloud.optimization.v1.Shipment shipments = 1;
Name | Description |
value | Shipment |
Type | Description |
ShipmentModel.Builder |
addShipments(Shipment.Builder builderForValue)
public ShipmentModel.Builder addShipments(Shipment.Builder builderForValue)
Set of shipments which must be performed in the model.
repeated .google.cloud.optimization.v1.Shipment shipments = 1;
Name | Description |
builderForValue | Shipment.Builder |
Type | Description |
ShipmentModel.Builder |
addShipments(int index, Shipment value)
public ShipmentModel.Builder addShipments(int index, Shipment value)
Set of shipments which must be performed in the model.
repeated .google.cloud.optimization.v1.Shipment shipments = 1;
Name | Description |
index | int |
value | Shipment |
Type | Description |
ShipmentModel.Builder |
addShipments(int index, Shipment.Builder builderForValue)
public ShipmentModel.Builder addShipments(int index, Shipment.Builder builderForValue)
Set of shipments which must be performed in the model.
repeated .google.cloud.optimization.v1.Shipment shipments = 1;
Name | Description |
index | int |
builderForValue | Shipment.Builder |
Type | Description |
ShipmentModel.Builder |
addShipmentsBuilder()
public Shipment.Builder addShipmentsBuilder()
Set of shipments which must be performed in the model.
repeated .google.cloud.optimization.v1.Shipment shipments = 1;
Type | Description |
Shipment.Builder |
addShipmentsBuilder(int index)
public Shipment.Builder addShipmentsBuilder(int index)
Set of shipments which must be performed in the model.
repeated .google.cloud.optimization.v1.Shipment shipments = 1;
Name | Description |
index | int |
Type | Description |
Shipment.Builder |
addTransitionAttributes(TransitionAttributes value)
public ShipmentModel.Builder addTransitionAttributes(TransitionAttributes value)
Transition attributes added to the model.
repeated .google.cloud.optimization.v1.TransitionAttributes transition_attributes = 11;
Name | Description |
value | TransitionAttributes |
Type | Description |
ShipmentModel.Builder |
addTransitionAttributes(TransitionAttributes.Builder builderForValue)
public ShipmentModel.Builder addTransitionAttributes(TransitionAttributes.Builder builderForValue)
Transition attributes added to the model.
repeated .google.cloud.optimization.v1.TransitionAttributes transition_attributes = 11;
Name | Description |
builderForValue | TransitionAttributes.Builder |
Type | Description |
ShipmentModel.Builder |
addTransitionAttributes(int index, TransitionAttributes value)
public ShipmentModel.Builder addTransitionAttributes(int index, TransitionAttributes value)
Transition attributes added to the model.
repeated .google.cloud.optimization.v1.TransitionAttributes transition_attributes = 11;
Name | Description |
index | int |
value | TransitionAttributes |
Type | Description |
ShipmentModel.Builder |
addTransitionAttributes(int index, TransitionAttributes.Builder builderForValue)
public ShipmentModel.Builder addTransitionAttributes(int index, TransitionAttributes.Builder builderForValue)
Transition attributes added to the model.
repeated .google.cloud.optimization.v1.TransitionAttributes transition_attributes = 11;
Name | Description |
index | int |
builderForValue | TransitionAttributes.Builder |
Type | Description |
ShipmentModel.Builder |
addTransitionAttributesBuilder()
public TransitionAttributes.Builder addTransitionAttributesBuilder()
Transition attributes added to the model.
repeated .google.cloud.optimization.v1.TransitionAttributes transition_attributes = 11;
Type | Description |
TransitionAttributes.Builder |
addTransitionAttributesBuilder(int index)
public TransitionAttributes.Builder addTransitionAttributesBuilder(int index)
Transition attributes added to the model.
repeated .google.cloud.optimization.v1.TransitionAttributes transition_attributes = 11;
Name | Description |
index | int |
Type | Description |
TransitionAttributes.Builder |
addVehicles(Vehicle value)
public ShipmentModel.Builder addVehicles(Vehicle value)
Set of vehicles which can be used to perform visits.
repeated .google.cloud.optimization.v1.Vehicle vehicles = 2;
Name | Description |
value | Vehicle |
Type | Description |
ShipmentModel.Builder |
addVehicles(Vehicle.Builder builderForValue)
public ShipmentModel.Builder addVehicles(Vehicle.Builder builderForValue)
Set of vehicles which can be used to perform visits.
repeated .google.cloud.optimization.v1.Vehicle vehicles = 2;
Name | Description |
builderForValue | Vehicle.Builder |
Type | Description |
ShipmentModel.Builder |
addVehicles(int index, Vehicle value)
public ShipmentModel.Builder addVehicles(int index, Vehicle value)
Set of vehicles which can be used to perform visits.
repeated .google.cloud.optimization.v1.Vehicle vehicles = 2;
Name | Description |
index | int |
value | Vehicle |
Type | Description |
ShipmentModel.Builder |
addVehicles(int index, Vehicle.Builder builderForValue)
public ShipmentModel.Builder addVehicles(int index, Vehicle.Builder builderForValue)
Set of vehicles which can be used to perform visits.
repeated .google.cloud.optimization.v1.Vehicle vehicles = 2;
Name | Description |
index | int |
builderForValue | Vehicle.Builder |
Type | Description |
ShipmentModel.Builder |
addVehiclesBuilder()
public Vehicle.Builder addVehiclesBuilder()
Set of vehicles which can be used to perform visits.
repeated .google.cloud.optimization.v1.Vehicle vehicles = 2;
Type | Description |
Vehicle.Builder |
addVehiclesBuilder(int index)
public Vehicle.Builder addVehiclesBuilder(int index)
Set of vehicles which can be used to perform visits.
repeated .google.cloud.optimization.v1.Vehicle vehicles = 2;
Name | Description |
index | int |
Type | Description |
Vehicle.Builder |
build()
public ShipmentModel build()
Type | Description |
ShipmentModel |
buildPartial()
public ShipmentModel buildPartial()
Type | Description |
ShipmentModel |
clear()
public ShipmentModel.Builder clear()
Type | Description |
ShipmentModel.Builder |
clearBreakRules()
public ShipmentModel.Builder clearBreakRules()
Deprecated: No longer used.
Set of break rules used in the model.
Each vehicle specifies the BreakRule
that applies to it via the
Vehicle.break_rule_indices field (which must be a singleton).
repeated .google.cloud.optimization.v1.ShipmentModel.BreakRule break_rules = 15 [deprecated = true];
Type | Description |
ShipmentModel.Builder |
clearDurationDistanceMatrices()
public ShipmentModel.Builder clearDurationDistanceMatrices()
Specifies duration and distance matrices used in the model. If this field
is empty, Google Maps or geodesic distances will be used instead, depending
on the value of the use_geodesic_distances
field. If it is not empty,
use_geodesic_distances
cannot be true and neither
duration_distance_matrix_src_tags
nor duration_distance_matrix_dst_tags
can be empty.
Usage examples:
- There are two locations: locA and locB.
- 1 vehicle starting its route at locA and ending it at locA.
- 1 pickup visit request at locB.
`
model { vehicles { start_tags: "locA" end_tags: "locA" } shipments { pickups { tags: "locB" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_dst_tags: "locA" duration_distance_matrix_dst_tags: "locB" duration_distance_matrices { rows { # from: locA durations { seconds: 0 } meters: 0 # to: locA durations { seconds: 100 } meters: 1000 # to: locB } rows { # from: locB durations { seconds: 102 } meters: 990 # to: locA durations { seconds: 0 } meters: 0 # to: locB } } }
- There are three locations: locA, locB and locC.
- 1 vehicle starting its route at locA and ending it at locB, using matrix "fast".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "slow".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "fast".
- 1 pickup visit request at locC.
`model { vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } shipments { pickups { tags: "locC" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_src_tags: "locC" duration_distance_matrix_dst_tags: "locB" duration_distance_matrix_dst_tags: "locC" duration_distance_matrices { vehicle_start_tag: "fast" rows { # from: locA durations { seconds: 1000 } meters: 2000 # to: locB durations { seconds: 600 } meters: 1000 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 700 } meters: 1200 # to: locC } rows { # from: locC durations { seconds: 702 } meters: 1190 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } duration_distance_matrices { vehicle_start_tag: "slow" rows { # from: locA durations { seconds: 1800 } meters: 2001 # to: locB durations { seconds: 900 } meters: 1002 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 1000 } meters: 1202 # to: locC } rows { # from: locC durations { seconds: 1001 } meters: 1195 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } }
repeated .google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8;
Type | Description |
ShipmentModel.Builder |
clearDurationDistanceMatrixDstTags()
public ShipmentModel.Builder clearDurationDistanceMatrixDstTags()
Tags defining the destinations of the duration and distance matrices;
duration_distance_matrices(i).rows(j).durations(k)
(resp.
duration_distance_matrices(i).rows(j).meters(k))
defines the duration
(resp. the distance) of the travel from visits with tag
duration_distance_matrix_src_tags(j)
to visits with tag
duration_distance_matrix_dst_tags(k)
in matrix i.
Tags correspond to
VisitRequest.tags
or Vehicle.start_tags.
A given VisitRequest
or Vehicle
must match exactly one tag in this
field. Note that a Vehicle
's source, destination and matrix tags may be
the same; similarly a VisitRequest
's source and destination tags may be
the same. All tags must be different and cannot be empty strings. If this
field is not empty, then duration_distance_matrices
must not be empty.
repeated string duration_distance_matrix_dst_tags = 10;
Type | Description |
ShipmentModel.Builder | This builder for chaining. |
clearDurationDistanceMatrixSrcTags()
public ShipmentModel.Builder clearDurationDistanceMatrixSrcTags()
Tags defining the sources of the duration and distance matrices;
duration_distance_matrices(i).rows(j)
defines durations and distances
from visits with tag duration_distance_matrix_src_tags(j)
to other visits
in matrix i.
Tags correspond to
VisitRequest.tags
or Vehicle.start_tags.
A given VisitRequest
or Vehicle
must match exactly one tag in this
field. Note that a Vehicle
's source, destination and matrix tags may be
the same; similarly a VisitRequest
's source and destination tags may be
the same. All tags must be different and cannot be empty strings. If this
field is not empty, then duration_distance_matrices
must not be empty.
repeated string duration_distance_matrix_src_tags = 9;
Type | Description |
ShipmentModel.Builder | This builder for chaining. |
clearField(Descriptors.FieldDescriptor field)
public ShipmentModel.Builder clearField(Descriptors.FieldDescriptor field)
Name | Description |
field | FieldDescriptor |
Type | Description |
ShipmentModel.Builder |
clearGlobalDurationCostPerHour()
public ShipmentModel.Builder clearGlobalDurationCostPerHour()
The "global duration" of the overall plan is the difference between the earliest effective start time and the latest effective end time of all vehicles. Users can assign a cost per hour to that quantity to try and optimize for earliest job completion, for example. This cost must be in the same unit as Shipment.penalty_cost.
double global_duration_cost_per_hour = 7;
Type | Description |
ShipmentModel.Builder | This builder for chaining. |
clearGlobalEndTime()
public ShipmentModel.Builder clearGlobalEndTime()
If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0) is used as default.
.google.protobuf.Timestamp global_end_time = 6;
Type | Description |
ShipmentModel.Builder |
clearGlobalStartTime()
public ShipmentModel.Builder clearGlobalStartTime()
Global start and end time of the model: no times outside of this range
can be considered valid.
The model's time span must be less than a year, i.e. the global_end_time
and the global_start_time
must be within 31536000 seconds of each other.
When using cost_per_*hour
fields, you might want to set this window to a
smaller interval to increase performance (eg. if you model a single day,
you should set the global time limits to that day).
If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used
as default.
.google.protobuf.Timestamp global_start_time = 5;
Type | Description |
ShipmentModel.Builder |
clearMaxActiveVehicles()
public ShipmentModel.Builder clearMaxActiveVehicles()
Constrains the maximum number of active vehicles. A vehicle is active if its route performs at least one shipment. This can be used to limit the number of routes in the case where there are fewer drivers than vehicles and that the fleet of vehicles is heterogeneous. The optimization will then select the best subset of vehicles to use. Must be strictly positive.
optional int32 max_active_vehicles = 4;
Type | Description |
ShipmentModel.Builder | This builder for chaining. |
clearOneof(Descriptors.OneofDescriptor oneof)
public ShipmentModel.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Name | Description |
oneof | OneofDescriptor |
Type | Description |
ShipmentModel.Builder |
clearPrecedenceRules()
public ShipmentModel.Builder clearPrecedenceRules()
Set of precedence rules which must be enforced in the model.
repeated .google.cloud.optimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14;
Type | Description |
ShipmentModel.Builder |
clearShipmentTypeIncompatibilities()
public ShipmentModel.Builder clearShipmentTypeIncompatibilities()
Sets of incompatible shipment_types (see ShipmentTypeIncompatibility
).
repeated .google.cloud.optimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12;
Type | Description |
ShipmentModel.Builder |
clearShipmentTypeRequirements()
public ShipmentModel.Builder clearShipmentTypeRequirements()
Sets of shipment_type
requirements (see ShipmentTypeRequirement
).
repeated .google.cloud.optimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13;
Type | Description |
ShipmentModel.Builder |
clearShipments()
public ShipmentModel.Builder clearShipments()
Set of shipments which must be performed in the model.
repeated .google.cloud.optimization.v1.Shipment shipments = 1;
Type | Description |
ShipmentModel.Builder |
clearTransitionAttributes()
public ShipmentModel.Builder clearTransitionAttributes()
Transition attributes added to the model.
repeated .google.cloud.optimization.v1.TransitionAttributes transition_attributes = 11;
Type | Description |
ShipmentModel.Builder |
clearVehicles()
public ShipmentModel.Builder clearVehicles()
Set of vehicles which can be used to perform visits.
repeated .google.cloud.optimization.v1.Vehicle vehicles = 2;
Type | Description |
ShipmentModel.Builder |
clone()
public ShipmentModel.Builder clone()
Type | Description |
ShipmentModel.Builder |
getBreakRules(int index)
public ShipmentModel.BreakRule getBreakRules(int index)
Deprecated: No longer used.
Set of break rules used in the model.
Each vehicle specifies the BreakRule
that applies to it via the
Vehicle.break_rule_indices field (which must be a singleton).
repeated .google.cloud.optimization.v1.ShipmentModel.BreakRule break_rules = 15 [deprecated = true];
Name | Description |
index | int |
Type | Description |
ShipmentModel.BreakRule |
getBreakRulesBuilder(int index)
public ShipmentModel.BreakRule.Builder getBreakRulesBuilder(int index)
Deprecated: No longer used.
Set of break rules used in the model.
Each vehicle specifies the BreakRule
that applies to it via the
Vehicle.break_rule_indices field (which must be a singleton).
repeated .google.cloud.optimization.v1.ShipmentModel.BreakRule break_rules = 15 [deprecated = true];
Name | Description |
index | int |
Type | Description |
ShipmentModel.BreakRule.Builder |
getBreakRulesBuilderList()
public List<ShipmentModel.BreakRule.Builder> getBreakRulesBuilderList()
Deprecated: No longer used.
Set of break rules used in the model.
Each vehicle specifies the BreakRule
that applies to it via the
Vehicle.break_rule_indices field (which must be a singleton).
repeated .google.cloud.optimization.v1.ShipmentModel.BreakRule break_rules = 15 [deprecated = true];
Type | Description |
List<Builder> |
getBreakRulesCount()
public int getBreakRulesCount()
Deprecated: No longer used.
Set of break rules used in the model.
Each vehicle specifies the BreakRule
that applies to it via the
Vehicle.break_rule_indices field (which must be a singleton).
repeated .google.cloud.optimization.v1.ShipmentModel.BreakRule break_rules = 15 [deprecated = true];
Type | Description |
int |
getBreakRulesList()
public List<ShipmentModel.BreakRule> getBreakRulesList()
Deprecated: No longer used.
Set of break rules used in the model.
Each vehicle specifies the BreakRule
that applies to it via the
Vehicle.break_rule_indices field (which must be a singleton).
repeated .google.cloud.optimization.v1.ShipmentModel.BreakRule break_rules = 15 [deprecated = true];
Type | Description |
List<BreakRule> |
getBreakRulesOrBuilder(int index)
public ShipmentModel.BreakRuleOrBuilder getBreakRulesOrBuilder(int index)
Deprecated: No longer used.
Set of break rules used in the model.
Each vehicle specifies the BreakRule
that applies to it via the
Vehicle.break_rule_indices field (which must be a singleton).
repeated .google.cloud.optimization.v1.ShipmentModel.BreakRule break_rules = 15 [deprecated = true];
Name | Description |
index | int |
Type | Description |
ShipmentModel.BreakRuleOrBuilder |
getBreakRulesOrBuilderList()
public List<? extends ShipmentModel.BreakRuleOrBuilder> getBreakRulesOrBuilderList()
Deprecated: No longer used.
Set of break rules used in the model.
Each vehicle specifies the BreakRule
that applies to it via the
Vehicle.break_rule_indices field (which must be a singleton).
repeated .google.cloud.optimization.v1.ShipmentModel.BreakRule break_rules = 15 [deprecated = true];
Type | Description |
List<? extends com.google.cloud.optimization.v1.ShipmentModel.BreakRuleOrBuilder> |
getDefaultInstanceForType()
public ShipmentModel getDefaultInstanceForType()
Type | Description |
ShipmentModel |
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Type | Description |
Descriptor |
getDurationDistanceMatrices(int index)
public ShipmentModel.DurationDistanceMatrix getDurationDistanceMatrices(int index)
Specifies duration and distance matrices used in the model. If this field
is empty, Google Maps or geodesic distances will be used instead, depending
on the value of the use_geodesic_distances
field. If it is not empty,
use_geodesic_distances
cannot be true and neither
duration_distance_matrix_src_tags
nor duration_distance_matrix_dst_tags
can be empty.
Usage examples:
- There are two locations: locA and locB.
- 1 vehicle starting its route at locA and ending it at locA.
- 1 pickup visit request at locB.
`
model { vehicles { start_tags: "locA" end_tags: "locA" } shipments { pickups { tags: "locB" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_dst_tags: "locA" duration_distance_matrix_dst_tags: "locB" duration_distance_matrices { rows { # from: locA durations { seconds: 0 } meters: 0 # to: locA durations { seconds: 100 } meters: 1000 # to: locB } rows { # from: locB durations { seconds: 102 } meters: 990 # to: locA durations { seconds: 0 } meters: 0 # to: locB } } }
- There are three locations: locA, locB and locC.
- 1 vehicle starting its route at locA and ending it at locB, using matrix "fast".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "slow".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "fast".
- 1 pickup visit request at locC.
`model { vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } shipments { pickups { tags: "locC" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_src_tags: "locC" duration_distance_matrix_dst_tags: "locB" duration_distance_matrix_dst_tags: "locC" duration_distance_matrices { vehicle_start_tag: "fast" rows { # from: locA durations { seconds: 1000 } meters: 2000 # to: locB durations { seconds: 600 } meters: 1000 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 700 } meters: 1200 # to: locC } rows { # from: locC durations { seconds: 702 } meters: 1190 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } duration_distance_matrices { vehicle_start_tag: "slow" rows { # from: locA durations { seconds: 1800 } meters: 2001 # to: locB durations { seconds: 900 } meters: 1002 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 1000 } meters: 1202 # to: locC } rows { # from: locC durations { seconds: 1001 } meters: 1195 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } }
repeated .google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8;
Name | Description |
index | int |
Type | Description |
ShipmentModel.DurationDistanceMatrix |
getDurationDistanceMatricesBuilder(int index)
public ShipmentModel.DurationDistanceMatrix.Builder getDurationDistanceMatricesBuilder(int index)
Specifies duration and distance matrices used in the model. If this field
is empty, Google Maps or geodesic distances will be used instead, depending
on the value of the use_geodesic_distances
field. If it is not empty,
use_geodesic_distances
cannot be true and neither
duration_distance_matrix_src_tags
nor duration_distance_matrix_dst_tags
can be empty.
Usage examples:
- There are two locations: locA and locB.
- 1 vehicle starting its route at locA and ending it at locA.
- 1 pickup visit request at locB.
`
model { vehicles { start_tags: "locA" end_tags: "locA" } shipments { pickups { tags: "locB" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_dst_tags: "locA" duration_distance_matrix_dst_tags: "locB" duration_distance_matrices { rows { # from: locA durations { seconds: 0 } meters: 0 # to: locA durations { seconds: 100 } meters: 1000 # to: locB } rows { # from: locB durations { seconds: 102 } meters: 990 # to: locA durations { seconds: 0 } meters: 0 # to: locB } } }
- There are three locations: locA, locB and locC.
- 1 vehicle starting its route at locA and ending it at locB, using matrix "fast".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "slow".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "fast".
- 1 pickup visit request at locC.
`model { vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } shipments { pickups { tags: "locC" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_src_tags: "locC" duration_distance_matrix_dst_tags: "locB" duration_distance_matrix_dst_tags: "locC" duration_distance_matrices { vehicle_start_tag: "fast" rows { # from: locA durations { seconds: 1000 } meters: 2000 # to: locB durations { seconds: 600 } meters: 1000 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 700 } meters: 1200 # to: locC } rows { # from: locC durations { seconds: 702 } meters: 1190 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } duration_distance_matrices { vehicle_start_tag: "slow" rows { # from: locA durations { seconds: 1800 } meters: 2001 # to: locB durations { seconds: 900 } meters: 1002 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 1000 } meters: 1202 # to: locC } rows { # from: locC durations { seconds: 1001 } meters: 1195 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } }
repeated .google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8;
Name | Description |
index | int |
Type | Description |
ShipmentModel.DurationDistanceMatrix.Builder |
getDurationDistanceMatricesBuilderList()
public List<ShipmentModel.DurationDistanceMatrix.Builder> getDurationDistanceMatricesBuilderList()
Specifies duration and distance matrices used in the model. If this field
is empty, Google Maps or geodesic distances will be used instead, depending
on the value of the use_geodesic_distances
field. If it is not empty,
use_geodesic_distances
cannot be true and neither
duration_distance_matrix_src_tags
nor duration_distance_matrix_dst_tags
can be empty.
Usage examples:
- There are two locations: locA and locB.
- 1 vehicle starting its route at locA and ending it at locA.
- 1 pickup visit request at locB.
`
model { vehicles { start_tags: "locA" end_tags: "locA" } shipments { pickups { tags: "locB" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_dst_tags: "locA" duration_distance_matrix_dst_tags: "locB" duration_distance_matrices { rows { # from: locA durations { seconds: 0 } meters: 0 # to: locA durations { seconds: 100 } meters: 1000 # to: locB } rows { # from: locB durations { seconds: 102 } meters: 990 # to: locA durations { seconds: 0 } meters: 0 # to: locB } } }
- There are three locations: locA, locB and locC.
- 1 vehicle starting its route at locA and ending it at locB, using matrix "fast".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "slow".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "fast".
- 1 pickup visit request at locC.
`model { vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } shipments { pickups { tags: "locC" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_src_tags: "locC" duration_distance_matrix_dst_tags: "locB" duration_distance_matrix_dst_tags: "locC" duration_distance_matrices { vehicle_start_tag: "fast" rows { # from: locA durations { seconds: 1000 } meters: 2000 # to: locB durations { seconds: 600 } meters: 1000 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 700 } meters: 1200 # to: locC } rows { # from: locC durations { seconds: 702 } meters: 1190 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } duration_distance_matrices { vehicle_start_tag: "slow" rows { # from: locA durations { seconds: 1800 } meters: 2001 # to: locB durations { seconds: 900 } meters: 1002 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 1000 } meters: 1202 # to: locC } rows { # from: locC durations { seconds: 1001 } meters: 1195 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } }
repeated .google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8;
Type | Description |
List<Builder> |
getDurationDistanceMatricesCount()
public int getDurationDistanceMatricesCount()
Specifies duration and distance matrices used in the model. If this field
is empty, Google Maps or geodesic distances will be used instead, depending
on the value of the use_geodesic_distances
field. If it is not empty,
use_geodesic_distances
cannot be true and neither
duration_distance_matrix_src_tags
nor duration_distance_matrix_dst_tags
can be empty.
Usage examples:
- There are two locations: locA and locB.
- 1 vehicle starting its route at locA and ending it at locA.
- 1 pickup visit request at locB.
`
model { vehicles { start_tags: "locA" end_tags: "locA" } shipments { pickups { tags: "locB" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_dst_tags: "locA" duration_distance_matrix_dst_tags: "locB" duration_distance_matrices { rows { # from: locA durations { seconds: 0 } meters: 0 # to: locA durations { seconds: 100 } meters: 1000 # to: locB } rows { # from: locB durations { seconds: 102 } meters: 990 # to: locA durations { seconds: 0 } meters: 0 # to: locB } } }
- There are three locations: locA, locB and locC.
- 1 vehicle starting its route at locA and ending it at locB, using matrix "fast".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "slow".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "fast".
- 1 pickup visit request at locC.
`model { vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } shipments { pickups { tags: "locC" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_src_tags: "locC" duration_distance_matrix_dst_tags: "locB" duration_distance_matrix_dst_tags: "locC" duration_distance_matrices { vehicle_start_tag: "fast" rows { # from: locA durations { seconds: 1000 } meters: 2000 # to: locB durations { seconds: 600 } meters: 1000 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 700 } meters: 1200 # to: locC } rows { # from: locC durations { seconds: 702 } meters: 1190 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } duration_distance_matrices { vehicle_start_tag: "slow" rows { # from: locA durations { seconds: 1800 } meters: 2001 # to: locB durations { seconds: 900 } meters: 1002 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 1000 } meters: 1202 # to: locC } rows { # from: locC durations { seconds: 1001 } meters: 1195 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } }
repeated .google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8;
Type | Description |
int |
getDurationDistanceMatricesList()
public List<ShipmentModel.DurationDistanceMatrix> getDurationDistanceMatricesList()
Specifies duration and distance matrices used in the model. If this field
is empty, Google Maps or geodesic distances will be used instead, depending
on the value of the use_geodesic_distances
field. If it is not empty,
use_geodesic_distances
cannot be true and neither
duration_distance_matrix_src_tags
nor duration_distance_matrix_dst_tags
can be empty.
Usage examples:
- There are two locations: locA and locB.
- 1 vehicle starting its route at locA and ending it at locA.
- 1 pickup visit request at locB.
`
model { vehicles { start_tags: "locA" end_tags: "locA" } shipments { pickups { tags: "locB" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_dst_tags: "locA" duration_distance_matrix_dst_tags: "locB" duration_distance_matrices { rows { # from: locA durations { seconds: 0 } meters: 0 # to: locA durations { seconds: 100 } meters: 1000 # to: locB } rows { # from: locB durations { seconds: 102 } meters: 990 # to: locA durations { seconds: 0 } meters: 0 # to: locB } } }
- There are three locations: locA, locB and locC.
- 1 vehicle starting its route at locA and ending it at locB, using matrix "fast".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "slow".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "fast".
- 1 pickup visit request at locC.
`model { vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } shipments { pickups { tags: "locC" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_src_tags: "locC" duration_distance_matrix_dst_tags: "locB" duration_distance_matrix_dst_tags: "locC" duration_distance_matrices { vehicle_start_tag: "fast" rows { # from: locA durations { seconds: 1000 } meters: 2000 # to: locB durations { seconds: 600 } meters: 1000 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 700 } meters: 1200 # to: locC } rows { # from: locC durations { seconds: 702 } meters: 1190 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } duration_distance_matrices { vehicle_start_tag: "slow" rows { # from: locA durations { seconds: 1800 } meters: 2001 # to: locB durations { seconds: 900 } meters: 1002 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 1000 } meters: 1202 # to: locC } rows { # from: locC durations { seconds: 1001 } meters: 1195 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } }
repeated .google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8;
Type | Description |
List<DurationDistanceMatrix> |
getDurationDistanceMatricesOrBuilder(int index)
public ShipmentModel.DurationDistanceMatrixOrBuilder getDurationDistanceMatricesOrBuilder(int index)
Specifies duration and distance matrices used in the model. If this field
is empty, Google Maps or geodesic distances will be used instead, depending
on the value of the use_geodesic_distances
field. If it is not empty,
use_geodesic_distances
cannot be true and neither
duration_distance_matrix_src_tags
nor duration_distance_matrix_dst_tags
can be empty.
Usage examples:
- There are two locations: locA and locB.
- 1 vehicle starting its route at locA and ending it at locA.
- 1 pickup visit request at locB.
`
model { vehicles { start_tags: "locA" end_tags: "locA" } shipments { pickups { tags: "locB" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_dst_tags: "locA" duration_distance_matrix_dst_tags: "locB" duration_distance_matrices { rows { # from: locA durations { seconds: 0 } meters: 0 # to: locA durations { seconds: 100 } meters: 1000 # to: locB } rows { # from: locB durations { seconds: 102 } meters: 990 # to: locA durations { seconds: 0 } meters: 0 # to: locB } } }
- There are three locations: locA, locB and locC.
- 1 vehicle starting its route at locA and ending it at locB, using matrix "fast".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "slow".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "fast".
- 1 pickup visit request at locC.
`model { vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } shipments { pickups { tags: "locC" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_src_tags: "locC" duration_distance_matrix_dst_tags: "locB" duration_distance_matrix_dst_tags: "locC" duration_distance_matrices { vehicle_start_tag: "fast" rows { # from: locA durations { seconds: 1000 } meters: 2000 # to: locB durations { seconds: 600 } meters: 1000 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 700 } meters: 1200 # to: locC } rows { # from: locC durations { seconds: 702 } meters: 1190 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } duration_distance_matrices { vehicle_start_tag: "slow" rows { # from: locA durations { seconds: 1800 } meters: 2001 # to: locB durations { seconds: 900 } meters: 1002 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 1000 } meters: 1202 # to: locC } rows { # from: locC durations { seconds: 1001 } meters: 1195 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } }
repeated .google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8;
Name | Description |
index | int |
Type | Description |
ShipmentModel.DurationDistanceMatrixOrBuilder |
getDurationDistanceMatricesOrBuilderList()
public List<? extends ShipmentModel.DurationDistanceMatrixOrBuilder> getDurationDistanceMatricesOrBuilderList()
Specifies duration and distance matrices used in the model. If this field
is empty, Google Maps or geodesic distances will be used instead, depending
on the value of the use_geodesic_distances
field. If it is not empty,
use_geodesic_distances
cannot be true and neither
duration_distance_matrix_src_tags
nor duration_distance_matrix_dst_tags
can be empty.
Usage examples:
- There are two locations: locA and locB.
- 1 vehicle starting its route at locA and ending it at locA.
- 1 pickup visit request at locB.
`
model { vehicles { start_tags: "locA" end_tags: "locA" } shipments { pickups { tags: "locB" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_dst_tags: "locA" duration_distance_matrix_dst_tags: "locB" duration_distance_matrices { rows { # from: locA durations { seconds: 0 } meters: 0 # to: locA durations { seconds: 100 } meters: 1000 # to: locB } rows { # from: locB durations { seconds: 102 } meters: 990 # to: locA durations { seconds: 0 } meters: 0 # to: locB } } }
- There are three locations: locA, locB and locC.
- 1 vehicle starting its route at locA and ending it at locB, using matrix "fast".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "slow".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "fast".
- 1 pickup visit request at locC.
`model { vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } shipments { pickups { tags: "locC" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_src_tags: "locC" duration_distance_matrix_dst_tags: "locB" duration_distance_matrix_dst_tags: "locC" duration_distance_matrices { vehicle_start_tag: "fast" rows { # from: locA durations { seconds: 1000 } meters: 2000 # to: locB durations { seconds: 600 } meters: 1000 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 700 } meters: 1200 # to: locC } rows { # from: locC durations { seconds: 702 } meters: 1190 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } duration_distance_matrices { vehicle_start_tag: "slow" rows { # from: locA durations { seconds: 1800 } meters: 2001 # to: locB durations { seconds: 900 } meters: 1002 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 1000 } meters: 1202 # to: locC } rows { # from: locC durations { seconds: 1001 } meters: 1195 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } }
repeated .google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8;
Type | Description |
List<? extends com.google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrixOrBuilder> |
getDurationDistanceMatrixDstTags(int index)
public String getDurationDistanceMatrixDstTags(int index)
Tags defining the destinations of the duration and distance matrices;
duration_distance_matrices(i).rows(j).durations(k)
(resp.
duration_distance_matrices(i).rows(j).meters(k))
defines the duration
(resp. the distance) of the travel from visits with tag
duration_distance_matrix_src_tags(j)
to visits with tag
duration_distance_matrix_dst_tags(k)
in matrix i.
Tags correspond to
VisitRequest.tags
or Vehicle.start_tags.
A given VisitRequest
or Vehicle
must match exactly one tag in this
field. Note that a Vehicle
's source, destination and matrix tags may be
the same; similarly a VisitRequest
's source and destination tags may be
the same. All tags must be different and cannot be empty strings. If this
field is not empty, then duration_distance_matrices
must not be empty.
repeated string duration_distance_matrix_dst_tags = 10;
Name | Description |
index | int The index of the element to return. |
Type | Description |
String | The durationDistanceMatrixDstTags at the given index. |
getDurationDistanceMatrixDstTagsBytes(int index)
public ByteString getDurationDistanceMatrixDstTagsBytes(int index)
Tags defining the destinations of the duration and distance matrices;
duration_distance_matrices(i).rows(j).durations(k)
(resp.
duration_distance_matrices(i).rows(j).meters(k))
defines the duration
(resp. the distance) of the travel from visits with tag
duration_distance_matrix_src_tags(j)
to visits with tag
duration_distance_matrix_dst_tags(k)
in matrix i.
Tags correspond to
VisitRequest.tags
or Vehicle.start_tags.
A given VisitRequest
or Vehicle
must match exactly one tag in this
field. Note that a Vehicle
's source, destination and matrix tags may be
the same; similarly a VisitRequest
's source and destination tags may be
the same. All tags must be different and cannot be empty strings. If this
field is not empty, then duration_distance_matrices
must not be empty.
repeated string duration_distance_matrix_dst_tags = 10;
Name | Description |
index | int The index of the value to return. |
Type | Description |
ByteString | The bytes of the durationDistanceMatrixDstTags at the given index. |
getDurationDistanceMatrixDstTagsCount()
public int getDurationDistanceMatrixDstTagsCount()
Tags defining the destinations of the duration and distance matrices;
duration_distance_matrices(i).rows(j).durations(k)
(resp.
duration_distance_matrices(i).rows(j).meters(k))
defines the duration
(resp. the distance) of the travel from visits with tag
duration_distance_matrix_src_tags(j)
to visits with tag
duration_distance_matrix_dst_tags(k)
in matrix i.
Tags correspond to
VisitRequest.tags
or Vehicle.start_tags.
A given VisitRequest
or Vehicle
must match exactly one tag in this
field. Note that a Vehicle
's source, destination and matrix tags may be
the same; similarly a VisitRequest
's source and destination tags may be
the same. All tags must be different and cannot be empty strings. If this
field is not empty, then duration_distance_matrices
must not be empty.
repeated string duration_distance_matrix_dst_tags = 10;
Type | Description |
int | The count of durationDistanceMatrixDstTags. |
getDurationDistanceMatrixDstTagsList()
public ProtocolStringList getDurationDistanceMatrixDstTagsList()
Tags defining the destinations of the duration and distance matrices;
duration_distance_matrices(i).rows(j).durations(k)
(resp.
duration_distance_matrices(i).rows(j).meters(k))
defines the duration
(resp. the distance) of the travel from visits with tag
duration_distance_matrix_src_tags(j)
to visits with tag
duration_distance_matrix_dst_tags(k)
in matrix i.
Tags correspond to
VisitRequest.tags
or Vehicle.start_tags.
A given VisitRequest
or Vehicle
must match exactly one tag in this
field. Note that a Vehicle
's source, destination and matrix tags may be
the same; similarly a VisitRequest
's source and destination tags may be
the same. All tags must be different and cannot be empty strings. If this
field is not empty, then duration_distance_matrices
must not be empty.
repeated string duration_distance_matrix_dst_tags = 10;
Type | Description |
ProtocolStringList | A list containing the durationDistanceMatrixDstTags. |
getDurationDistanceMatrixSrcTags(int index)
public String getDurationDistanceMatrixSrcTags(int index)
Tags defining the sources of the duration and distance matrices;
duration_distance_matrices(i).rows(j)
defines durations and distances
from visits with tag duration_distance_matrix_src_tags(j)
to other visits
in matrix i.
Tags correspond to
VisitRequest.tags
or Vehicle.start_tags.
A given VisitRequest
or Vehicle
must match exactly one tag in this
field. Note that a Vehicle
's source, destination and matrix tags may be
the same; similarly a VisitRequest
's source and destination tags may be
the same. All tags must be different and cannot be empty strings. If this
field is not empty, then duration_distance_matrices
must not be empty.
repeated string duration_distance_matrix_src_tags = 9;
Name | Description |
index | int The index of the element to return. |
Type | Description |
String | The durationDistanceMatrixSrcTags at the given index. |
getDurationDistanceMatrixSrcTagsBytes(int index)
public ByteString getDurationDistanceMatrixSrcTagsBytes(int index)
Tags defining the sources of the duration and distance matrices;
duration_distance_matrices(i).rows(j)
defines durations and distances
from visits with tag duration_distance_matrix_src_tags(j)
to other visits
in matrix i.
Tags correspond to
VisitRequest.tags
or Vehicle.start_tags.
A given VisitRequest
or Vehicle
must match exactly one tag in this
field. Note that a Vehicle
's source, destination and matrix tags may be
the same; similarly a VisitRequest
's source and destination tags may be
the same. All tags must be different and cannot be empty strings. If this
field is not empty, then duration_distance_matrices
must not be empty.
repeated string duration_distance_matrix_src_tags = 9;
Name | Description |
index | int The index of the value to return. |
Type | Description |
ByteString | The bytes of the durationDistanceMatrixSrcTags at the given index. |
getDurationDistanceMatrixSrcTagsCount()
public int getDurationDistanceMatrixSrcTagsCount()
Tags defining the sources of the duration and distance matrices;
duration_distance_matrices(i).rows(j)
defines durations and distances
from visits with tag duration_distance_matrix_src_tags(j)
to other visits
in matrix i.
Tags correspond to
VisitRequest.tags
or Vehicle.start_tags.
A given VisitRequest
or Vehicle
must match exactly one tag in this
field. Note that a Vehicle
's source, destination and matrix tags may be
the same; similarly a VisitRequest
's source and destination tags may be
the same. All tags must be different and cannot be empty strings. If this
field is not empty, then duration_distance_matrices
must not be empty.
repeated string duration_distance_matrix_src_tags = 9;
Type | Description |
int | The count of durationDistanceMatrixSrcTags. |
getDurationDistanceMatrixSrcTagsList()
public ProtocolStringList getDurationDistanceMatrixSrcTagsList()
Tags defining the sources of the duration and distance matrices;
duration_distance_matrices(i).rows(j)
defines durations and distances
from visits with tag duration_distance_matrix_src_tags(j)
to other visits
in matrix i.
Tags correspond to
VisitRequest.tags
or Vehicle.start_tags.
A given VisitRequest
or Vehicle
must match exactly one tag in this
field. Note that a Vehicle
's source, destination and matrix tags may be
the same; similarly a VisitRequest
's source and destination tags may be
the same. All tags must be different and cannot be empty strings. If this
field is not empty, then duration_distance_matrices
must not be empty.
repeated string duration_distance_matrix_src_tags = 9;
Type | Description |
ProtocolStringList | A list containing the durationDistanceMatrixSrcTags. |
getGlobalDurationCostPerHour()
public double getGlobalDurationCostPerHour()
The "global duration" of the overall plan is the difference between the earliest effective start time and the latest effective end time of all vehicles. Users can assign a cost per hour to that quantity to try and optimize for earliest job completion, for example. This cost must be in the same unit as Shipment.penalty_cost.
double global_duration_cost_per_hour = 7;
Type | Description |
double | The globalDurationCostPerHour. |
getGlobalEndTime()
public Timestamp getGlobalEndTime()
If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0) is used as default.
.google.protobuf.Timestamp global_end_time = 6;
Type | Description |
Timestamp | The globalEndTime. |
getGlobalEndTimeBuilder()
public Timestamp.Builder getGlobalEndTimeBuilder()
If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0) is used as default.
.google.protobuf.Timestamp global_end_time = 6;
Type | Description |
Builder |
getGlobalEndTimeOrBuilder()
public TimestampOrBuilder getGlobalEndTimeOrBuilder()
If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0) is used as default.
.google.protobuf.Timestamp global_end_time = 6;
Type | Description |
TimestampOrBuilder |
getGlobalStartTime()
public Timestamp getGlobalStartTime()
Global start and end time of the model: no times outside of this range
can be considered valid.
The model's time span must be less than a year, i.e. the global_end_time
and the global_start_time
must be within 31536000 seconds of each other.
When using cost_per_*hour
fields, you might want to set this window to a
smaller interval to increase performance (eg. if you model a single day,
you should set the global time limits to that day).
If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used
as default.
.google.protobuf.Timestamp global_start_time = 5;
Type | Description |
Timestamp | The globalStartTime. |
getGlobalStartTimeBuilder()
public Timestamp.Builder getGlobalStartTimeBuilder()
Global start and end time of the model: no times outside of this range
can be considered valid.
The model's time span must be less than a year, i.e. the global_end_time
and the global_start_time
must be within 31536000 seconds of each other.
When using cost_per_*hour
fields, you might want to set this window to a
smaller interval to increase performance (eg. if you model a single day,
you should set the global time limits to that day).
If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used
as default.
.google.protobuf.Timestamp global_start_time = 5;
Type | Description |
Builder |
getGlobalStartTimeOrBuilder()
public TimestampOrBuilder getGlobalStartTimeOrBuilder()
Global start and end time of the model: no times outside of this range
can be considered valid.
The model's time span must be less than a year, i.e. the global_end_time
and the global_start_time
must be within 31536000 seconds of each other.
When using cost_per_*hour
fields, you might want to set this window to a
smaller interval to increase performance (eg. if you model a single day,
you should set the global time limits to that day).
If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used
as default.
.google.protobuf.Timestamp global_start_time = 5;
Type | Description |
TimestampOrBuilder |
getMaxActiveVehicles()
public int getMaxActiveVehicles()
Constrains the maximum number of active vehicles. A vehicle is active if its route performs at least one shipment. This can be used to limit the number of routes in the case where there are fewer drivers than vehicles and that the fleet of vehicles is heterogeneous. The optimization will then select the best subset of vehicles to use. Must be strictly positive.
optional int32 max_active_vehicles = 4;
Type | Description |
int | The maxActiveVehicles. |
getPrecedenceRules(int index)
public ShipmentModel.PrecedenceRule getPrecedenceRules(int index)
Set of precedence rules which must be enforced in the model.
repeated .google.cloud.optimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14;
Name | Description |
index | int |
Type | Description |
ShipmentModel.PrecedenceRule |
getPrecedenceRulesBuilder(int index)
public ShipmentModel.PrecedenceRule.Builder getPrecedenceRulesBuilder(int index)
Set of precedence rules which must be enforced in the model.
repeated .google.cloud.optimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14;
Name | Description |
index | int |
Type | Description |
ShipmentModel.PrecedenceRule.Builder |
getPrecedenceRulesBuilderList()
public List<ShipmentModel.PrecedenceRule.Builder> getPrecedenceRulesBuilderList()
Set of precedence rules which must be enforced in the model.
repeated .google.cloud.optimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14;
Type | Description |
List<Builder> |
getPrecedenceRulesCount()
public int getPrecedenceRulesCount()
Set of precedence rules which must be enforced in the model.
repeated .google.cloud.optimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14;
Type | Description |
int |
getPrecedenceRulesList()
public List<ShipmentModel.PrecedenceRule> getPrecedenceRulesList()
Set of precedence rules which must be enforced in the model.
repeated .google.cloud.optimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14;
Type | Description |
List<PrecedenceRule> |
getPrecedenceRulesOrBuilder(int index)
public ShipmentModel.PrecedenceRuleOrBuilder getPrecedenceRulesOrBuilder(int index)
Set of precedence rules which must be enforced in the model.
repeated .google.cloud.optimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14;
Name | Description |
index | int |
Type | Description |
ShipmentModel.PrecedenceRuleOrBuilder |
getPrecedenceRulesOrBuilderList()
public List<? extends ShipmentModel.PrecedenceRuleOrBuilder> getPrecedenceRulesOrBuilderList()
Set of precedence rules which must be enforced in the model.
repeated .google.cloud.optimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14;
Type | Description |
List<? extends com.google.cloud.optimization.v1.ShipmentModel.PrecedenceRuleOrBuilder> |
getShipmentTypeIncompatibilities(int index)
public ShipmentTypeIncompatibility getShipmentTypeIncompatibilities(int index)
Sets of incompatible shipment_types (see ShipmentTypeIncompatibility
).
repeated .google.cloud.optimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12;
Name | Description |
index | int |
Type | Description |
ShipmentTypeIncompatibility |
getShipmentTypeIncompatibilitiesBuilder(int index)
public ShipmentTypeIncompatibility.Builder getShipmentTypeIncompatibilitiesBuilder(int index)
Sets of incompatible shipment_types (see ShipmentTypeIncompatibility
).
repeated .google.cloud.optimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12;
Name | Description |
index | int |
Type | Description |
ShipmentTypeIncompatibility.Builder |
getShipmentTypeIncompatibilitiesBuilderList()
public List<ShipmentTypeIncompatibility.Builder> getShipmentTypeIncompatibilitiesBuilderList()
Sets of incompatible shipment_types (see ShipmentTypeIncompatibility
).
repeated .google.cloud.optimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12;
Type | Description |
List<Builder> |
getShipmentTypeIncompatibilitiesCount()
public int getShipmentTypeIncompatibilitiesCount()
Sets of incompatible shipment_types (see ShipmentTypeIncompatibility
).
repeated .google.cloud.optimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12;
Type | Description |
int |
getShipmentTypeIncompatibilitiesList()
public List<ShipmentTypeIncompatibility> getShipmentTypeIncompatibilitiesList()
Sets of incompatible shipment_types (see ShipmentTypeIncompatibility
).
repeated .google.cloud.optimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12;
Type | Description |
List<ShipmentTypeIncompatibility> |
getShipmentTypeIncompatibilitiesOrBuilder(int index)
public ShipmentTypeIncompatibilityOrBuilder getShipmentTypeIncompatibilitiesOrBuilder(int index)
Sets of incompatible shipment_types (see ShipmentTypeIncompatibility
).
repeated .google.cloud.optimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12;
Name | Description |
index | int |
Type | Description |
ShipmentTypeIncompatibilityOrBuilder |
getShipmentTypeIncompatibilitiesOrBuilderList()
public List<? extends ShipmentTypeIncompatibilityOrBuilder> getShipmentTypeIncompatibilitiesOrBuilderList()
Sets of incompatible shipment_types (see ShipmentTypeIncompatibility
).
repeated .google.cloud.optimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12;
Type | Description |
List<? extends com.google.cloud.optimization.v1.ShipmentTypeIncompatibilityOrBuilder> |
getShipmentTypeRequirements(int index)
public ShipmentTypeRequirement getShipmentTypeRequirements(int index)
Sets of shipment_type
requirements (see ShipmentTypeRequirement
).
repeated .google.cloud.optimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13;
Name | Description |
index | int |
Type | Description |
ShipmentTypeRequirement |
getShipmentTypeRequirementsBuilder(int index)
public ShipmentTypeRequirement.Builder getShipmentTypeRequirementsBuilder(int index)
Sets of shipment_type
requirements (see ShipmentTypeRequirement
).
repeated .google.cloud.optimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13;
Name | Description |
index | int |
Type | Description |
ShipmentTypeRequirement.Builder |
getShipmentTypeRequirementsBuilderList()
public List<ShipmentTypeRequirement.Builder> getShipmentTypeRequirementsBuilderList()
Sets of shipment_type
requirements (see ShipmentTypeRequirement
).
repeated .google.cloud.optimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13;
Type | Description |
List<Builder> |
getShipmentTypeRequirementsCount()
public int getShipmentTypeRequirementsCount()
Sets of shipment_type
requirements (see ShipmentTypeRequirement
).
repeated .google.cloud.optimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13;
Type | Description |
int |
getShipmentTypeRequirementsList()
public List<ShipmentTypeRequirement> getShipmentTypeRequirementsList()
Sets of shipment_type
requirements (see ShipmentTypeRequirement
).
repeated .google.cloud.optimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13;
Type | Description |
List<ShipmentTypeRequirement> |
getShipmentTypeRequirementsOrBuilder(int index)
public ShipmentTypeRequirementOrBuilder getShipmentTypeRequirementsOrBuilder(int index)
Sets of shipment_type
requirements (see ShipmentTypeRequirement
).
repeated .google.cloud.optimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13;
Name | Description |
index | int |
Type | Description |
ShipmentTypeRequirementOrBuilder |
getShipmentTypeRequirementsOrBuilderList()
public List<? extends ShipmentTypeRequirementOrBuilder> getShipmentTypeRequirementsOrBuilderList()
Sets of shipment_type
requirements (see ShipmentTypeRequirement
).
repeated .google.cloud.optimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13;
Type | Description |
List<? extends com.google.cloud.optimization.v1.ShipmentTypeRequirementOrBuilder> |
getShipments(int index)
public Shipment getShipments(int index)
Set of shipments which must be performed in the model.
repeated .google.cloud.optimization.v1.Shipment shipments = 1;
Name | Description |
index | int |
Type | Description |
Shipment |
getShipmentsBuilder(int index)
public Shipment.Builder getShipmentsBuilder(int index)
Set of shipments which must be performed in the model.
repeated .google.cloud.optimization.v1.Shipment shipments = 1;
Name | Description |
index | int |
Type | Description |
Shipment.Builder |
getShipmentsBuilderList()
public List<Shipment.Builder> getShipmentsBuilderList()
Set of shipments which must be performed in the model.
repeated .google.cloud.optimization.v1.Shipment shipments = 1;
Type | Description |
List<Builder> |
getShipmentsCount()
public int getShipmentsCount()
Set of shipments which must be performed in the model.
repeated .google.cloud.optimization.v1.Shipment shipments = 1;
Type | Description |
int |
getShipmentsList()
public List<Shipment> getShipmentsList()
Set of shipments which must be performed in the model.
repeated .google.cloud.optimization.v1.Shipment shipments = 1;
Type | Description |
List<Shipment> |
getShipmentsOrBuilder(int index)
public ShipmentOrBuilder getShipmentsOrBuilder(int index)
Set of shipments which must be performed in the model.
repeated .google.cloud.optimization.v1.Shipment shipments = 1;
Name | Description |
index | int |
Type | Description |
ShipmentOrBuilder |
getShipmentsOrBuilderList()
public List<? extends ShipmentOrBuilder> getShipmentsOrBuilderList()
Set of shipments which must be performed in the model.
repeated .google.cloud.optimization.v1.Shipment shipments = 1;
Type | Description |
List<? extends com.google.cloud.optimization.v1.ShipmentOrBuilder> |
getTransitionAttributes(int index)
public TransitionAttributes getTransitionAttributes(int index)
Transition attributes added to the model.
repeated .google.cloud.optimization.v1.TransitionAttributes transition_attributes = 11;
Name | Description |
index | int |
Type | Description |
TransitionAttributes |
getTransitionAttributesBuilder(int index)
public TransitionAttributes.Builder getTransitionAttributesBuilder(int index)
Transition attributes added to the model.
repeated .google.cloud.optimization.v1.TransitionAttributes transition_attributes = 11;
Name | Description |
index | int |
Type | Description |
TransitionAttributes.Builder |
getTransitionAttributesBuilderList()
public List<TransitionAttributes.Builder> getTransitionAttributesBuilderList()
Transition attributes added to the model.
repeated .google.cloud.optimization.v1.TransitionAttributes transition_attributes = 11;
Type | Description |
List<Builder> |
getTransitionAttributesCount()
public int getTransitionAttributesCount()
Transition attributes added to the model.
repeated .google.cloud.optimization.v1.TransitionAttributes transition_attributes = 11;
Type | Description |
int |
getTransitionAttributesList()
public List<TransitionAttributes> getTransitionAttributesList()
Transition attributes added to the model.
repeated .google.cloud.optimization.v1.TransitionAttributes transition_attributes = 11;
Type | Description |
List<TransitionAttributes> |
getTransitionAttributesOrBuilder(int index)
public TransitionAttributesOrBuilder getTransitionAttributesOrBuilder(int index)
Transition attributes added to the model.
repeated .google.cloud.optimization.v1.TransitionAttributes transition_attributes = 11;
Name | Description |
index | int |
Type | Description |
TransitionAttributesOrBuilder |
getTransitionAttributesOrBuilderList()
public List<? extends TransitionAttributesOrBuilder> getTransitionAttributesOrBuilderList()
Transition attributes added to the model.
repeated .google.cloud.optimization.v1.TransitionAttributes transition_attributes = 11;
Type | Description |
List<? extends com.google.cloud.optimization.v1.TransitionAttributesOrBuilder> |
getVehicles(int index)
public Vehicle getVehicles(int index)
Set of vehicles which can be used to perform visits.
repeated .google.cloud.optimization.v1.Vehicle vehicles = 2;
Name | Description |
index | int |
Type | Description |
Vehicle |
getVehiclesBuilder(int index)
public Vehicle.Builder getVehiclesBuilder(int index)
Set of vehicles which can be used to perform visits.
repeated .google.cloud.optimization.v1.Vehicle vehicles = 2;
Name | Description |
index | int |
Type | Description |
Vehicle.Builder |
getVehiclesBuilderList()
public List<Vehicle.Builder> getVehiclesBuilderList()
Set of vehicles which can be used to perform visits.
repeated .google.cloud.optimization.v1.Vehicle vehicles = 2;
Type | Description |
List<Builder> |
getVehiclesCount()
public int getVehiclesCount()
Set of vehicles which can be used to perform visits.
repeated .google.cloud.optimization.v1.Vehicle vehicles = 2;
Type | Description |
int |
getVehiclesList()
public List<Vehicle> getVehiclesList()
Set of vehicles which can be used to perform visits.
repeated .google.cloud.optimization.v1.Vehicle vehicles = 2;
Type | Description |
List<Vehicle> |
getVehiclesOrBuilder(int index)
public VehicleOrBuilder getVehiclesOrBuilder(int index)
Set of vehicles which can be used to perform visits.
repeated .google.cloud.optimization.v1.Vehicle vehicles = 2;
Name | Description |
index | int |
Type | Description |
VehicleOrBuilder |
getVehiclesOrBuilderList()
public List<? extends VehicleOrBuilder> getVehiclesOrBuilderList()
Set of vehicles which can be used to perform visits.
repeated .google.cloud.optimization.v1.Vehicle vehicles = 2;
Type | Description |
List<? extends com.google.cloud.optimization.v1.VehicleOrBuilder> |
hasGlobalEndTime()
public boolean hasGlobalEndTime()
If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0) is used as default.
.google.protobuf.Timestamp global_end_time = 6;
Type | Description |
boolean | Whether the globalEndTime field is set. |
hasGlobalStartTime()
public boolean hasGlobalStartTime()
Global start and end time of the model: no times outside of this range
can be considered valid.
The model's time span must be less than a year, i.e. the global_end_time
and the global_start_time
must be within 31536000 seconds of each other.
When using cost_per_*hour
fields, you might want to set this window to a
smaller interval to increase performance (eg. if you model a single day,
you should set the global time limits to that day).
If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used
as default.
.google.protobuf.Timestamp global_start_time = 5;
Type | Description |
boolean | Whether the globalStartTime field is set. |
hasMaxActiveVehicles()
public boolean hasMaxActiveVehicles()
Constrains the maximum number of active vehicles. A vehicle is active if its route performs at least one shipment. This can be used to limit the number of routes in the case where there are fewer drivers than vehicles and that the fleet of vehicles is heterogeneous. The optimization will then select the best subset of vehicles to use. Must be strictly positive.
optional int32 max_active_vehicles = 4;
Type | Description |
boolean | Whether the maxActiveVehicles field is set. |
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Type | Description |
FieldAccessorTable |
isInitialized()
public final boolean isInitialized()
Type | Description |
boolean |
mergeFrom(ShipmentModel other)
public ShipmentModel.Builder mergeFrom(ShipmentModel other)
Name | Description |
other | ShipmentModel |
Type | Description |
ShipmentModel.Builder |
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public ShipmentModel.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Name | Description |
input | CodedInputStream |
extensionRegistry | ExtensionRegistryLite |
Type | Description |
ShipmentModel.Builder |
Type | Description |
IOException |
mergeFrom(Message other)
public ShipmentModel.Builder mergeFrom(Message other)
Name | Description |
other | Message |
Type | Description |
ShipmentModel.Builder |
mergeGlobalEndTime(Timestamp value)
public ShipmentModel.Builder mergeGlobalEndTime(Timestamp value)
If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0) is used as default.
.google.protobuf.Timestamp global_end_time = 6;
Name | Description |
value | Timestamp |
Type | Description |
ShipmentModel.Builder |
mergeGlobalStartTime(Timestamp value)
public ShipmentModel.Builder mergeGlobalStartTime(Timestamp value)
Global start and end time of the model: no times outside of this range
can be considered valid.
The model's time span must be less than a year, i.e. the global_end_time
and the global_start_time
must be within 31536000 seconds of each other.
When using cost_per_*hour
fields, you might want to set this window to a
smaller interval to increase performance (eg. if you model a single day,
you should set the global time limits to that day).
If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used
as default.
.google.protobuf.Timestamp global_start_time = 5;
Name | Description |
value | Timestamp |
Type | Description |
ShipmentModel.Builder |
mergeUnknownFields(UnknownFieldSet unknownFields)
public final ShipmentModel.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Name | Description |
unknownFields | UnknownFieldSet |
Type | Description |
ShipmentModel.Builder |
removeBreakRules(int index)
public ShipmentModel.Builder removeBreakRules(int index)
Deprecated: No longer used.
Set of break rules used in the model.
Each vehicle specifies the BreakRule
that applies to it via the
Vehicle.break_rule_indices field (which must be a singleton).
repeated .google.cloud.optimization.v1.ShipmentModel.BreakRule break_rules = 15 [deprecated = true];
Name | Description |
index | int |
Type | Description |
ShipmentModel.Builder |
removeDurationDistanceMatrices(int index)
public ShipmentModel.Builder removeDurationDistanceMatrices(int index)
Specifies duration and distance matrices used in the model. If this field
is empty, Google Maps or geodesic distances will be used instead, depending
on the value of the use_geodesic_distances
field. If it is not empty,
use_geodesic_distances
cannot be true and neither
duration_distance_matrix_src_tags
nor duration_distance_matrix_dst_tags
can be empty.
Usage examples:
- There are two locations: locA and locB.
- 1 vehicle starting its route at locA and ending it at locA.
- 1 pickup visit request at locB.
`
model { vehicles { start_tags: "locA" end_tags: "locA" } shipments { pickups { tags: "locB" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_dst_tags: "locA" duration_distance_matrix_dst_tags: "locB" duration_distance_matrices { rows { # from: locA durations { seconds: 0 } meters: 0 # to: locA durations { seconds: 100 } meters: 1000 # to: locB } rows { # from: locB durations { seconds: 102 } meters: 990 # to: locA durations { seconds: 0 } meters: 0 # to: locB } } }
- There are three locations: locA, locB and locC.
- 1 vehicle starting its route at locA and ending it at locB, using matrix "fast".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "slow".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "fast".
- 1 pickup visit request at locC.
`model { vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } shipments { pickups { tags: "locC" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_src_tags: "locC" duration_distance_matrix_dst_tags: "locB" duration_distance_matrix_dst_tags: "locC" duration_distance_matrices { vehicle_start_tag: "fast" rows { # from: locA durations { seconds: 1000 } meters: 2000 # to: locB durations { seconds: 600 } meters: 1000 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 700 } meters: 1200 # to: locC } rows { # from: locC durations { seconds: 702 } meters: 1190 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } duration_distance_matrices { vehicle_start_tag: "slow" rows { # from: locA durations { seconds: 1800 } meters: 2001 # to: locB durations { seconds: 900 } meters: 1002 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 1000 } meters: 1202 # to: locC } rows { # from: locC durations { seconds: 1001 } meters: 1195 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } }
repeated .google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8;
Name | Description |
index | int |
Type | Description |
ShipmentModel.Builder |
removePrecedenceRules(int index)
public ShipmentModel.Builder removePrecedenceRules(int index)
Set of precedence rules which must be enforced in the model.
repeated .google.cloud.optimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14;
Name | Description |
index | int |
Type | Description |
ShipmentModel.Builder |
removeShipmentTypeIncompatibilities(int index)
public ShipmentModel.Builder removeShipmentTypeIncompatibilities(int index)
Sets of incompatible shipment_types (see ShipmentTypeIncompatibility
).
repeated .google.cloud.optimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12;
Name | Description |
index | int |
Type | Description |
ShipmentModel.Builder |
removeShipmentTypeRequirements(int index)
public ShipmentModel.Builder removeShipmentTypeRequirements(int index)
Sets of shipment_type
requirements (see ShipmentTypeRequirement
).
repeated .google.cloud.optimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13;
Name | Description |
index | int |
Type | Description |
ShipmentModel.Builder |
removeShipments(int index)
public ShipmentModel.Builder removeShipments(int index)
Set of shipments which must be performed in the model.
repeated .google.cloud.optimization.v1.Shipment shipments = 1;
Name | Description |
index | int |
Type | Description |
ShipmentModel.Builder |
removeTransitionAttributes(int index)
public ShipmentModel.Builder removeTransitionAttributes(int index)
Transition attributes added to the model.
repeated .google.cloud.optimization.v1.TransitionAttributes transition_attributes = 11;
Name | Description |
index | int |
Type | Description |
ShipmentModel.Builder |
removeVehicles(int index)
public ShipmentModel.Builder removeVehicles(int index)
Set of vehicles which can be used to perform visits.
repeated .google.cloud.optimization.v1.Vehicle vehicles = 2;
Name | Description |
index | int |
Type | Description |
ShipmentModel.Builder |
setBreakRules(int index, ShipmentModel.BreakRule value)
public ShipmentModel.Builder setBreakRules(int index, ShipmentModel.BreakRule value)
Deprecated: No longer used.
Set of break rules used in the model.
Each vehicle specifies the BreakRule
that applies to it via the
Vehicle.break_rule_indices field (which must be a singleton).
repeated .google.cloud.optimization.v1.ShipmentModel.BreakRule break_rules = 15 [deprecated = true];
Name | Description |
index | int |
value | ShipmentModel.BreakRule |
Type | Description |
ShipmentModel.Builder |
setBreakRules(int index, ShipmentModel.BreakRule.Builder builderForValue)
public ShipmentModel.Builder setBreakRules(int index, ShipmentModel.BreakRule.Builder builderForValue)
Deprecated: No longer used.
Set of break rules used in the model.
Each vehicle specifies the BreakRule
that applies to it via the
Vehicle.break_rule_indices field (which must be a singleton).
repeated .google.cloud.optimization.v1.ShipmentModel.BreakRule break_rules = 15 [deprecated = true];
Name | Description |
index | int |
builderForValue | ShipmentModel.BreakRule.Builder |
Type | Description |
ShipmentModel.Builder |
setDurationDistanceMatrices(int index, ShipmentModel.DurationDistanceMatrix value)
public ShipmentModel.Builder setDurationDistanceMatrices(int index, ShipmentModel.DurationDistanceMatrix value)
Specifies duration and distance matrices used in the model. If this field
is empty, Google Maps or geodesic distances will be used instead, depending
on the value of the use_geodesic_distances
field. If it is not empty,
use_geodesic_distances
cannot be true and neither
duration_distance_matrix_src_tags
nor duration_distance_matrix_dst_tags
can be empty.
Usage examples:
- There are two locations: locA and locB.
- 1 vehicle starting its route at locA and ending it at locA.
- 1 pickup visit request at locB.
`
model { vehicles { start_tags: "locA" end_tags: "locA" } shipments { pickups { tags: "locB" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_dst_tags: "locA" duration_distance_matrix_dst_tags: "locB" duration_distance_matrices { rows { # from: locA durations { seconds: 0 } meters: 0 # to: locA durations { seconds: 100 } meters: 1000 # to: locB } rows { # from: locB durations { seconds: 102 } meters: 990 # to: locA durations { seconds: 0 } meters: 0 # to: locB } } }
- There are three locations: locA, locB and locC.
- 1 vehicle starting its route at locA and ending it at locB, using matrix "fast".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "slow".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "fast".
- 1 pickup visit request at locC.
`model { vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } shipments { pickups { tags: "locC" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_src_tags: "locC" duration_distance_matrix_dst_tags: "locB" duration_distance_matrix_dst_tags: "locC" duration_distance_matrices { vehicle_start_tag: "fast" rows { # from: locA durations { seconds: 1000 } meters: 2000 # to: locB durations { seconds: 600 } meters: 1000 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 700 } meters: 1200 # to: locC } rows { # from: locC durations { seconds: 702 } meters: 1190 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } duration_distance_matrices { vehicle_start_tag: "slow" rows { # from: locA durations { seconds: 1800 } meters: 2001 # to: locB durations { seconds: 900 } meters: 1002 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 1000 } meters: 1202 # to: locC } rows { # from: locC durations { seconds: 1001 } meters: 1195 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } }
repeated .google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8;
Name | Description |
index | int |
value | ShipmentModel.DurationDistanceMatrix |
Type | Description |
ShipmentModel.Builder |
setDurationDistanceMatrices(int index, ShipmentModel.DurationDistanceMatrix.Builder builderForValue)
public ShipmentModel.Builder setDurationDistanceMatrices(int index, ShipmentModel.DurationDistanceMatrix.Builder builderForValue)
Specifies duration and distance matrices used in the model. If this field
is empty, Google Maps or geodesic distances will be used instead, depending
on the value of the use_geodesic_distances
field. If it is not empty,
use_geodesic_distances
cannot be true and neither
duration_distance_matrix_src_tags
nor duration_distance_matrix_dst_tags
can be empty.
Usage examples:
- There are two locations: locA and locB.
- 1 vehicle starting its route at locA and ending it at locA.
- 1 pickup visit request at locB.
`
model { vehicles { start_tags: "locA" end_tags: "locA" } shipments { pickups { tags: "locB" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_dst_tags: "locA" duration_distance_matrix_dst_tags: "locB" duration_distance_matrices { rows { # from: locA durations { seconds: 0 } meters: 0 # to: locA durations { seconds: 100 } meters: 1000 # to: locB } rows { # from: locB durations { seconds: 102 } meters: 990 # to: locA durations { seconds: 0 } meters: 0 # to: locB } } }
- There are three locations: locA, locB and locC.
- 1 vehicle starting its route at locA and ending it at locB, using matrix "fast".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "slow".
- 1 vehicle starting its route at locB and ending it at locB, using matrix "fast".
- 1 pickup visit request at locC.
`model { vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } shipments { pickups { tags: "locC" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_src_tags: "locC" duration_distance_matrix_dst_tags: "locB" duration_distance_matrix_dst_tags: "locC" duration_distance_matrices { vehicle_start_tag: "fast" rows { # from: locA durations { seconds: 1000 } meters: 2000 # to: locB durations { seconds: 600 } meters: 1000 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 700 } meters: 1200 # to: locC } rows { # from: locC durations { seconds: 702 } meters: 1190 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } duration_distance_matrices { vehicle_start_tag: "slow" rows { # from: locA durations { seconds: 1800 } meters: 2001 # to: locB durations { seconds: 900 } meters: 1002 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 1000 } meters: 1202 # to: locC } rows { # from: locC durations { seconds: 1001 } meters: 1195 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } }
repeated .google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8;
Name | Description |
index | int |
builderForValue | ShipmentModel.DurationDistanceMatrix.Builder |
Type | Description |
ShipmentModel.Builder |
setDurationDistanceMatrixDstTags(int index, String value)
public ShipmentModel.Builder setDurationDistanceMatrixDstTags(int index, String value)
Tags defining the destinations of the duration and distance matrices;
duration_distance_matrices(i).rows(j).durations(k)
(resp.
duration_distance_matrices(i).rows(j).meters(k))
defines the duration
(resp. the distance) of the travel from visits with tag
duration_distance_matrix_src_tags(j)
to visits with tag
duration_distance_matrix_dst_tags(k)
in matrix i.
Tags correspond to
VisitRequest.tags
or Vehicle.start_tags.
A given VisitRequest
or Vehicle
must match exactly one tag in this
field. Note that a Vehicle
's source, destination and matrix tags may be
the same; similarly a VisitRequest
's source and destination tags may be
the same. All tags must be different and cannot be empty strings. If this
field is not empty, then duration_distance_matrices
must not be empty.
repeated string duration_distance_matrix_dst_tags = 10;
Name | Description |
index | int The index to set the value at. |
value | String The durationDistanceMatrixDstTags to set. |
Type | Description |
ShipmentModel.Builder | This builder for chaining. |
setDurationDistanceMatrixSrcTags(int index, String value)
public ShipmentModel.Builder setDurationDistanceMatrixSrcTags(int index, String value)
Tags defining the sources of the duration and distance matrices;
duration_distance_matrices(i).rows(j)
defines durations and distances
from visits with tag duration_distance_matrix_src_tags(j)
to other visits
in matrix i.
Tags correspond to
VisitRequest.tags
or Vehicle.start_tags.
A given VisitRequest
or Vehicle
must match exactly one tag in this
field. Note that a Vehicle
's source, destination and matrix tags may be
the same; similarly a VisitRequest
's source and destination tags may be
the same. All tags must be different and cannot be empty strings. If this
field is not empty, then duration_distance_matrices
must not be empty.
repeated string duration_distance_matrix_src_tags = 9;
Name | Description |
index | int The index to set the value at. |
value | String The durationDistanceMatrixSrcTags to set. |
Type | Description |
ShipmentModel.Builder | This builder for chaining. |
setField(Descriptors.FieldDescriptor field, Object value)
public ShipmentModel.Builder setField(Descriptors.FieldDescriptor field, Object value)
Name | Description |
field | FieldDescriptor |
value | Object |
Type | Description |
ShipmentModel.Builder |
setGlobalDurationCostPerHour(double value)
public ShipmentModel.Builder setGlobalDurationCostPerHour(double value)
The "global duration" of the overall plan is the difference between the earliest effective start time and the latest effective end time of all vehicles. Users can assign a cost per hour to that quantity to try and optimize for earliest job completion, for example. This cost must be in the same unit as Shipment.penalty_cost.
double global_duration_cost_per_hour = 7;
Name | Description |
value | double The globalDurationCostPerHour to set. |
Type | Description |
ShipmentModel.Builder | This builder for chaining. |
setGlobalEndTime(Timestamp value)
public ShipmentModel.Builder setGlobalEndTime(Timestamp value)
If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0) is used as default.
.google.protobuf.Timestamp global_end_time = 6;
Name | Description |
value | Timestamp |
Type | Description |
ShipmentModel.Builder |
setGlobalEndTime(Timestamp.Builder builderForValue)
public ShipmentModel.Builder setGlobalEndTime(Timestamp.Builder builderForValue)
If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0) is used as default.
.google.protobuf.Timestamp global_end_time = 6;
Name | Description |
builderForValue | Builder |
Type | Description |
ShipmentModel.Builder |
setGlobalStartTime(Timestamp value)
public ShipmentModel.Builder setGlobalStartTime(Timestamp value)
Global start and end time of the model: no times outside of this range
can be considered valid.
The model's time span must be less than a year, i.e. the global_end_time
and the global_start_time
must be within 31536000 seconds of each other.
When using cost_per_*hour
fields, you might want to set this window to a
smaller interval to increase performance (eg. if you model a single day,
you should set the global time limits to that day).
If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used
as default.
.google.protobuf.Timestamp global_start_time = 5;
Name | Description |
value | Timestamp |
Type | Description |
ShipmentModel.Builder |
setGlobalStartTime(Timestamp.Builder builderForValue)
public ShipmentModel.Builder setGlobalStartTime(Timestamp.Builder builderForValue)
Global start and end time of the model: no times outside of this range
can be considered valid.
The model's time span must be less than a year, i.e. the global_end_time
and the global_start_time
must be within 31536000 seconds of each other.
When using cost_per_*hour
fields, you might want to set this window to a
smaller interval to increase performance (eg. if you model a single day,
you should set the global time limits to that day).
If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used
as default.
.google.protobuf.Timestamp global_start_time = 5;
Name | Description |
builderForValue | Builder |
Type | Description |
ShipmentModel.Builder |
setMaxActiveVehicles(int value)
public ShipmentModel.Builder setMaxActiveVehicles(int value)
Constrains the maximum number of active vehicles. A vehicle is active if its route performs at least one shipment. This can be used to limit the number of routes in the case where there are fewer drivers than vehicles and that the fleet of vehicles is heterogeneous. The optimization will then select the best subset of vehicles to use. Must be strictly positive.
optional int32 max_active_vehicles = 4;
Name | Description |
value | int The maxActiveVehicles to set. |
Type | Description |
ShipmentModel.Builder | This builder for chaining. |
setPrecedenceRules(int index, ShipmentModel.PrecedenceRule value)
public ShipmentModel.Builder setPrecedenceRules(int index, ShipmentModel.PrecedenceRule value)
Set of precedence rules which must be enforced in the model.
repeated .google.cloud.optimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14;
Name | Description |
index | int |
value | ShipmentModel.PrecedenceRule |
Type | Description |
ShipmentModel.Builder |
setPrecedenceRules(int index, ShipmentModel.PrecedenceRule.Builder builderForValue)
public ShipmentModel.Builder setPrecedenceRules(int index, ShipmentModel.PrecedenceRule.Builder builderForValue)
Set of precedence rules which must be enforced in the model.
repeated .google.cloud.optimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14;
Name | Description |
index | int |
builderForValue | ShipmentModel.PrecedenceRule.Builder |
Type | Description |
ShipmentModel.Builder |
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public ShipmentModel.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Name | Description |
field | FieldDescriptor |
index | int |
value | Object |
Type | Description |
ShipmentModel.Builder |
setShipmentTypeIncompatibilities(int index, ShipmentTypeIncompatibility value)
public ShipmentModel.Builder setShipmentTypeIncompatibilities(int index, ShipmentTypeIncompatibility value)
Sets of incompatible shipment_types (see ShipmentTypeIncompatibility
).
repeated .google.cloud.optimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12;
Name | Description |
index | int |
value | ShipmentTypeIncompatibility |
Type | Description |
ShipmentModel.Builder |
setShipmentTypeIncompatibilities(int index, ShipmentTypeIncompatibility.Builder builderForValue)
public ShipmentModel.Builder setShipmentTypeIncompatibilities(int index, ShipmentTypeIncompatibility.Builder builderForValue)
Sets of incompatible shipment_types (see ShipmentTypeIncompatibility
).
repeated .google.cloud.optimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12;
Name | Description |
index | int |
builderForValue | ShipmentTypeIncompatibility.Builder |
Type | Description |
ShipmentModel.Builder |
setShipmentTypeRequirements(int index, ShipmentTypeRequirement value)
public ShipmentModel.Builder setShipmentTypeRequirements(int index, ShipmentTypeRequirement value)
Sets of shipment_type
requirements (see ShipmentTypeRequirement
).
repeated .google.cloud.optimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13;
Name | Description |
index | int |
value | ShipmentTypeRequirement |
Type | Description |
ShipmentModel.Builder |
setShipmentTypeRequirements(int index, ShipmentTypeRequirement.Builder builderForValue)
public ShipmentModel.Builder setShipmentTypeRequirements(int index, ShipmentTypeRequirement.Builder builderForValue)
Sets of shipment_type
requirements (see ShipmentTypeRequirement
).
repeated .google.cloud.optimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13;
Name | Description |
index | int |
builderForValue | ShipmentTypeRequirement.Builder |
Type | Description |
ShipmentModel.Builder |
setShipments(int index, Shipment value)
public ShipmentModel.Builder setShipments(int index, Shipment value)
Set of shipments which must be performed in the model.
repeated .google.cloud.optimization.v1.Shipment shipments = 1;
Name | Description |
index | int |
value | Shipment |
Type | Description |
ShipmentModel.Builder |
setShipments(int index, Shipment.Builder builderForValue)
public ShipmentModel.Builder setShipments(int index, Shipment.Builder builderForValue)
Set of shipments which must be performed in the model.
repeated .google.cloud.optimization.v1.Shipment shipments = 1;
Name | Description |
index | int |
builderForValue | Shipment.Builder |
Type | Description |
ShipmentModel.Builder |
setTransitionAttributes(int index, TransitionAttributes value)
public ShipmentModel.Builder setTransitionAttributes(int index, TransitionAttributes value)
Transition attributes added to the model.
repeated .google.cloud.optimization.v1.TransitionAttributes transition_attributes = 11;
Name | Description |
index | int |
value | TransitionAttributes |
Type | Description |
ShipmentModel.Builder |
setTransitionAttributes(int index, TransitionAttributes.Builder builderForValue)
public ShipmentModel.Builder setTransitionAttributes(int index, TransitionAttributes.Builder builderForValue)
Transition attributes added to the model.
repeated .google.cloud.optimization.v1.TransitionAttributes transition_attributes = 11;
Name | Description |
index | int |
builderForValue | TransitionAttributes.Builder |
Type | Description |
ShipmentModel.Builder |
setUnknownFields(UnknownFieldSet unknownFields)
public final ShipmentModel.Builder setUnknownFields(UnknownFieldSet unknownFields)
Name | Description |
unknownFields | UnknownFieldSet |
Type | Description |
ShipmentModel.Builder |
setVehicles(int index, Vehicle value)
public ShipmentModel.Builder setVehicles(int index, Vehicle value)
Set of vehicles which can be used to perform visits.
repeated .google.cloud.optimization.v1.Vehicle vehicles = 2;
Name | Description |
index | int |
value | Vehicle |
Type | Description |
ShipmentModel.Builder |
setVehicles(int index, Vehicle.Builder builderForValue)
public ShipmentModel.Builder setVehicles(int index, Vehicle.Builder builderForValue)
Set of vehicles which can be used to perform visits.
repeated .google.cloud.optimization.v1.Vehicle vehicles = 2;
Name | Description |
index | int |
builderForValue | Vehicle.Builder |
Type | Description |
ShipmentModel.Builder |