# Cloud Optimization V1 API - Class Google::Cloud::Optimization::V1::ShipmentModel (v0.16.0)

0.16.0 (latest) 0.15.0 0.14.1 0.13.0 0.12.0 0.11.1 0.10.0 0.9.2 0.8.2 0.7.0 0.6.0 0.5.0 0.4.1 0.3.0 0.2.1 0.1.1 Reference documentation and code samples for the Cloud Optimization V1 API class Google::Cloud::Optimization::V1::ShipmentModel.

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

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #break_rules

    def break_rules() -> ::Array<::Google::Cloud::Optimization::V1::ShipmentModel::BreakRule>

**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::ShipmentModel::BreakRule](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentModel-BreakRule)\>) --- 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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle#Google__Cloud__Optimization__V1__Vehicle_break_rule_indices_instance_ "Google::Cloud::Optimization::V1::Vehicle#break_rule_indices (method)") field (which must be a singleton).

### #break_rules=

    def break_rules=(value) -> ::Array<::Google::Cloud::Optimization::V1::ShipmentModel::BreakRule>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Optimization::V1::ShipmentModel::BreakRule](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentModel-BreakRule)\>) --- 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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle#Google__Cloud__Optimization__V1__Vehicle_break_rule_indices_instance_ "Google::Cloud::Optimization::V1::Vehicle#break_rule_indices (method)") field (which must be a singleton).
**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::ShipmentModel::BreakRule](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentModel-BreakRule)\>) --- 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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle#Google__Cloud__Optimization__V1__Vehicle_break_rule_indices_instance_ "Google::Cloud::Optimization::V1::Vehicle#break_rule_indices (method)") field (which must be a singleton).

### #duration_distance_matrices

    def duration_distance_matrices() -> ::Array<::Google::Cloud::Optimization::V1::ShipmentModel::DurationDistanceMatrix>

**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::ShipmentModel::DurationDistanceMatrix](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentModel-DurationDistanceMatrix)\>) --- 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
  }
  }
  }
  `

### #duration_distance_matrices=

    def duration_distance_matrices=(value) -> ::Array<::Google::Cloud::Optimization::V1::ShipmentModel::DurationDistanceMatrix>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Optimization::V1::ShipmentModel::DurationDistanceMatrix](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentModel-DurationDistanceMatrix)\>) --- 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
  }
  }
  }
  `
**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::ShipmentModel::DurationDistanceMatrix](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentModel-DurationDistanceMatrix)\>) --- 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
  }
  }
  }
  `

### #duration_distance_matrix_dst_tags

    def duration_distance_matrix_dst_tags() -> ::Array<::String>

**Returns**

- (::Array\<::String\>) --- 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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Shipment-VisitRequest#Google__Cloud__Optimization__V1__Shipment__VisitRequest_tags_instance_ "Google::Cloud::Optimization::V1::Shipment::VisitRequest#tags (method)")
  or [Vehicle.start_tags](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle#Google__Cloud__Optimization__V1__Vehicle_start_tags_instance_ "Google::Cloud::Optimization::V1::Vehicle#start_tags (method)").
  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.

### #duration_distance_matrix_dst_tags=

    def duration_distance_matrix_dst_tags=(value) -> ::Array<::String>

**Parameter**

- **value** (::Array\<::String\>) --- 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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Shipment-VisitRequest#Google__Cloud__Optimization__V1__Shipment__VisitRequest_tags_instance_ "Google::Cloud::Optimization::V1::Shipment::VisitRequest#tags (method)")
  or [Vehicle.start_tags](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle#Google__Cloud__Optimization__V1__Vehicle_start_tags_instance_ "Google::Cloud::Optimization::V1::Vehicle#start_tags (method)").
  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.
**Returns**

- (::Array\<::String\>) --- 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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Shipment-VisitRequest#Google__Cloud__Optimization__V1__Shipment__VisitRequest_tags_instance_ "Google::Cloud::Optimization::V1::Shipment::VisitRequest#tags (method)")
  or [Vehicle.start_tags](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle#Google__Cloud__Optimization__V1__Vehicle_start_tags_instance_ "Google::Cloud::Optimization::V1::Vehicle#start_tags (method)").
  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.

### #duration_distance_matrix_src_tags

    def duration_distance_matrix_src_tags() -> ::Array<::String>

**Returns**

- (::Array\<::String\>) --- 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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Shipment-VisitRequest#Google__Cloud__Optimization__V1__Shipment__VisitRequest_tags_instance_ "Google::Cloud::Optimization::V1::Shipment::VisitRequest#tags (method)")
  or [Vehicle.start_tags](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle#Google__Cloud__Optimization__V1__Vehicle_start_tags_instance_ "Google::Cloud::Optimization::V1::Vehicle#start_tags (method)").
  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.

### #duration_distance_matrix_src_tags=

    def duration_distance_matrix_src_tags=(value) -> ::Array<::String>

**Parameter**

- **value** (::Array\<::String\>) --- 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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Shipment-VisitRequest#Google__Cloud__Optimization__V1__Shipment__VisitRequest_tags_instance_ "Google::Cloud::Optimization::V1::Shipment::VisitRequest#tags (method)")
  or [Vehicle.start_tags](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle#Google__Cloud__Optimization__V1__Vehicle_start_tags_instance_ "Google::Cloud::Optimization::V1::Vehicle#start_tags (method)").
  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.
**Returns**

- (::Array\<::String\>) --- 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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Shipment-VisitRequest#Google__Cloud__Optimization__V1__Shipment__VisitRequest_tags_instance_ "Google::Cloud::Optimization::V1::Shipment::VisitRequest#tags (method)")
  or [Vehicle.start_tags](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle#Google__Cloud__Optimization__V1__Vehicle_start_tags_instance_ "Google::Cloud::Optimization::V1::Vehicle#start_tags (method)").
  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.

### #global_duration_cost_per_hour

    def global_duration_cost_per_hour() -> ::Float

**Returns**

- (::Float) --- 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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Shipment#Google__Cloud__Optimization__V1__Shipment_penalty_cost_instance_ "Google::Cloud::Optimization::V1::Shipment#penalty_cost (method)").

### #global_duration_cost_per_hour=

    def global_duration_cost_per_hour=(value) -> ::Float

**Parameter**

- **value** (::Float) --- 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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Shipment#Google__Cloud__Optimization__V1__Shipment_penalty_cost_instance_ "Google::Cloud::Optimization::V1::Shipment#penalty_cost (method)").
**Returns**

- (::Float) --- 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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Shipment#Google__Cloud__Optimization__V1__Shipment_penalty_cost_instance_ "Google::Cloud::Optimization::V1::Shipment#penalty_cost (method)").

### #global_end_time

    def global_end_time() -> ::Google::Protobuf::Timestamp

**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Protobuf-Timestamp)) --- If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0) is used as default.

### #global_end_time=

    def global_end_time=(value) -> ::Google::Protobuf::Timestamp

**Parameter**

- **value** ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Protobuf-Timestamp)) --- If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0) is used as default.
**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Protobuf-Timestamp)) --- If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0) is used as default.

### #global_start_time

    def global_start_time() -> ::Google::Protobuf::Timestamp

**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Protobuf-Timestamp)) --- 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.

### #global_start_time=

    def global_start_time=(value) -> ::Google::Protobuf::Timestamp

**Parameter**

- **value** ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Protobuf-Timestamp)) --- 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.
**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Protobuf-Timestamp)) --- 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.

### #max_active_vehicles

    def max_active_vehicles() -> ::Integer

**Returns**

- (::Integer) --- 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.

### #max_active_vehicles=

    def max_active_vehicles=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- 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.
**Returns**

- (::Integer) --- 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.

### #precedence_rules

    def precedence_rules() -> ::Array<::Google::Cloud::Optimization::V1::ShipmentModel::PrecedenceRule>

**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::ShipmentModel::PrecedenceRule](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentModel-PrecedenceRule)\>) --- Set of precedence rules which must be enforced in the model.

### #precedence_rules=

    def precedence_rules=(value) -> ::Array<::Google::Cloud::Optimization::V1::ShipmentModel::PrecedenceRule>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Optimization::V1::ShipmentModel::PrecedenceRule](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentModel-PrecedenceRule)\>) --- Set of precedence rules which must be enforced in the model.
**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::ShipmentModel::PrecedenceRule](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentModel-PrecedenceRule)\>) --- Set of precedence rules which must be enforced in the model.

### #shipment_type_incompatibilities

    def shipment_type_incompatibilities() -> ::Array<::Google::Cloud::Optimization::V1::ShipmentTypeIncompatibility>

**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::ShipmentTypeIncompatibility](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentTypeIncompatibility)\>) --- Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).

### #shipment_type_incompatibilities=

    def shipment_type_incompatibilities=(value) -> ::Array<::Google::Cloud::Optimization::V1::ShipmentTypeIncompatibility>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Optimization::V1::ShipmentTypeIncompatibility](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentTypeIncompatibility)\>) --- Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::ShipmentTypeIncompatibility](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentTypeIncompatibility)\>) --- Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).

### #shipment_type_requirements

    def shipment_type_requirements() -> ::Array<::Google::Cloud::Optimization::V1::ShipmentTypeRequirement>

**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::ShipmentTypeRequirement](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentTypeRequirement)\>) --- Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).

### #shipment_type_requirements=

    def shipment_type_requirements=(value) -> ::Array<::Google::Cloud::Optimization::V1::ShipmentTypeRequirement>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Optimization::V1::ShipmentTypeRequirement](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentTypeRequirement)\>) --- Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::ShipmentTypeRequirement](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentTypeRequirement)\>) --- Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).

### #shipments

    def shipments() -> ::Array<::Google::Cloud::Optimization::V1::Shipment>

**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::Shipment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Shipment)\>) --- Set of shipments which must be performed in the model.

### #shipments=

    def shipments=(value) -> ::Array<::Google::Cloud::Optimization::V1::Shipment>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Optimization::V1::Shipment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Shipment)\>) --- Set of shipments which must be performed in the model.
**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::Shipment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Shipment)\>) --- Set of shipments which must be performed in the model.

### #transition_attributes

    def transition_attributes() -> ::Array<::Google::Cloud::Optimization::V1::TransitionAttributes>

**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::TransitionAttributes](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-TransitionAttributes)\>) --- Transition attributes added to the model.

### #transition_attributes=

    def transition_attributes=(value) -> ::Array<::Google::Cloud::Optimization::V1::TransitionAttributes>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Optimization::V1::TransitionAttributes](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-TransitionAttributes)\>) --- Transition attributes added to the model.
**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::TransitionAttributes](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-TransitionAttributes)\>) --- Transition attributes added to the model.

### #vehicles

    def vehicles() -> ::Array<::Google::Cloud::Optimization::V1::Vehicle>

**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::Vehicle](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle)\>) --- Set of vehicles which can be used to perform visits.

### #vehicles=

    def vehicles=(value) -> ::Array<::Google::Cloud::Optimization::V1::Vehicle>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Optimization::V1::Vehicle](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle)\>) --- Set of vehicles which can be used to perform visits.
**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::Vehicle](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle)\>) --- Set of vehicles which can be used to perform visits.