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

namespace Google\Cloud\Optimization\V1\Vehicle;

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

/**
 * Defines a load limit applying to a vehicle, e.g. "this truck may only
 * carry up to 3500 kg". See
 * [load_limits][google.cloud.optimization.v1.Vehicle.load_limits].
 *
 * Generated from protobuf message <code>google.cloud.optimization.v1.Vehicle.LoadLimit</code>
 */
class LoadLimit extends \Google\Protobuf\Internal\Message
{
    /**
     * The maximum acceptable amount of load.
     *
     * Generated from protobuf field <code>optional int64 max_load = 1;</code>
     */
    private $max_load = null;
    /**
     * A soft limit of the load. See
     * [cost_per_unit_above_soft_max][google.cloud.optimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max].
     *
     * Generated from protobuf field <code>int64 soft_max_load = 2;</code>
     */
    private $soft_max_load = 0;
    /**
     * If the load ever exceeds
     * [soft_max_load][google.cloud.optimization.v1.Vehicle.LoadLimit.soft_max_load]
     * along this vehicle's route, the following cost penalty applies (only once
     * per vehicle): (load -
     * [soft_max_load][google.cloud.optimization.v1.Vehicle.LoadLimit.soft_max_load])
     * * [cost_per_unit_above_soft_max][google.cloud.optimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. All costs
     * add up and must be in the same unit as
     * [Shipment.penalty_cost][google.cloud.optimization.v1.Shipment.penalty_cost].
     *
     * Generated from protobuf field <code>double cost_per_unit_above_soft_max = 3;</code>
     */
    private $cost_per_unit_above_soft_max = 0.0;
    /**
     * The acceptable load interval of the vehicle at the start of the route.
     *
     * Generated from protobuf field <code>.google.cloud.optimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4;</code>
     */
    private $start_load_interval = null;
    /**
     * The acceptable load interval of the vehicle at the end of the route.
     *
     * Generated from protobuf field <code>.google.cloud.optimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5;</code>
     */
    private $end_load_interval = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $max_load
     *           The maximum acceptable amount of load.
     *     @type int|string $soft_max_load
     *           A soft limit of the load. See
     *           [cost_per_unit_above_soft_max][google.cloud.optimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max].
     *     @type float $cost_per_unit_above_soft_max
     *           If the load ever exceeds
     *           [soft_max_load][google.cloud.optimization.v1.Vehicle.LoadLimit.soft_max_load]
     *           along this vehicle's route, the following cost penalty applies (only once
     *           per vehicle): (load -
     *           [soft_max_load][google.cloud.optimization.v1.Vehicle.LoadLimit.soft_max_load])
     *           * [cost_per_unit_above_soft_max][google.cloud.optimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. All costs
     *           add up and must be in the same unit as
     *           [Shipment.penalty_cost][google.cloud.optimization.v1.Shipment.penalty_cost].
     *     @type \Google\Cloud\Optimization\V1\Vehicle\LoadLimit\Interval $start_load_interval
     *           The acceptable load interval of the vehicle at the start of the route.
     *     @type \Google\Cloud\Optimization\V1\Vehicle\LoadLimit\Interval $end_load_interval
     *           The acceptable load interval of the vehicle at the end of the route.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Optimization\V1\FleetRouting::initOnce();
        parent::__construct($data);
    }

    /**
     * The maximum acceptable amount of load.
     *
     * Generated from protobuf field <code>optional int64 max_load = 1;</code>
     * @return int|string
     */
    public function getMaxLoad()
    {
        return isset($this->max_load) ? $this->max_load : 0;
    }

    public function hasMaxLoad()
    {
        return isset($this->max_load);
    }

    public function clearMaxLoad()
    {
        unset($this->max_load);
    }

    /**
     * The maximum acceptable amount of load.
     *
     * Generated from protobuf field <code>optional int64 max_load = 1;</code>
     * @param int|string $var
     * @return $this
     */
    public function setMaxLoad($var)
    {
        GPBUtil::checkInt64($var);
        $this->max_load = $var;

        return $this;
    }

    /**
     * A soft limit of the load. See
     * [cost_per_unit_above_soft_max][google.cloud.optimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max].
     *
     * Generated from protobuf field <code>int64 soft_max_load = 2;</code>
     * @return int|string
     */
    public function getSoftMaxLoad()
    {
        return $this->soft_max_load;
    }

    /**
     * A soft limit of the load. See
     * [cost_per_unit_above_soft_max][google.cloud.optimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max].
     *
     * Generated from protobuf field <code>int64 soft_max_load = 2;</code>
     * @param int|string $var
     * @return $this
     */
    public function setSoftMaxLoad($var)
    {
        GPBUtil::checkInt64($var);
        $this->soft_max_load = $var;

        return $this;
    }

    /**
     * If the load ever exceeds
     * [soft_max_load][google.cloud.optimization.v1.Vehicle.LoadLimit.soft_max_load]
     * along this vehicle's route, the following cost penalty applies (only once
     * per vehicle): (load -
     * [soft_max_load][google.cloud.optimization.v1.Vehicle.LoadLimit.soft_max_load])
     * * [cost_per_unit_above_soft_max][google.cloud.optimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. All costs
     * add up and must be in the same unit as
     * [Shipment.penalty_cost][google.cloud.optimization.v1.Shipment.penalty_cost].
     *
     * Generated from protobuf field <code>double cost_per_unit_above_soft_max = 3;</code>
     * @return float
     */
    public function getCostPerUnitAboveSoftMax()
    {
        return $this->cost_per_unit_above_soft_max;
    }

    /**
     * If the load ever exceeds
     * [soft_max_load][google.cloud.optimization.v1.Vehicle.LoadLimit.soft_max_load]
     * along this vehicle's route, the following cost penalty applies (only once
     * per vehicle): (load -
     * [soft_max_load][google.cloud.optimization.v1.Vehicle.LoadLimit.soft_max_load])
     * * [cost_per_unit_above_soft_max][google.cloud.optimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. All costs
     * add up and must be in the same unit as
     * [Shipment.penalty_cost][google.cloud.optimization.v1.Shipment.penalty_cost].
     *
     * Generated from protobuf field <code>double cost_per_unit_above_soft_max = 3;</code>
     * @param float $var
     * @return $this
     */
    public function setCostPerUnitAboveSoftMax($var)
    {
        GPBUtil::checkDouble($var);
        $this->cost_per_unit_above_soft_max = $var;

        return $this;
    }

    /**
     * The acceptable load interval of the vehicle at the start of the route.
     *
     * Generated from protobuf field <code>.google.cloud.optimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4;</code>
     * @return \Google\Cloud\Optimization\V1\Vehicle\LoadLimit\Interval|null
     */
    public function getStartLoadInterval()
    {
        return $this->start_load_interval;
    }

    public function hasStartLoadInterval()
    {
        return isset($this->start_load_interval);
    }

    public function clearStartLoadInterval()
    {
        unset($this->start_load_interval);
    }

    /**
     * The acceptable load interval of the vehicle at the start of the route.
     *
     * Generated from protobuf field <code>.google.cloud.optimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4;</code>
     * @param \Google\Cloud\Optimization\V1\Vehicle\LoadLimit\Interval $var
     * @return $this
     */
    public function setStartLoadInterval($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Optimization\V1\Vehicle\LoadLimit\Interval::class);
        $this->start_load_interval = $var;

        return $this;
    }

    /**
     * The acceptable load interval of the vehicle at the end of the route.
     *
     * Generated from protobuf field <code>.google.cloud.optimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5;</code>
     * @return \Google\Cloud\Optimization\V1\Vehicle\LoadLimit\Interval|null
     */
    public function getEndLoadInterval()
    {
        return $this->end_load_interval;
    }

    public function hasEndLoadInterval()
    {
        return isset($this->end_load_interval);
    }

    public function clearEndLoadInterval()
    {
        unset($this->end_load_interval);
    }

    /**
     * The acceptable load interval of the vehicle at the end of the route.
     *
     * Generated from protobuf field <code>.google.cloud.optimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5;</code>
     * @param \Google\Cloud\Optimization\V1\Vehicle\LoadLimit\Interval $var
     * @return $this
     */
    public function setEndLoadInterval($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Optimization\V1\Vehicle\LoadLimit\Interval::class);
        $this->end_load_interval = $var;

        return $this;
    }

}


