# Google Maps Route Optimization V1 Client - Class InjectedSolutionConstraint (0.6.2)

0.6.2 (latest) 0.6.1 0.5.1 0.4.1 0.3.3 0.2.0 0.1.0 Reference documentation and code samples for the Google Maps Route Optimization V1 Client class InjectedSolutionConstraint.

Solution injected in the request including information about which visits
must be constrained and how they must be constrained.

Generated from protobuf message `google.maps.routeoptimization.v1.InjectedSolutionConstraint`

## Namespace

Google \\ Maps \\ RouteOptimization \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ routes` | `array<https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.ShipmentRoute>` Routes of the solution to inject. Some routes may be omitted from the original solution. The routes and skipped shipments must satisfy the basic validity assumptions listed for `injected_first_solution_routes`. |
| `↳ skipped_shipments` | `array<https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.SkippedShipment>` Skipped shipments of the solution to inject. Some may be omitted from the original solution. See the `routes` field. |
| `↳ constraint_relaxations` | `array<https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.InjectedSolutionConstraint.ConstraintRelaxation>` For zero or more groups of vehicles, specifies when and how much to relax constraints. If this field is empty, all non-empty vehicle routes are fully constrained. |

### getRoutes

Routes of the solution to inject. Some routes may be omitted from the
original solution. The routes and skipped shipments must satisfy the basic
validity assumptions listed for `injected_first_solution_routes`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.ShipmentRoute>` |   |

### setRoutes

Routes of the solution to inject. Some routes may be omitted from the
original solution. The routes and skipped shipments must satisfy the basic
validity assumptions listed for `injected_first_solution_routes`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.ShipmentRoute>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSkippedShipments

Skipped shipments of the solution to inject. Some may be omitted from the
original solution. See the `routes` field.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.SkippedShipment>` |   |

### setSkippedShipments

Skipped shipments of the solution to inject. Some may be omitted from the
original solution. See the `routes` field.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.SkippedShipment>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getConstraintRelaxations

For zero or more groups of vehicles, specifies when and how much to relax
constraints. If this field is empty, all non-empty vehicle routes are
fully constrained.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.InjectedSolutionConstraint.ConstraintRelaxation>` |   |

### setConstraintRelaxations

For zero or more groups of vehicles, specifies when and how much to relax
constraints. If this field is empty, all non-empty vehicle routes are
fully constrained.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.InjectedSolutionConstraint.ConstraintRelaxation>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |