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

namespace Google\Cloud\AIPlatform\V1\NearestNeighborQuery;

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

/**
 * Parameters that can be overrided in each query to tune query latency and
 * recall.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.NearestNeighborQuery.Parameters</code>
 */
class Parameters extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. The number of neighbors to find via approximate search before
     * exact reordering is performed; if set, this value must be >
     * neighbor_count.
     *
     * Generated from protobuf field <code>int32 approximate_neighbor_candidates = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $approximate_neighbor_candidates = 0;
    /**
     * Optional. The fraction of the number of leaves to search, set at query
     * time allows user to tune search performance. This value increase result
     * in both search accuracy and latency increase. The value should be between
     * 0.0 and 1.0.
     *
     * Generated from protobuf field <code>double leaf_nodes_search_fraction = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $leaf_nodes_search_fraction = 0.0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $approximate_neighbor_candidates
     *           Optional. The number of neighbors to find via approximate search before
     *           exact reordering is performed; if set, this value must be >
     *           neighbor_count.
     *     @type float $leaf_nodes_search_fraction
     *           Optional. The fraction of the number of leaves to search, set at query
     *           time allows user to tune search performance. This value increase result
     *           in both search accuracy and latency increase. The value should be between
     *           0.0 and 1.0.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\FeatureOnlineStoreService::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. The number of neighbors to find via approximate search before
     * exact reordering is performed; if set, this value must be >
     * neighbor_count.
     *
     * Generated from protobuf field <code>int32 approximate_neighbor_candidates = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getApproximateNeighborCandidates()
    {
        return $this->approximate_neighbor_candidates;
    }

    /**
     * Optional. The number of neighbors to find via approximate search before
     * exact reordering is performed; if set, this value must be >
     * neighbor_count.
     *
     * Generated from protobuf field <code>int32 approximate_neighbor_candidates = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setApproximateNeighborCandidates($var)
    {
        GPBUtil::checkInt32($var);
        $this->approximate_neighbor_candidates = $var;

        return $this;
    }

    /**
     * Optional. The fraction of the number of leaves to search, set at query
     * time allows user to tune search performance. This value increase result
     * in both search accuracy and latency increase. The value should be between
     * 0.0 and 1.0.
     *
     * Generated from protobuf field <code>double leaf_nodes_search_fraction = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return float
     */
    public function getLeafNodesSearchFraction()
    {
        return $this->leaf_nodes_search_fraction;
    }

    /**
     * Optional. The fraction of the number of leaves to search, set at query
     * time allows user to tune search performance. This value increase result
     * in both search accuracy and latency increase. The value should be between
     * 0.0 and 1.0.
     *
     * Generated from protobuf field <code>double leaf_nodes_search_fraction = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param float $var
     * @return $this
     */
    public function setLeafNodesSearchFraction($var)
    {
        GPBUtil::checkDouble($var);
        $this->leaf_nodes_search_fraction = $var;

        return $this;
    }

}


