<?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;

/**
 * Aggregated metrics for
 * [ShipmentRoute][google.cloud.optimization.v1.ShipmentRoute] (resp. for
 * [OptimizeToursResponse][google.cloud.optimization.v1.OptimizeToursResponse]
 * over all [Transition][google.cloud.optimization.v1.ShipmentRoute.Transition]
 * and/or [Visit][google.cloud.optimization.v1.ShipmentRoute.Visit] (resp. over
 * all [ShipmentRoute][google.cloud.optimization.v1.ShipmentRoute]) elements.
 *
 * Generated from protobuf message <code>google.cloud.optimization.v1.AggregatedMetrics</code>
 */
class AggregatedMetrics extends \Google\Protobuf\Internal\Message
{
    /**
     * Number of shipments performed. Note that a pickup and delivery pair only
     * counts once.
     *
     * Generated from protobuf field <code>int32 performed_shipment_count = 1;</code>
     */
    private $performed_shipment_count = 0;
    /**
     * Total travel duration for a route or a solution.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration travel_duration = 2;</code>
     */
    private $travel_duration = null;
    /**
     * Total wait duration for a route or a solution.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration wait_duration = 3;</code>
     */
    private $wait_duration = null;
    /**
     * Total delay duration for a route or a solution.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration delay_duration = 4;</code>
     */
    private $delay_duration = null;
    /**
     * Total break duration for a route or a solution.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration break_duration = 5;</code>
     */
    private $break_duration = null;
    /**
     * Total visit duration for a route or a solution.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration visit_duration = 6;</code>
     */
    private $visit_duration = null;
    /**
     * The total duration should be equal to the sum of all durations above.
     * For routes, it also corresponds to
     * [ShipmentRoute.vehicle_end_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_end_time]
     * -
     * [ShipmentRoute.vehicle_start_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_start_time].
     *
     * Generated from protobuf field <code>.google.protobuf.Duration total_duration = 7;</code>
     */
    private $total_duration = null;
    /**
     * Total travel distance for a route or a solution.
     *
     * Generated from protobuf field <code>double travel_distance_meters = 8;</code>
     */
    private $travel_distance_meters = 0.0;
    /**
     * Maximum load achieved over the entire route (resp. solution), for each of
     * the quantities on this route (resp. solution), computed as the maximum over
     * all
     * [Transition.vehicle_loads][google.cloud.optimization.v1.ShipmentRoute.Transition.vehicle_loads]
     * (resp.
     * [ShipmentRoute.metrics.max_loads][google.cloud.optimization.v1.AggregatedMetrics.max_loads].
     *
     * Generated from protobuf field <code>map<string, .google.cloud.optimization.v1.ShipmentRoute.VehicleLoad> max_loads = 9;</code>
     */
    private $max_loads;
    /**
     * Deprecated: Use
     * [ShipmentRoute.route_costs][google.cloud.optimization.v1.ShipmentRoute.route_costs]
     * and
     * [OptimizeToursResponse.Metrics.costs][google.cloud.optimization.v1.OptimizeToursResponse.Metrics.costs]
     * instead.
     *
     * Generated from protobuf field <code>map<string, double> costs = 10 [deprecated = true];</code>
     * @deprecated
     */
    private $costs;
    /**
     * Deprecated: Use
     * [ShipmentRoute.route_total_cost][google.cloud.optimization.v1.ShipmentRoute.route_total_cost]
     * and
     * [OptimizeToursResponse.Metrics.total_cost][google.cloud.optimization.v1.OptimizeToursResponse.Metrics.total_cost]
     * instead.
     *
     * Generated from protobuf field <code>double total_cost = 11 [deprecated = true];</code>
     * @deprecated
     */
    protected $total_cost = 0.0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $performed_shipment_count
     *           Number of shipments performed. Note that a pickup and delivery pair only
     *           counts once.
     *     @type \Google\Protobuf\Duration $travel_duration
     *           Total travel duration for a route or a solution.
     *     @type \Google\Protobuf\Duration $wait_duration
     *           Total wait duration for a route or a solution.
     *     @type \Google\Protobuf\Duration $delay_duration
     *           Total delay duration for a route or a solution.
     *     @type \Google\Protobuf\Duration $break_duration
     *           Total break duration for a route or a solution.
     *     @type \Google\Protobuf\Duration $visit_duration
     *           Total visit duration for a route or a solution.
     *     @type \Google\Protobuf\Duration $total_duration
     *           The total duration should be equal to the sum of all durations above.
     *           For routes, it also corresponds to
     *           [ShipmentRoute.vehicle_end_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_end_time]
     *           -
     *           [ShipmentRoute.vehicle_start_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_start_time].
     *     @type float $travel_distance_meters
     *           Total travel distance for a route or a solution.
     *     @type array|\Google\Protobuf\Internal\MapField $max_loads
     *           Maximum load achieved over the entire route (resp. solution), for each of
     *           the quantities on this route (resp. solution), computed as the maximum over
     *           all
     *           [Transition.vehicle_loads][google.cloud.optimization.v1.ShipmentRoute.Transition.vehicle_loads]
     *           (resp.
     *           [ShipmentRoute.metrics.max_loads][google.cloud.optimization.v1.AggregatedMetrics.max_loads].
     *     @type array|\Google\Protobuf\Internal\MapField $costs
     *           Deprecated: Use
     *           [ShipmentRoute.route_costs][google.cloud.optimization.v1.ShipmentRoute.route_costs]
     *           and
     *           [OptimizeToursResponse.Metrics.costs][google.cloud.optimization.v1.OptimizeToursResponse.Metrics.costs]
     *           instead.
     *     @type float $total_cost
     *           Deprecated: Use
     *           [ShipmentRoute.route_total_cost][google.cloud.optimization.v1.ShipmentRoute.route_total_cost]
     *           and
     *           [OptimizeToursResponse.Metrics.total_cost][google.cloud.optimization.v1.OptimizeToursResponse.Metrics.total_cost]
     *           instead.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Optimization\V1\FleetRouting::initOnce();
        parent::__construct($data);
    }

    /**
     * Number of shipments performed. Note that a pickup and delivery pair only
     * counts once.
     *
     * Generated from protobuf field <code>int32 performed_shipment_count = 1;</code>
     * @return int
     */
    public function getPerformedShipmentCount()
    {
        return $this->performed_shipment_count;
    }

    /**
     * Number of shipments performed. Note that a pickup and delivery pair only
     * counts once.
     *
     * Generated from protobuf field <code>int32 performed_shipment_count = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setPerformedShipmentCount($var)
    {
        GPBUtil::checkInt32($var);
        $this->performed_shipment_count = $var;

        return $this;
    }

    /**
     * Total travel duration for a route or a solution.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration travel_duration = 2;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getTravelDuration()
    {
        return $this->travel_duration;
    }

    public function hasTravelDuration()
    {
        return isset($this->travel_duration);
    }

    public function clearTravelDuration()
    {
        unset($this->travel_duration);
    }

    /**
     * Total travel duration for a route or a solution.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration travel_duration = 2;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setTravelDuration($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->travel_duration = $var;

        return $this;
    }

    /**
     * Total wait duration for a route or a solution.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration wait_duration = 3;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getWaitDuration()
    {
        return $this->wait_duration;
    }

    public function hasWaitDuration()
    {
        return isset($this->wait_duration);
    }

    public function clearWaitDuration()
    {
        unset($this->wait_duration);
    }

    /**
     * Total wait duration for a route or a solution.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration wait_duration = 3;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setWaitDuration($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->wait_duration = $var;

        return $this;
    }

    /**
     * Total delay duration for a route or a solution.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration delay_duration = 4;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getDelayDuration()
    {
        return $this->delay_duration;
    }

    public function hasDelayDuration()
    {
        return isset($this->delay_duration);
    }

    public function clearDelayDuration()
    {
        unset($this->delay_duration);
    }

    /**
     * Total delay duration for a route or a solution.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration delay_duration = 4;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setDelayDuration($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->delay_duration = $var;

        return $this;
    }

    /**
     * Total break duration for a route or a solution.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration break_duration = 5;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getBreakDuration()
    {
        return $this->break_duration;
    }

    public function hasBreakDuration()
    {
        return isset($this->break_duration);
    }

    public function clearBreakDuration()
    {
        unset($this->break_duration);
    }

    /**
     * Total break duration for a route or a solution.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration break_duration = 5;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setBreakDuration($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->break_duration = $var;

        return $this;
    }

    /**
     * Total visit duration for a route or a solution.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration visit_duration = 6;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getVisitDuration()
    {
        return $this->visit_duration;
    }

    public function hasVisitDuration()
    {
        return isset($this->visit_duration);
    }

    public function clearVisitDuration()
    {
        unset($this->visit_duration);
    }

    /**
     * Total visit duration for a route or a solution.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration visit_duration = 6;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setVisitDuration($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->visit_duration = $var;

        return $this;
    }

    /**
     * The total duration should be equal to the sum of all durations above.
     * For routes, it also corresponds to
     * [ShipmentRoute.vehicle_end_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_end_time]
     * -
     * [ShipmentRoute.vehicle_start_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_start_time].
     *
     * Generated from protobuf field <code>.google.protobuf.Duration total_duration = 7;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getTotalDuration()
    {
        return $this->total_duration;
    }

    public function hasTotalDuration()
    {
        return isset($this->total_duration);
    }

    public function clearTotalDuration()
    {
        unset($this->total_duration);
    }

    /**
     * The total duration should be equal to the sum of all durations above.
     * For routes, it also corresponds to
     * [ShipmentRoute.vehicle_end_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_end_time]
     * -
     * [ShipmentRoute.vehicle_start_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_start_time].
     *
     * Generated from protobuf field <code>.google.protobuf.Duration total_duration = 7;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setTotalDuration($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->total_duration = $var;

        return $this;
    }

    /**
     * Total travel distance for a route or a solution.
     *
     * Generated from protobuf field <code>double travel_distance_meters = 8;</code>
     * @return float
     */
    public function getTravelDistanceMeters()
    {
        return $this->travel_distance_meters;
    }

    /**
     * Total travel distance for a route or a solution.
     *
     * Generated from protobuf field <code>double travel_distance_meters = 8;</code>
     * @param float $var
     * @return $this
     */
    public function setTravelDistanceMeters($var)
    {
        GPBUtil::checkDouble($var);
        $this->travel_distance_meters = $var;

        return $this;
    }

    /**
     * Maximum load achieved over the entire route (resp. solution), for each of
     * the quantities on this route (resp. solution), computed as the maximum over
     * all
     * [Transition.vehicle_loads][google.cloud.optimization.v1.ShipmentRoute.Transition.vehicle_loads]
     * (resp.
     * [ShipmentRoute.metrics.max_loads][google.cloud.optimization.v1.AggregatedMetrics.max_loads].
     *
     * Generated from protobuf field <code>map<string, .google.cloud.optimization.v1.ShipmentRoute.VehicleLoad> max_loads = 9;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getMaxLoads()
    {
        return $this->max_loads;
    }

    /**
     * Maximum load achieved over the entire route (resp. solution), for each of
     * the quantities on this route (resp. solution), computed as the maximum over
     * all
     * [Transition.vehicle_loads][google.cloud.optimization.v1.ShipmentRoute.Transition.vehicle_loads]
     * (resp.
     * [ShipmentRoute.metrics.max_loads][google.cloud.optimization.v1.AggregatedMetrics.max_loads].
     *
     * Generated from protobuf field <code>map<string, .google.cloud.optimization.v1.ShipmentRoute.VehicleLoad> max_loads = 9;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setMaxLoads($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Optimization\V1\ShipmentRoute\VehicleLoad::class);
        $this->max_loads = $arr;

        return $this;
    }

    /**
     * Deprecated: Use
     * [ShipmentRoute.route_costs][google.cloud.optimization.v1.ShipmentRoute.route_costs]
     * and
     * [OptimizeToursResponse.Metrics.costs][google.cloud.optimization.v1.OptimizeToursResponse.Metrics.costs]
     * instead.
     *
     * Generated from protobuf field <code>map<string, double> costs = 10 [deprecated = true];</code>
     * @return \Google\Protobuf\Internal\MapField
     * @deprecated
     */
    public function getCosts()
    {
        @trigger_error('costs is deprecated.', E_USER_DEPRECATED);
        return $this->costs;
    }

    /**
     * Deprecated: Use
     * [ShipmentRoute.route_costs][google.cloud.optimization.v1.ShipmentRoute.route_costs]
     * and
     * [OptimizeToursResponse.Metrics.costs][google.cloud.optimization.v1.OptimizeToursResponse.Metrics.costs]
     * instead.
     *
     * Generated from protobuf field <code>map<string, double> costs = 10 [deprecated = true];</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     * @deprecated
     */
    public function setCosts($var)
    {
        @trigger_error('costs is deprecated.', E_USER_DEPRECATED);
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::DOUBLE);
        $this->costs = $arr;

        return $this;
    }

    /**
     * Deprecated: Use
     * [ShipmentRoute.route_total_cost][google.cloud.optimization.v1.ShipmentRoute.route_total_cost]
     * and
     * [OptimizeToursResponse.Metrics.total_cost][google.cloud.optimization.v1.OptimizeToursResponse.Metrics.total_cost]
     * instead.
     *
     * Generated from protobuf field <code>double total_cost = 11 [deprecated = true];</code>
     * @return float
     * @deprecated
     */
    public function getTotalCost()
    {
        @trigger_error('total_cost is deprecated.', E_USER_DEPRECATED);
        return $this->total_cost;
    }

    /**
     * Deprecated: Use
     * [ShipmentRoute.route_total_cost][google.cloud.optimization.v1.ShipmentRoute.route_total_cost]
     * and
     * [OptimizeToursResponse.Metrics.total_cost][google.cloud.optimization.v1.OptimizeToursResponse.Metrics.total_cost]
     * instead.
     *
     * Generated from protobuf field <code>double total_cost = 11 [deprecated = true];</code>
     * @param float $var
     * @return $this
     * @deprecated
     */
    public function setTotalCost($var)
    {
        @trigger_error('total_cost is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkDouble($var);
        $this->total_cost = $var;

        return $this;
    }

}

