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

For a group of vehicles, specifies at what threshold(s) constraints on
visits will be relaxed and to which level. Shipments listed in
the `skipped_shipment` field are constrained to be skipped; i.e., they
cannot be performed.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #relaxations

    def relaxations() -> ::Array<::Google::Cloud::Optimization::V1::InjectedSolutionConstraint::ConstraintRelaxation::Relaxation>

**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::InjectedSolutionConstraint::ConstraintRelaxation::Relaxation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-InjectedSolutionConstraint-ConstraintRelaxation-Relaxation)\>) --- All the visit constraint relaxations that will apply to visits on routes with vehicles in `vehicle_indices`.

### #relaxations=

    def relaxations=(value) -> ::Array<::Google::Cloud::Optimization::V1::InjectedSolutionConstraint::ConstraintRelaxation::Relaxation>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Optimization::V1::InjectedSolutionConstraint::ConstraintRelaxation::Relaxation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-InjectedSolutionConstraint-ConstraintRelaxation-Relaxation)\>) --- All the visit constraint relaxations that will apply to visits on routes with vehicles in `vehicle_indices`.
**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::InjectedSolutionConstraint::ConstraintRelaxation::Relaxation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-InjectedSolutionConstraint-ConstraintRelaxation-Relaxation)\>) --- All the visit constraint relaxations that will apply to visits on routes with vehicles in `vehicle_indices`.

### #vehicle_indices

    def vehicle_indices() -> ::Array<::Integer>

**Returns**

- (::Array\<::Integer\>) --- Specifies the vehicle indices to which the visit constraint `relaxations` apply. If empty, this is considered the default and the `relaxations` apply to all vehicles that are not specified in other `constraint_relaxations`. There can be at most one default, i.e., at most one constraint relaxation field is allowed empty `vehicle_indices`. A vehicle index can only be listed once, even within several `constraint_relaxations`.


  A vehicle index is mapped the same as
  [ShipmentRoute.vehicle_index](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute#Google__Cloud__Optimization__V1__ShipmentRoute_vehicle_index_instance_ "Google::Cloud::Optimization::V1::ShipmentRoute#vehicle_index (method)"),
  if `interpret_injected_solutions_using_labels` is true (see `fields`
  comment).

### #vehicle_indices=

    def vehicle_indices=(value) -> ::Array<::Integer>

**Parameter**

- **value** (::Array\<::Integer\>) --- Specifies the vehicle indices to which the visit constraint `relaxations` apply. If empty, this is considered the default and the `relaxations` apply to all vehicles that are not specified in other `constraint_relaxations`. There can be at most one default, i.e., at most one constraint relaxation field is allowed empty `vehicle_indices`. A vehicle index can only be listed once, even within several `constraint_relaxations`.


  A vehicle index is mapped the same as
  [ShipmentRoute.vehicle_index](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute#Google__Cloud__Optimization__V1__ShipmentRoute_vehicle_index_instance_ "Google::Cloud::Optimization::V1::ShipmentRoute#vehicle_index (method)"),
  if `interpret_injected_solutions_using_labels` is true (see `fields`
  comment).
**Returns**

- (::Array\<::Integer\>) --- Specifies the vehicle indices to which the visit constraint `relaxations` apply. If empty, this is considered the default and the `relaxations` apply to all vehicles that are not specified in other `constraint_relaxations`. There can be at most one default, i.e., at most one constraint relaxation field is allowed empty `vehicle_indices`. A vehicle index can only be listed once, even within several `constraint_relaxations`.


  A vehicle index is mapped the same as
  [ShipmentRoute.vehicle_index](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute#Google__Cloud__Optimization__V1__ShipmentRoute_vehicle_index_instance_ "Google::Cloud::Optimization::V1::ShipmentRoute#vehicle_index (method)"),
  if `interpret_injected_solutions_using_labels` is true (see `fields`
  comment).