<?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 UnexpectedValueException;

/**
 * The available types of multi-trial algorithms.
 *
 * Protobuf type <code>google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.MultiTrialAlgorithm</code>
 */
class MultiTrialAlgorithm
{
    /**
     * Defaults to `REINFORCEMENT_LEARNING`.
     *
     * Generated from protobuf enum <code>MULTI_TRIAL_ALGORITHM_UNSPECIFIED = 0;</code>
     */
    const MULTI_TRIAL_ALGORITHM_UNSPECIFIED = 0;
    /**
     * The Reinforcement Learning Algorithm for Multi-trial Neural
     * Architecture Search (NAS).
     *
     * Generated from protobuf enum <code>REINFORCEMENT_LEARNING = 1;</code>
     */
    const REINFORCEMENT_LEARNING = 1;
    /**
     * The Grid Search Algorithm for Multi-trial Neural
     * Architecture Search (NAS).
     *
     * Generated from protobuf enum <code>GRID_SEARCH = 2;</code>
     */
    const GRID_SEARCH = 2;

    private static $valueToName = [
        self::MULTI_TRIAL_ALGORITHM_UNSPECIFIED => 'MULTI_TRIAL_ALGORITHM_UNSPECIFIED',
        self::REINFORCEMENT_LEARNING => 'REINFORCEMENT_LEARNING',
        self::GRID_SEARCH => 'GRID_SEARCH',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}


