<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/maps/routeoptimization/v1/route_optimization_service.proto

namespace Google\Maps\RouteOptimization\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.maps.routeoptimization.v1.Vehicle.load_limits].
 *
 * Generated from protobuf message <code>google.maps.routeoptimization.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>
     */
    protected $max_load = null;
    /**
     * A soft limit of the load. See
     * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max].
     *
     * Generated from protobuf field <code>int64 soft_max_load = 2;</code>
     */
    protected $soft_max_load = 0;
    /**
     * If the load ever exceeds
     * [soft_max_load][google.maps.routeoptimization.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.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load])
     * * [cost_per_unit_above_soft_max][google.maps.routeoptimization.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.maps.routeoptimization.v1.Shipment.penalty_cost].
     * Soft limits may only be defined on types that apply to either pickups
     * only or deliveries only throughout the model.
     *
     * Generated from protobuf field <code>double cost_per_unit_above_soft_max = 3;</code>
     */
    protected $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.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4;</code>
     */
    protected $start_load_interval = null;
    /**
     * The acceptable load interval of the vehicle at the end of the route.
     *
     * Generated from protobuf field <code>.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5;</code>
     */
    protected $end_load_interval = null;
    /**
     * Cost of moving one unit of load over one kilometer for this vehicle.
     * This can be used as a proxy for fuel consumption: if the load is a weight
     * (in Newtons), then load*kilometer has the dimension of an energy.
     * Experimental: See
     * https://developers.google.com/maps/tt/route-optimization/experimental/load-cost/make-request
     * for more details.
     *
     * Generated from protobuf field <code>optional .google.maps.routeoptimization.v1.Vehicle.LoadLimit.LoadCost cost_per_kilometer = 6;</code>
     */
    protected $cost_per_kilometer = null;
    /**
     * Cost of traveling with a unit of load during one hour for this vehicle.
     * Experimental: See
     * https://developers.google.com/maps/tt/route-optimization/experimental/load-cost/make-request
     * for more details.
     *
     * Generated from protobuf field <code>optional .google.maps.routeoptimization.v1.Vehicle.LoadLimit.LoadCost cost_per_traveled_hour = 7;</code>
     */
    protected $cost_per_traveled_hour = 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.maps.routeoptimization.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.maps.routeoptimization.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.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load])
     *           * [cost_per_unit_above_soft_max][google.maps.routeoptimization.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.maps.routeoptimization.v1.Shipment.penalty_cost].
     *           Soft limits may only be defined on types that apply to either pickups
     *           only or deliveries only throughout the model.
     *     @type \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\Interval $start_load_interval
     *           The acceptable load interval of the vehicle at the start of the route.
     *     @type \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\Interval $end_load_interval
     *           The acceptable load interval of the vehicle at the end of the route.
     *     @type \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\LoadCost $cost_per_kilometer
     *           Cost of moving one unit of load over one kilometer for this vehicle.
     *           This can be used as a proxy for fuel consumption: if the load is a weight
     *           (in Newtons), then load*kilometer has the dimension of an energy.
     *           Experimental: See
     *           https://developers.google.com/maps/tt/route-optimization/experimental/load-cost/make-request
     *           for more details.
     *     @type \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\LoadCost $cost_per_traveled_hour
     *           Cost of traveling with a unit of load during one hour for this vehicle.
     *           Experimental: See
     *           https://developers.google.com/maps/tt/route-optimization/experimental/load-cost/make-request
     *           for more details.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::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.maps.routeoptimization.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.maps.routeoptimization.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.maps.routeoptimization.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.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load])
     * * [cost_per_unit_above_soft_max][google.maps.routeoptimization.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.maps.routeoptimization.v1.Shipment.penalty_cost].
     * Soft limits may only be defined on types that apply to either pickups
     * only or deliveries only throughout the model.
     *
     * 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.maps.routeoptimization.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.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load])
     * * [cost_per_unit_above_soft_max][google.maps.routeoptimization.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.maps.routeoptimization.v1.Shipment.penalty_cost].
     * Soft limits may only be defined on types that apply to either pickups
     * only or deliveries only throughout the model.
     *
     * 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.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4;</code>
     * @return \Google\Maps\RouteOptimization\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.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4;</code>
     * @param \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\Interval $var
     * @return $this
     */
    public function setStartLoadInterval($var)
    {
        GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\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.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5;</code>
     * @return \Google\Maps\RouteOptimization\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.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5;</code>
     * @param \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\Interval $var
     * @return $this
     */
    public function setEndLoadInterval($var)
    {
        GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\Interval::class);
        $this->end_load_interval = $var;

        return $this;
    }

    /**
     * Cost of moving one unit of load over one kilometer for this vehicle.
     * This can be used as a proxy for fuel consumption: if the load is a weight
     * (in Newtons), then load*kilometer has the dimension of an energy.
     * Experimental: See
     * https://developers.google.com/maps/tt/route-optimization/experimental/load-cost/make-request
     * for more details.
     *
     * Generated from protobuf field <code>optional .google.maps.routeoptimization.v1.Vehicle.LoadLimit.LoadCost cost_per_kilometer = 6;</code>
     * @return \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\LoadCost|null
     */
    public function getCostPerKilometer()
    {
        return $this->cost_per_kilometer;
    }

    public function hasCostPerKilometer()
    {
        return isset($this->cost_per_kilometer);
    }

    public function clearCostPerKilometer()
    {
        unset($this->cost_per_kilometer);
    }

    /**
     * Cost of moving one unit of load over one kilometer for this vehicle.
     * This can be used as a proxy for fuel consumption: if the load is a weight
     * (in Newtons), then load*kilometer has the dimension of an energy.
     * Experimental: See
     * https://developers.google.com/maps/tt/route-optimization/experimental/load-cost/make-request
     * for more details.
     *
     * Generated from protobuf field <code>optional .google.maps.routeoptimization.v1.Vehicle.LoadLimit.LoadCost cost_per_kilometer = 6;</code>
     * @param \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\LoadCost $var
     * @return $this
     */
    public function setCostPerKilometer($var)
    {
        GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\LoadCost::class);
        $this->cost_per_kilometer = $var;

        return $this;
    }

    /**
     * Cost of traveling with a unit of load during one hour for this vehicle.
     * Experimental: See
     * https://developers.google.com/maps/tt/route-optimization/experimental/load-cost/make-request
     * for more details.
     *
     * Generated from protobuf field <code>optional .google.maps.routeoptimization.v1.Vehicle.LoadLimit.LoadCost cost_per_traveled_hour = 7;</code>
     * @return \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\LoadCost|null
     */
    public function getCostPerTraveledHour()
    {
        return $this->cost_per_traveled_hour;
    }

    public function hasCostPerTraveledHour()
    {
        return isset($this->cost_per_traveled_hour);
    }

    public function clearCostPerTraveledHour()
    {
        unset($this->cost_per_traveled_hour);
    }

    /**
     * Cost of traveling with a unit of load during one hour for this vehicle.
     * Experimental: See
     * https://developers.google.com/maps/tt/route-optimization/experimental/load-cost/make-request
     * for more details.
     *
     * Generated from protobuf field <code>optional .google.maps.routeoptimization.v1.Vehicle.LoadLimit.LoadCost cost_per_traveled_hour = 7;</code>
     * @param \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\LoadCost $var
     * @return $this
     */
    public function setCostPerTraveledHour($var)
    {
        GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\LoadCost::class);
        $this->cost_per_traveled_hour = $var;

        return $this;
    }

}


