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

namespace Google\Cloud\AIPlatform\V1\NasJobSpec\MultiTrialAlgorithmSpec;

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

/**
 * Represent spec for search trials.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.SearchTrialSpec</code>
 */
class SearchTrialSpec extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The spec of a search trial job. The same spec applies to
     * all search trials.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.CustomJobSpec search_trial_job_spec = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $search_trial_job_spec = null;
    /**
     * Required. The maximum number of Neural Architecture Search (NAS) trials
     * to run.
     *
     * Generated from protobuf field <code>int32 max_trial_count = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $max_trial_count = 0;
    /**
     * Required. The maximum number of trials to run in parallel.
     *
     * Generated from protobuf field <code>int32 max_parallel_trial_count = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $max_parallel_trial_count = 0;
    /**
     * The number of failed trials that need to be seen before failing
     * the NasJob.
     * If set to 0, Vertex AI decides how many trials must fail
     * before the whole job fails.
     *
     * Generated from protobuf field <code>int32 max_failed_trial_count = 4;</code>
     */
    private $max_failed_trial_count = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\AIPlatform\V1\CustomJobSpec $search_trial_job_spec
     *           Required. The spec of a search trial job. The same spec applies to
     *           all search trials.
     *     @type int $max_trial_count
     *           Required. The maximum number of Neural Architecture Search (NAS) trials
     *           to run.
     *     @type int $max_parallel_trial_count
     *           Required. The maximum number of trials to run in parallel.
     *     @type int $max_failed_trial_count
     *           The number of failed trials that need to be seen before failing
     *           the NasJob.
     *           If set to 0, Vertex AI decides how many trials must fail
     *           before the whole job fails.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\NasJob::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The spec of a search trial job. The same spec applies to
     * all search trials.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.CustomJobSpec search_trial_job_spec = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\AIPlatform\V1\CustomJobSpec|null
     */
    public function getSearchTrialJobSpec()
    {
        return $this->search_trial_job_spec;
    }

    public function hasSearchTrialJobSpec()
    {
        return isset($this->search_trial_job_spec);
    }

    public function clearSearchTrialJobSpec()
    {
        unset($this->search_trial_job_spec);
    }

    /**
     * Required. The spec of a search trial job. The same spec applies to
     * all search trials.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.CustomJobSpec search_trial_job_spec = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\AIPlatform\V1\CustomJobSpec $var
     * @return $this
     */
    public function setSearchTrialJobSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\CustomJobSpec::class);
        $this->search_trial_job_spec = $var;

        return $this;
    }

    /**
     * Required. The maximum number of Neural Architecture Search (NAS) trials
     * to run.
     *
     * Generated from protobuf field <code>int32 max_trial_count = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getMaxTrialCount()
    {
        return $this->max_trial_count;
    }

    /**
     * Required. The maximum number of Neural Architecture Search (NAS) trials
     * to run.
     *
     * Generated from protobuf field <code>int32 max_trial_count = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setMaxTrialCount($var)
    {
        GPBUtil::checkInt32($var);
        $this->max_trial_count = $var;

        return $this;
    }

    /**
     * Required. The maximum number of trials to run in parallel.
     *
     * Generated from protobuf field <code>int32 max_parallel_trial_count = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getMaxParallelTrialCount()
    {
        return $this->max_parallel_trial_count;
    }

    /**
     * Required. The maximum number of trials to run in parallel.
     *
     * Generated from protobuf field <code>int32 max_parallel_trial_count = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setMaxParallelTrialCount($var)
    {
        GPBUtil::checkInt32($var);
        $this->max_parallel_trial_count = $var;

        return $this;
    }

    /**
     * The number of failed trials that need to be seen before failing
     * the NasJob.
     * If set to 0, Vertex AI decides how many trials must fail
     * before the whole job fails.
     *
     * Generated from protobuf field <code>int32 max_failed_trial_count = 4;</code>
     * @return int
     */
    public function getMaxFailedTrialCount()
    {
        return $this->max_failed_trial_count;
    }

    /**
     * The number of failed trials that need to be seen before failing
     * the NasJob.
     * If set to 0, Vertex AI decides how many trials must fail
     * before the whole job fails.
     *
     * Generated from protobuf field <code>int32 max_failed_trial_count = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setMaxFailedTrialCount($var)
    {
        GPBUtil::checkInt32($var);
        $this->max_failed_trial_count = $var;

        return $this;
    }

}


