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

namespace Google\Cloud\AIPlatform\V1;

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

/**
 * A message representing a Trial. A Trial contains a unique set of Parameters
 * that has been or will be evaluated, along with the objective metrics got by
 * running the Trial.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.Trial</code>
 */
class Trial extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. Resource name of the Trial assigned by the service.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $name = '';
    /**
     * Output only. The identifier of the Trial assigned by the service.
     *
     * Generated from protobuf field <code>string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $id = '';
    /**
     * Output only. The detailed state of the Trial.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.Trial.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $state = 0;
    /**
     * Output only. The parameters of the Trial.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.Trial.Parameter parameters = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $parameters;
    /**
     * Output only. The final measurement containing the objective value.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.Measurement final_measurement = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $final_measurement = null;
    /**
     * Output only. A list of measurements that are strictly lexicographically
     * ordered by their induced tuples (steps, elapsed_duration).
     * These are used for early stopping computations.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.Measurement measurements = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $measurements;
    /**
     * Output only. Time when the Trial was started.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $start_time = null;
    /**
     * Output only. Time when the Trial's status changed to `SUCCEEDED` or
     * `INFEASIBLE`.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $end_time = null;
    /**
     * Output only. The identifier of the client that originally requested this
     * Trial. Each client is identified by a unique client_id. When a client asks
     * for a suggestion, Vertex AI Vizier will assign it a Trial. The client
     * should evaluate the Trial, complete it, and report back to Vertex AI
     * Vizier. If suggestion is asked again by same client_id before the Trial is
     * completed, the same Trial will be returned. Multiple clients with
     * different client_ids can ask for suggestions simultaneously, each of them
     * will get their own Trial.
     *
     * Generated from protobuf field <code>string client_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $client_id = '';
    /**
     * Output only. A human readable string describing why the Trial is
     * infeasible. This is set only if Trial state is `INFEASIBLE`.
     *
     * Generated from protobuf field <code>string infeasible_reason = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $infeasible_reason = '';
    /**
     * Output only. The CustomJob name linked to the Trial.
     * It's set for a HyperparameterTuningJob's Trial.
     *
     * Generated from protobuf field <code>string custom_job = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {</code>
     */
    private $custom_job = '';
    /**
     * Output only. URIs for accessing [interactive
     * shells](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell)
     * (one URI for each training node). Only available if this trial is part of
     * a
     * [HyperparameterTuningJob][google.cloud.aiplatform.v1.HyperparameterTuningJob]
     * and the job's
     * [trial_job_spec.enable_web_access][google.cloud.aiplatform.v1.CustomJobSpec.enable_web_access]
     * field is `true`.
     * The keys are names of each node used for the trial; for example,
     * `workerpool0-0` for the primary node, `workerpool1-0` for the first node in
     * the second worker pool, and `workerpool1-1` for the second node in the
     * second worker pool.
     * The values are the URIs for each node's interactive shell.
     *
     * Generated from protobuf field <code>map<string, string> web_access_uris = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $web_access_uris;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Output only. Resource name of the Trial assigned by the service.
     *     @type string $id
     *           Output only. The identifier of the Trial assigned by the service.
     *     @type int $state
     *           Output only. The detailed state of the Trial.
     *     @type array<\Google\Cloud\AIPlatform\V1\Trial\Parameter>|\Google\Protobuf\Internal\RepeatedField $parameters
     *           Output only. The parameters of the Trial.
     *     @type \Google\Cloud\AIPlatform\V1\Measurement $final_measurement
     *           Output only. The final measurement containing the objective value.
     *     @type array<\Google\Cloud\AIPlatform\V1\Measurement>|\Google\Protobuf\Internal\RepeatedField $measurements
     *           Output only. A list of measurements that are strictly lexicographically
     *           ordered by their induced tuples (steps, elapsed_duration).
     *           These are used for early stopping computations.
     *     @type \Google\Protobuf\Timestamp $start_time
     *           Output only. Time when the Trial was started.
     *     @type \Google\Protobuf\Timestamp $end_time
     *           Output only. Time when the Trial's status changed to `SUCCEEDED` or
     *           `INFEASIBLE`.
     *     @type string $client_id
     *           Output only. The identifier of the client that originally requested this
     *           Trial. Each client is identified by a unique client_id. When a client asks
     *           for a suggestion, Vertex AI Vizier will assign it a Trial. The client
     *           should evaluate the Trial, complete it, and report back to Vertex AI
     *           Vizier. If suggestion is asked again by same client_id before the Trial is
     *           completed, the same Trial will be returned. Multiple clients with
     *           different client_ids can ask for suggestions simultaneously, each of them
     *           will get their own Trial.
     *     @type string $infeasible_reason
     *           Output only. A human readable string describing why the Trial is
     *           infeasible. This is set only if Trial state is `INFEASIBLE`.
     *     @type string $custom_job
     *           Output only. The CustomJob name linked to the Trial.
     *           It's set for a HyperparameterTuningJob's Trial.
     *     @type array|\Google\Protobuf\Internal\MapField $web_access_uris
     *           Output only. URIs for accessing [interactive
     *           shells](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell)
     *           (one URI for each training node). Only available if this trial is part of
     *           a
     *           [HyperparameterTuningJob][google.cloud.aiplatform.v1.HyperparameterTuningJob]
     *           and the job's
     *           [trial_job_spec.enable_web_access][google.cloud.aiplatform.v1.CustomJobSpec.enable_web_access]
     *           field is `true`.
     *           The keys are names of each node used for the trial; for example,
     *           `workerpool0-0` for the primary node, `workerpool1-0` for the first node in
     *           the second worker pool, and `workerpool1-1` for the second node in the
     *           second worker pool.
     *           The values are the URIs for each node's interactive shell.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\Study::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. Resource name of the Trial assigned by the service.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Output only. Resource name of the Trial assigned by the service.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Output only. The identifier of the Trial assigned by the service.
     *
     * Generated from protobuf field <code>string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Output only. The identifier of the Trial assigned by the service.
     *
     * Generated from protobuf field <code>string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * Output only. The detailed state of the Trial.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.Trial.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Output only. The detailed state of the Trial.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.Trial.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\AIPlatform\V1\Trial\State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * Output only. The parameters of the Trial.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.Trial.Parameter parameters = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getParameters()
    {
        return $this->parameters;
    }

    /**
     * Output only. The parameters of the Trial.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.Trial.Parameter parameters = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param array<\Google\Cloud\AIPlatform\V1\Trial\Parameter>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setParameters($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AIPlatform\V1\Trial\Parameter::class);
        $this->parameters = $arr;

        return $this;
    }

    /**
     * Output only. The final measurement containing the objective value.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.Measurement final_measurement = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Cloud\AIPlatform\V1\Measurement|null
     */
    public function getFinalMeasurement()
    {
        return $this->final_measurement;
    }

    public function hasFinalMeasurement()
    {
        return isset($this->final_measurement);
    }

    public function clearFinalMeasurement()
    {
        unset($this->final_measurement);
    }

    /**
     * Output only. The final measurement containing the objective value.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.Measurement final_measurement = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\AIPlatform\V1\Measurement $var
     * @return $this
     */
    public function setFinalMeasurement($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\Measurement::class);
        $this->final_measurement = $var;

        return $this;
    }

    /**
     * Output only. A list of measurements that are strictly lexicographically
     * ordered by their induced tuples (steps, elapsed_duration).
     * These are used for early stopping computations.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.Measurement measurements = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getMeasurements()
    {
        return $this->measurements;
    }

    /**
     * Output only. A list of measurements that are strictly lexicographically
     * ordered by their induced tuples (steps, elapsed_duration).
     * These are used for early stopping computations.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.Measurement measurements = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param array<\Google\Cloud\AIPlatform\V1\Measurement>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setMeasurements($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AIPlatform\V1\Measurement::class);
        $this->measurements = $arr;

        return $this;
    }

    /**
     * Output only. Time when the Trial was started.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getStartTime()
    {
        return $this->start_time;
    }

    public function hasStartTime()
    {
        return isset($this->start_time);
    }

    public function clearStartTime()
    {
        unset($this->start_time);
    }

    /**
     * Output only. Time when the Trial was started.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setStartTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->start_time = $var;

        return $this;
    }

    /**
     * Output only. Time when the Trial's status changed to `SUCCEEDED` or
     * `INFEASIBLE`.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getEndTime()
    {
        return $this->end_time;
    }

    public function hasEndTime()
    {
        return isset($this->end_time);
    }

    public function clearEndTime()
    {
        unset($this->end_time);
    }

    /**
     * Output only. Time when the Trial's status changed to `SUCCEEDED` or
     * `INFEASIBLE`.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setEndTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->end_time = $var;

        return $this;
    }

    /**
     * Output only. The identifier of the client that originally requested this
     * Trial. Each client is identified by a unique client_id. When a client asks
     * for a suggestion, Vertex AI Vizier will assign it a Trial. The client
     * should evaluate the Trial, complete it, and report back to Vertex AI
     * Vizier. If suggestion is asked again by same client_id before the Trial is
     * completed, the same Trial will be returned. Multiple clients with
     * different client_ids can ask for suggestions simultaneously, each of them
     * will get their own Trial.
     *
     * Generated from protobuf field <code>string client_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getClientId()
    {
        return $this->client_id;
    }

    /**
     * Output only. The identifier of the client that originally requested this
     * Trial. Each client is identified by a unique client_id. When a client asks
     * for a suggestion, Vertex AI Vizier will assign it a Trial. The client
     * should evaluate the Trial, complete it, and report back to Vertex AI
     * Vizier. If suggestion is asked again by same client_id before the Trial is
     * completed, the same Trial will be returned. Multiple clients with
     * different client_ids can ask for suggestions simultaneously, each of them
     * will get their own Trial.
     *
     * Generated from protobuf field <code>string client_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setClientId($var)
    {
        GPBUtil::checkString($var, True);
        $this->client_id = $var;

        return $this;
    }

    /**
     * Output only. A human readable string describing why the Trial is
     * infeasible. This is set only if Trial state is `INFEASIBLE`.
     *
     * Generated from protobuf field <code>string infeasible_reason = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getInfeasibleReason()
    {
        return $this->infeasible_reason;
    }

    /**
     * Output only. A human readable string describing why the Trial is
     * infeasible. This is set only if Trial state is `INFEASIBLE`.
     *
     * Generated from protobuf field <code>string infeasible_reason = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setInfeasibleReason($var)
    {
        GPBUtil::checkString($var, True);
        $this->infeasible_reason = $var;

        return $this;
    }

    /**
     * Output only. The CustomJob name linked to the Trial.
     * It's set for a HyperparameterTuningJob's Trial.
     *
     * Generated from protobuf field <code>string custom_job = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getCustomJob()
    {
        return $this->custom_job;
    }

    /**
     * Output only. The CustomJob name linked to the Trial.
     * It's set for a HyperparameterTuningJob's Trial.
     *
     * Generated from protobuf field <code>string custom_job = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setCustomJob($var)
    {
        GPBUtil::checkString($var, True);
        $this->custom_job = $var;

        return $this;
    }

    /**
     * Output only. URIs for accessing [interactive
     * shells](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell)
     * (one URI for each training node). Only available if this trial is part of
     * a
     * [HyperparameterTuningJob][google.cloud.aiplatform.v1.HyperparameterTuningJob]
     * and the job's
     * [trial_job_spec.enable_web_access][google.cloud.aiplatform.v1.CustomJobSpec.enable_web_access]
     * field is `true`.
     * The keys are names of each node used for the trial; for example,
     * `workerpool0-0` for the primary node, `workerpool1-0` for the first node in
     * the second worker pool, and `workerpool1-1` for the second node in the
     * second worker pool.
     * The values are the URIs for each node's interactive shell.
     *
     * Generated from protobuf field <code>map<string, string> web_access_uris = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getWebAccessUris()
    {
        return $this->web_access_uris;
    }

    /**
     * Output only. URIs for accessing [interactive
     * shells](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell)
     * (one URI for each training node). Only available if this trial is part of
     * a
     * [HyperparameterTuningJob][google.cloud.aiplatform.v1.HyperparameterTuningJob]
     * and the job's
     * [trial_job_spec.enable_web_access][google.cloud.aiplatform.v1.CustomJobSpec.enable_web_access]
     * field is `true`.
     * The keys are names of each node used for the trial; for example,
     * `workerpool0-0` for the primary node, `workerpool1-0` for the first node in
     * the second worker pool, and `workerpool1-1` for the second node in the
     * second worker pool.
     * The values are the URIs for each node's interactive shell.
     *
     * Generated from protobuf field <code>map<string, string> web_access_uris = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setWebAccessUris($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->web_access_uris = $arr;

        return $this;
    }

}

