<?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 train trials.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.TrainTrialSpec</code>
 */
class TrainTrialSpec extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The spec of a train trial job. The same spec applies to
     * all train trials.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.CustomJobSpec train_trial_job_spec = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $train_trial_job_spec = null;
    /**
     * Required. The maximum number of trials to run in parallel.
     *
     * Generated from protobuf field <code>int32 max_parallel_trial_count = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $max_parallel_trial_count = 0;
    /**
     * Required. Frequency of search trials to start train stage. Top N
     * [TrainTrialSpec.max_parallel_trial_count]
     * search trials will be trained for every M
     * [TrainTrialSpec.frequency] trials searched.
     *
     * Generated from protobuf field <code>int32 frequency = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $frequency = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\AIPlatform\V1\CustomJobSpec $train_trial_job_spec
     *           Required. The spec of a train trial job. The same spec applies to
     *           all train trials.
     *     @type int $max_parallel_trial_count
     *           Required. The maximum number of trials to run in parallel.
     *     @type int $frequency
     *           Required. Frequency of search trials to start train stage. 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);
    }

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

    public function hasTrainTrialJobSpec()
    {
        return isset($this->train_trial_job_spec);
    }

    public function clearTrainTrialJobSpec()
    {
        unset($this->train_trial_job_spec);
    }

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

        return $this;
    }

    /**
     * Required. The maximum number of trials to run in parallel.
     *
     * Generated from protobuf field <code>int32 max_parallel_trial_count = 2 [(.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 = 2 [(.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;
    }

    /**
     * Required. Frequency of search trials to start train stage. Top N
     * [TrainTrialSpec.max_parallel_trial_count]
     * search trials will be trained for every M
     * [TrainTrialSpec.frequency] trials searched.
     *
     * Generated from protobuf field <code>int32 frequency = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getFrequency()
    {
        return $this->frequency;
    }

    /**
     * Required. Frequency of search trials to start train stage. Top N
     * [TrainTrialSpec.max_parallel_trial_count]
     * search trials will be trained for every M
     * [TrainTrialSpec.frequency] trials searched.
     *
     * Generated from protobuf field <code>int32 frequency = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setFrequency($var)
    {
        GPBUtil::checkInt32($var);
        $this->frequency = $var;

        return $this;
    }

}


