// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.machinelearning.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.Duration;

/** Job execution constraints. */
@Fluent
public final class TableVerticalLimitSettings {
    /*
     * Enable early termination, determines whether or not if AutoMLJob will terminate early if there is no score
     * improvement in last 20 iterations.
     */
    @JsonProperty(value = "enableEarlyTermination")
    private Boolean enableEarlyTermination;

    /*
     * Exit score for the AutoML job.
     */
    @JsonProperty(value = "exitScore")
    private Double exitScore;

    /*
     * Maximum Concurrent iterations.
     */
    @JsonProperty(value = "maxConcurrentTrials")
    private Integer maxConcurrentTrials;

    /*
     * Max cores per iteration.
     */
    @JsonProperty(value = "maxCoresPerTrial")
    private Integer maxCoresPerTrial;

    /*
     * Number of iterations.
     */
    @JsonProperty(value = "maxTrials")
    private Integer maxTrials;

    /*
     * AutoML job timeout.
     */
    @JsonProperty(value = "timeout")
    private Duration timeout;

    /*
     * Iteration timeout.
     */
    @JsonProperty(value = "trialTimeout")
    private Duration trialTimeout;

    /** Creates an instance of TableVerticalLimitSettings class. */
    public TableVerticalLimitSettings() {
    }

    /**
     * Get the enableEarlyTermination property: Enable early termination, determines whether or not if AutoMLJob will
     * terminate early if there is no score improvement in last 20 iterations.
     *
     * @return the enableEarlyTermination value.
     */
    public Boolean enableEarlyTermination() {
        return this.enableEarlyTermination;
    }

    /**
     * Set the enableEarlyTermination property: Enable early termination, determines whether or not if AutoMLJob will
     * terminate early if there is no score improvement in last 20 iterations.
     *
     * @param enableEarlyTermination the enableEarlyTermination value to set.
     * @return the TableVerticalLimitSettings object itself.
     */
    public TableVerticalLimitSettings withEnableEarlyTermination(Boolean enableEarlyTermination) {
        this.enableEarlyTermination = enableEarlyTermination;
        return this;
    }

    /**
     * Get the exitScore property: Exit score for the AutoML job.
     *
     * @return the exitScore value.
     */
    public Double exitScore() {
        return this.exitScore;
    }

    /**
     * Set the exitScore property: Exit score for the AutoML job.
     *
     * @param exitScore the exitScore value to set.
     * @return the TableVerticalLimitSettings object itself.
     */
    public TableVerticalLimitSettings withExitScore(Double exitScore) {
        this.exitScore = exitScore;
        return this;
    }

    /**
     * Get the maxConcurrentTrials property: Maximum Concurrent iterations.
     *
     * @return the maxConcurrentTrials value.
     */
    public Integer maxConcurrentTrials() {
        return this.maxConcurrentTrials;
    }

    /**
     * Set the maxConcurrentTrials property: Maximum Concurrent iterations.
     *
     * @param maxConcurrentTrials the maxConcurrentTrials value to set.
     * @return the TableVerticalLimitSettings object itself.
     */
    public TableVerticalLimitSettings withMaxConcurrentTrials(Integer maxConcurrentTrials) {
        this.maxConcurrentTrials = maxConcurrentTrials;
        return this;
    }

    /**
     * Get the maxCoresPerTrial property: Max cores per iteration.
     *
     * @return the maxCoresPerTrial value.
     */
    public Integer maxCoresPerTrial() {
        return this.maxCoresPerTrial;
    }

    /**
     * Set the maxCoresPerTrial property: Max cores per iteration.
     *
     * @param maxCoresPerTrial the maxCoresPerTrial value to set.
     * @return the TableVerticalLimitSettings object itself.
     */
    public TableVerticalLimitSettings withMaxCoresPerTrial(Integer maxCoresPerTrial) {
        this.maxCoresPerTrial = maxCoresPerTrial;
        return this;
    }

    /**
     * Get the maxTrials property: Number of iterations.
     *
     * @return the maxTrials value.
     */
    public Integer maxTrials() {
        return this.maxTrials;
    }

    /**
     * Set the maxTrials property: Number of iterations.
     *
     * @param maxTrials the maxTrials value to set.
     * @return the TableVerticalLimitSettings object itself.
     */
    public TableVerticalLimitSettings withMaxTrials(Integer maxTrials) {
        this.maxTrials = maxTrials;
        return this;
    }

    /**
     * Get the timeout property: AutoML job timeout.
     *
     * @return the timeout value.
     */
    public Duration timeout() {
        return this.timeout;
    }

    /**
     * Set the timeout property: AutoML job timeout.
     *
     * @param timeout the timeout value to set.
     * @return the TableVerticalLimitSettings object itself.
     */
    public TableVerticalLimitSettings withTimeout(Duration timeout) {
        this.timeout = timeout;
        return this;
    }

    /**
     * Get the trialTimeout property: Iteration timeout.
     *
     * @return the trialTimeout value.
     */
    public Duration trialTimeout() {
        return this.trialTimeout;
    }

    /**
     * Set the trialTimeout property: Iteration timeout.
     *
     * @param trialTimeout the trialTimeout value to set.
     * @return the TableVerticalLimitSettings object itself.
     */
    public TableVerticalLimitSettings withTrialTimeout(Duration trialTimeout) {
        this.trialTimeout = trialTimeout;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
    }
}
