# Cloud Optimization V1 API - Class Google::Cloud::Optimization::V1::ShipmentRoute::Visit (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::ShipmentRoute::Visit.

A visit performed during a route. This visit corresponds to a pickup or a
delivery of a `Shipment`.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #arrival_loads

    def arrival_loads() -> ::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>

**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::CapacityQuantity](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-CapacityQuantity)\>) --- Deprecated: Use [Transition.vehicle_loads](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute-Transition#Google__Cloud__Optimization__V1__ShipmentRoute__Transition_vehicle_loads_instance_ "Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads (method)") instead. Vehicle loads upon arrival at the visit location, for each type specified in [Vehicle.capacities](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle#Google__Cloud__Optimization__V1__Vehicle_capacities_instance_ "Google::Cloud::Optimization::V1::Vehicle#capacities (method)"), `start_load_intervals`, `end_load_intervals` or `demands`.


  Exception: we omit loads for quantity types unconstrained by intervals
  and that don't have any non-zero demand on the route.

### #arrival_loads=

    def arrival_loads=(value) -> ::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Optimization::V1::CapacityQuantity](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-CapacityQuantity)\>) --- Deprecated: Use [Transition.vehicle_loads](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute-Transition#Google__Cloud__Optimization__V1__ShipmentRoute__Transition_vehicle_loads_instance_ "Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads (method)") instead. Vehicle loads upon arrival at the visit location, for each type specified in [Vehicle.capacities](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle#Google__Cloud__Optimization__V1__Vehicle_capacities_instance_ "Google::Cloud::Optimization::V1::Vehicle#capacities (method)"), `start_load_intervals`, `end_load_intervals` or `demands`.


  Exception: we omit loads for quantity types unconstrained by intervals
  and that don't have any non-zero demand on the route.
**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::CapacityQuantity](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-CapacityQuantity)\>) --- Deprecated: Use [Transition.vehicle_loads](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute-Transition#Google__Cloud__Optimization__V1__ShipmentRoute__Transition_vehicle_loads_instance_ "Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads (method)") instead. Vehicle loads upon arrival at the visit location, for each type specified in [Vehicle.capacities](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle#Google__Cloud__Optimization__V1__Vehicle_capacities_instance_ "Google::Cloud::Optimization::V1::Vehicle#capacities (method)"), `start_load_intervals`, `end_load_intervals` or `demands`.


  Exception: we omit loads for quantity types unconstrained by intervals
  and that don't have any non-zero demand on the route.

### #delay_before_start

    def delay_before_start() -> ::Google::Cloud::Optimization::V1::ShipmentRoute::Delay

**Returns**

- ([::Google::Cloud::Optimization::V1::ShipmentRoute::Delay](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute-Delay)) --- Deprecated: Use [ShipmentRoute.Transition.delay_duration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute-Transition#Google__Cloud__Optimization__V1__ShipmentRoute__Transition_delay_duration_instance_ "Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration (method)") instead. Delay occurring before the visit starts.

### #delay_before_start=

    def delay_before_start=(value) -> ::Google::Cloud::Optimization::V1::ShipmentRoute::Delay

**Parameter**

- **value** ([::Google::Cloud::Optimization::V1::ShipmentRoute::Delay](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute-Delay)) --- Deprecated: Use [ShipmentRoute.Transition.delay_duration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute-Transition#Google__Cloud__Optimization__V1__ShipmentRoute__Transition_delay_duration_instance_ "Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration (method)") instead. Delay occurring before the visit starts.
**Returns**

- ([::Google::Cloud::Optimization::V1::ShipmentRoute::Delay](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute-Delay)) --- Deprecated: Use [ShipmentRoute.Transition.delay_duration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute-Transition#Google__Cloud__Optimization__V1__ShipmentRoute__Transition_delay_duration_instance_ "Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration (method)") instead. Delay occurring before the visit starts.

### #demands

    def demands() -> ::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>

**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::CapacityQuantity](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-CapacityQuantity)\>) --- Deprecated: Use [Visit.load_demands](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute-Visit#Google__Cloud__Optimization__V1__ShipmentRoute__Visit_load_demands_instance_ "Google::Cloud::Optimization::V1::ShipmentRoute::Visit#load_demands (method)") instead.

### #demands=

    def demands=(value) -> ::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Optimization::V1::CapacityQuantity](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-CapacityQuantity)\>) --- Deprecated: Use [Visit.load_demands](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute-Visit#Google__Cloud__Optimization__V1__ShipmentRoute__Visit_load_demands_instance_ "Google::Cloud::Optimization::V1::ShipmentRoute::Visit#load_demands (method)") instead.
**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::CapacityQuantity](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-CapacityQuantity)\>) --- Deprecated: Use [Visit.load_demands](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute-Visit#Google__Cloud__Optimization__V1__ShipmentRoute__Visit_load_demands_instance_ "Google::Cloud::Optimization::V1::ShipmentRoute::Visit#load_demands (method)") instead.

### #detour

    def detour() -> ::Google::Protobuf::Duration

**Returns**

- ([::Google::Protobuf::Duration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Protobuf-Duration)) ---

  Extra detour time due to the shipments visited on the route before the
  visit and to the potential waiting time induced by time windows.
  If the visit is a delivery, the detour is computed from the corresponding
  pickup visit and is equal to:
  \`\`\`
  start_time(delivery) - start_time(pickup)
  - (duration(pickup) + travel duration from the pickup location to the delivery location). ``
    Otherwise, it is computed from the vehicle `start_location` and is equal
    to:
    `` start_time - vehicle_start_time - travel duration from the vehicle's `start_location` to the visit. \`\`\`

### #detour=

    def detour=(value) -> ::Google::Protobuf::Duration

**Parameter**

- **value** ([::Google::Protobuf::Duration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Protobuf-Duration)) ---

  Extra detour time due to the shipments visited on the route before the
  visit and to the potential waiting time induced by time windows.
  If the visit is a delivery, the detour is computed from the corresponding
  pickup visit and is equal to:
  \`\`\`
  start_time(delivery) - start_time(pickup)
  - (duration(pickup) + travel duration from the pickup location to the delivery location). ``
    Otherwise, it is computed from the vehicle `start_location` and is equal
    to:
    `` start_time - vehicle_start_time - travel duration from the vehicle's `start_location` to the visit. \`\`\`
**Returns**

- ([::Google::Protobuf::Duration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Protobuf-Duration)) ---

  Extra detour time due to the shipments visited on the route before the
  visit and to the potential waiting time induced by time windows.
  If the visit is a delivery, the detour is computed from the corresponding
  pickup visit and is equal to:
  \`\`\`
  start_time(delivery) - start_time(pickup)
  - (duration(pickup) + travel duration from the pickup location to the delivery location). ``
    Otherwise, it is computed from the vehicle `start_location` and is equal
    to:
    `` start_time - vehicle_start_time - travel duration from the vehicle's `start_location` to the visit. \`\`\`

### #is_pickup

    def is_pickup() -> ::Boolean

**Returns**

- (::Boolean) --- If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it corresponds to a delivery.

### #is_pickup=

    def is_pickup=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it corresponds to a delivery.
**Returns**

- (::Boolean) --- If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it corresponds to a delivery.

### #load_demands

    def load_demands() -> ::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::Shipment::Load}

**Returns**

- (::Google::Protobuf::Map{::String =\> ::Google::Cloud::Optimization::V1::Shipment::Load}) --- Total visit load demand as the sum of the shipment and the visit request `load_demands`. The values are negative if the visit is a delivery. Demands are reported for the same types as the [Transition.loads](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute-Transition "Google::Cloud::Optimization::V1::ShipmentRoute::Transition (class)") (see this field).

### #load_demands=

    def load_demands=(value) -> ::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::Shipment::Load}

**Parameter**

- **value** (::Google::Protobuf::Map{::String =\> ::Google::Cloud::Optimization::V1::Shipment::Load}) --- Total visit load demand as the sum of the shipment and the visit request `load_demands`. The values are negative if the visit is a delivery. Demands are reported for the same types as the [Transition.loads](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute-Transition "Google::Cloud::Optimization::V1::ShipmentRoute::Transition (class)") (see this field).
**Returns**

- (::Google::Protobuf::Map{::String =\> ::Google::Cloud::Optimization::V1::Shipment::Load}) --- Total visit load demand as the sum of the shipment and the visit request `load_demands`. The values are negative if the visit is a delivery. Demands are reported for the same types as the [Transition.loads](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute-Transition "Google::Cloud::Optimization::V1::ShipmentRoute::Transition (class)") (see this field).

### #shipment_index

    def shipment_index() -> ::Integer

**Returns**

- (::Integer) --- Index of the `shipments` field in the source [ShipmentModel](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentModel "Google::Cloud::Optimization::V1::ShipmentModel (class)").

### #shipment_index=

    def shipment_index=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- Index of the `shipments` field in the source [ShipmentModel](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentModel "Google::Cloud::Optimization::V1::ShipmentModel (class)").
**Returns**

- (::Integer) --- Index of the `shipments` field in the source [ShipmentModel](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentModel "Google::Cloud::Optimization::V1::ShipmentModel (class)").

### #shipment_label

    def shipment_label() -> ::String

**Returns**

- (::String) --- Copy of the corresponding `Shipment.label`, if specified in the `Shipment`.

### #shipment_label=

    def shipment_label=(value) -> ::String

**Parameter**

- **value** (::String) --- Copy of the corresponding `Shipment.label`, if specified in the `Shipment`.
**Returns**

- (::String) --- Copy of the corresponding `Shipment.label`, if specified in the `Shipment`.

### #start_time

    def 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)) --- Time at which the visit starts. Note that the vehicle may arrive earlier than this at the visit location. Times are consistent with the `ShipmentModel`.

### #start_time=

    def 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)) --- Time at which the visit starts. Note that the vehicle may arrive earlier than this at the visit location. Times are consistent with the `ShipmentModel`.
**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Protobuf-Timestamp)) --- Time at which the visit starts. Note that the vehicle may arrive earlier than this at the visit location. Times are consistent with the `ShipmentModel`.

### #visit_label

    def visit_label() -> ::String

**Returns**

- (::String) --- Copy of the corresponding [VisitRequest.label](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_label_instance_ "Google::Cloud::Optimization::V1::Shipment::VisitRequest#label (method)"), if specified in the `VisitRequest`.

### #visit_label=

    def visit_label=(value) -> ::String

**Parameter**

- **value** (::String) --- Copy of the corresponding [VisitRequest.label](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_label_instance_ "Google::Cloud::Optimization::V1::Shipment::VisitRequest#label (method)"), if specified in the `VisitRequest`.
**Returns**

- (::String) --- Copy of the corresponding [VisitRequest.label](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_label_instance_ "Google::Cloud::Optimization::V1::Shipment::VisitRequest#label (method)"), if specified in the `VisitRequest`.

### #visit_request_index

    def visit_request_index() -> ::Integer

**Returns**

- (::Integer) --- Index of `VisitRequest` in either the pickup or delivery field of the `Shipment` (see `is_pickup`).

### #visit_request_index=

    def visit_request_index=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- Index of `VisitRequest` in either the pickup or delivery field of the `Shipment` (see `is_pickup`).
**Returns**

- (::Integer) --- Index of `VisitRequest` in either the pickup or delivery field of the `Shipment` (see `is_pickup`).