<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/optimization/v1/fleet_routing.proto

namespace Google\Cloud\Optimization\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Solution injected in the request including information about which visits
 * must be constrained and how they must be constrained.
 *
 * Generated from protobuf message <code>google.cloud.optimization.v1.InjectedSolutionConstraint</code>
 */
class InjectedSolutionConstraint extends \Google\Protobuf\Internal\Message
{
    /**
     * 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`.
     *
     * Generated from protobuf field <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
     */
    private $routes;
    /**
     * Skipped shipments of the solution to inject. Some may be omitted from the
     * original solution. See the `routes` field.
     *
     * Generated from protobuf field <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 2;</code>
     */
    private $skipped_shipments;
    /**
     * 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.
     *
     * Generated from protobuf field <code>repeated .google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3;</code>
     */
    private $constraint_relaxations;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Cloud\Optimization\V1\ShipmentRoute>|\Google\Protobuf\Internal\RepeatedField $routes
     *           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`.
     *     @type array<\Google\Cloud\Optimization\V1\SkippedShipment>|\Google\Protobuf\Internal\RepeatedField $skipped_shipments
     *           Skipped shipments of the solution to inject. Some may be omitted from the
     *           original solution. See the `routes` field.
     *     @type array<\Google\Cloud\Optimization\V1\InjectedSolutionConstraint\ConstraintRelaxation>|\Google\Protobuf\Internal\RepeatedField $constraint_relaxations
     *           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.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Optimization\V1\FleetRouting::initOnce();
        parent::__construct($data);
    }

    /**
     * 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`.
     *
     * Generated from protobuf field <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getRoutes()
    {
        return $this->routes;
    }

    /**
     * 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`.
     *
     * Generated from protobuf field <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
     * @param array<\Google\Cloud\Optimization\V1\ShipmentRoute>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setRoutes($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Optimization\V1\ShipmentRoute::class);
        $this->routes = $arr;

        return $this;
    }

    /**
     * Skipped shipments of the solution to inject. Some may be omitted from the
     * original solution. See the `routes` field.
     *
     * Generated from protobuf field <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getSkippedShipments()
    {
        return $this->skipped_shipments;
    }

    /**
     * Skipped shipments of the solution to inject. Some may be omitted from the
     * original solution. See the `routes` field.
     *
     * Generated from protobuf field <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 2;</code>
     * @param array<\Google\Cloud\Optimization\V1\SkippedShipment>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setSkippedShipments($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Optimization\V1\SkippedShipment::class);
        $this->skipped_shipments = $arr;

        return $this;
    }

    /**
     * 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.
     *
     * Generated from protobuf field <code>repeated .google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getConstraintRelaxations()
    {
        return $this->constraint_relaxations;
    }

    /**
     * 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.
     *
     * Generated from protobuf field <code>repeated .google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3;</code>
     * @param array<\Google\Cloud\Optimization\V1\InjectedSolutionConstraint\ConstraintRelaxation>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setConstraintRelaxations($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Optimization\V1\InjectedSolutionConstraint\ConstraintRelaxation::class);
        $this->constraint_relaxations = $arr;

        return $this;
    }

}

