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

namespace Google\Cloud\AIPlatform\V1\NasJobSpec;

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

/**
 * The spec of multi-trial Neural Architecture Search (NAS).
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec</code>
 */
class MultiTrialAlgorithmSpec extends \Google\Protobuf\Internal\Message
{
    /**
     * The multi-trial Neural Architecture Search (NAS) algorithm
     * type. Defaults to `REINFORCEMENT_LEARNING`.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.MultiTrialAlgorithm multi_trial_algorithm = 1;</code>
     */
    private $multi_trial_algorithm = 0;
    /**
     * Metric specs for the NAS job.
     * Validation for this field is done at `multi_trial_algorithm_spec` field.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.MetricSpec metric = 2;</code>
     */
    private $metric = null;
    /**
     * Required. Spec for search trials.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.SearchTrialSpec search_trial_spec = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $search_trial_spec = null;
    /**
     * Spec for train trials. Top N [TrainTrialSpec.max_parallel_trial_count]
     * search trials will be trained for every M
     * [TrainTrialSpec.frequency] trials searched.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.TrainTrialSpec train_trial_spec = 4;</code>
     */
    private $train_trial_spec = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $multi_trial_algorithm
     *           The multi-trial Neural Architecture Search (NAS) algorithm
     *           type. Defaults to `REINFORCEMENT_LEARNING`.
     *     @type \Google\Cloud\AIPlatform\V1\NasJobSpec\MultiTrialAlgorithmSpec\MetricSpec $metric
     *           Metric specs for the NAS job.
     *           Validation for this field is done at `multi_trial_algorithm_spec` field.
     *     @type \Google\Cloud\AIPlatform\V1\NasJobSpec\MultiTrialAlgorithmSpec\SearchTrialSpec $search_trial_spec
     *           Required. Spec for search trials.
     *     @type \Google\Cloud\AIPlatform\V1\NasJobSpec\MultiTrialAlgorithmSpec\TrainTrialSpec $train_trial_spec
     *           Spec for train trials. Top N [TrainTrialSpec.max_parallel_trial_count]
     *           search trials will be trained for every M
     *           [TrainTrialSpec.frequency] trials searched.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\NasJob::initOnce();
        parent::__construct($data);
    }

    /**
     * The multi-trial Neural Architecture Search (NAS) algorithm
     * type. Defaults to `REINFORCEMENT_LEARNING`.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.MultiTrialAlgorithm multi_trial_algorithm = 1;</code>
     * @return int
     */
    public function getMultiTrialAlgorithm()
    {
        return $this->multi_trial_algorithm;
    }

    /**
     * The multi-trial Neural Architecture Search (NAS) algorithm
     * type. Defaults to `REINFORCEMENT_LEARNING`.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.MultiTrialAlgorithm multi_trial_algorithm = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setMultiTrialAlgorithm($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\AIPlatform\V1\NasJobSpec\MultiTrialAlgorithmSpec\MultiTrialAlgorithm::class);
        $this->multi_trial_algorithm = $var;

        return $this;
    }

    /**
     * Metric specs for the NAS job.
     * Validation for this field is done at `multi_trial_algorithm_spec` field.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.MetricSpec metric = 2;</code>
     * @return \Google\Cloud\AIPlatform\V1\NasJobSpec\MultiTrialAlgorithmSpec\MetricSpec|null
     */
    public function getMetric()
    {
        return $this->metric;
    }

    public function hasMetric()
    {
        return isset($this->metric);
    }

    public function clearMetric()
    {
        unset($this->metric);
    }

    /**
     * Metric specs for the NAS job.
     * Validation for this field is done at `multi_trial_algorithm_spec` field.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.MetricSpec metric = 2;</code>
     * @param \Google\Cloud\AIPlatform\V1\NasJobSpec\MultiTrialAlgorithmSpec\MetricSpec $var
     * @return $this
     */
    public function setMetric($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\NasJobSpec\MultiTrialAlgorithmSpec\MetricSpec::class);
        $this->metric = $var;

        return $this;
    }

    /**
     * Required. Spec for search trials.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.SearchTrialSpec search_trial_spec = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\AIPlatform\V1\NasJobSpec\MultiTrialAlgorithmSpec\SearchTrialSpec|null
     */
    public function getSearchTrialSpec()
    {
        return $this->search_trial_spec;
    }

    public function hasSearchTrialSpec()
    {
        return isset($this->search_trial_spec);
    }

    public function clearSearchTrialSpec()
    {
        unset($this->search_trial_spec);
    }

    /**
     * Required. Spec for search trials.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.SearchTrialSpec search_trial_spec = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\AIPlatform\V1\NasJobSpec\MultiTrialAlgorithmSpec\SearchTrialSpec $var
     * @return $this
     */
    public function setSearchTrialSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\NasJobSpec\MultiTrialAlgorithmSpec\SearchTrialSpec::class);
        $this->search_trial_spec = $var;

        return $this;
    }

    /**
     * Spec for train trials. Top N [TrainTrialSpec.max_parallel_trial_count]
     * search trials will be trained for every M
     * [TrainTrialSpec.frequency] trials searched.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.TrainTrialSpec train_trial_spec = 4;</code>
     * @return \Google\Cloud\AIPlatform\V1\NasJobSpec\MultiTrialAlgorithmSpec\TrainTrialSpec|null
     */
    public function getTrainTrialSpec()
    {
        return $this->train_trial_spec;
    }

    public function hasTrainTrialSpec()
    {
        return isset($this->train_trial_spec);
    }

    public function clearTrainTrialSpec()
    {
        unset($this->train_trial_spec);
    }

    /**
     * Spec for train trials. Top N [TrainTrialSpec.max_parallel_trial_count]
     * search trials will be trained for every M
     * [TrainTrialSpec.frequency] trials searched.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.TrainTrialSpec train_trial_spec = 4;</code>
     * @param \Google\Cloud\AIPlatform\V1\NasJobSpec\MultiTrialAlgorithmSpec\TrainTrialSpec $var
     * @return $this
     */
    public function setTrainTrialSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\NasJobSpec\MultiTrialAlgorithmSpec\TrainTrialSpec::class);
        $this->train_trial_spec = $var;

        return $this;
    }

}


