Set the maximum number of times the iteration will run. Useful when
your improvement algorithm is subject to failure cases (like the
Newton-Raphson Method).

By default, there is no limit.

@param int|null $maxIterations
@return void
500419
public function setMaximumIterations($maxIterations)
    {
        if (null === $maxIterations) {
            $this->maxIterations = null;
        } else if (is_numeric($maxIterations) && 0 < intval($maxIterations)) {
            $this->maxIterations = intval($maxIterations);
        } else {
            throw new \InvalidArgumentException(
                '$maxIterations must be null or integer number of iterations greater than 0'
            );
        }
    }
1160793
public function setLimits($offset, $limit, $max = 0, $cutoff = 0)
    {
        assert(is_int($offset));
        assert(is_int($limit));
        assert(is_int($max));
        assert(is_int($cutoff));
        assert($offset >= 0);
        assert($limit > 0);
        assert($max >= 0);
        assert($cutoff >= 0);

        $this->_offset = $offset;
        $this->_limit = $limit;
        if ($max > 0) {
            $this->_maxmatches = $max;
        }
        if ($cutoff > 0) {
            $this->_cutoff = $cutoff;
        }

        return $this;
    }
389238
public function setNestingLimit($limit)
	{
		$limit = (int) $limit;

		if ($limit < 1)
		{
			throw new InvalidArgumentException('nestingLimit must be a number greater than 0');
		}

		$this->nestingLimit = $limit;
	}
1141713
public final void setMaxValue(final int maxValue) {
        Condition.INSTANCE.ensureGreater(maxValue, getMinValue(),
                "The maximum value must be greater than the minimum value");
        this.maxValue = maxValue;
        setValue(Math.min(getValue(), maxValue));
    }
1086525
public function setLimits(array $limits)
    {
        $this->limits = array();
        foreach ($limits as $limit) {
            $this->setLimit($limit);
        }
    }
710554
public void setMax (BigDecimal max) {
		if (min.compareTo(max) > 0) throw new IllegalArgumentException("min can't be > max");

		this.max = max;

		if (current.compareTo(max) > 0) {
			current = max.setScale(scale, BigDecimal.ROUND_HALF_UP);
			spinner.notifyValueChanged(spinner.isProgrammaticChangeEvents());
		}
	}
758621
public void setMaximumInstances(int maximumInstances) {
        int newValue = maximumInstances < 0 ? 0 : maximumInstances;

        if (this.maximumInstances != newValue) {
            this.maximumInstances = newValue;

            getConfig().setProperty(PARAM_MAXIMUM_INSTANCES, this.maximumInstances);
        }
    }
219439
function SetMaxQueryTime ( $max )
    {
        assert ( is_int($max) );
        assert ( $max>=0 );
        $this->_maxquerytime = $max;
    }
1164908
public static function numberLimit($val, $min, $max)
    {
        return ($val > $min ? ($val < $max ? $val : $max) : $min);
    }
478526
public function setMaxResults($limit)
    {
        $limit = (int)$limit;

        if(0 === $limit) {
            $this->getStatement()->removeClause('limit');
        } else {
            // 
            $this->getStatement()->setClause('limit', new Expr\LimitClause($limit));
        }

        return $this;
    }
747961
public function setMaximumRetryDelay($max)
    {
        if (!(is_int($max) || is_float($max)) || $max < 0) {
            throw new \Plop\Exception('Invalid value');
        }
        $this->retryMax = $max;
        return $this;
    }
599230
public function setMaxExecutionTime(int $maxExecutionTime = NULL) : self
	{
		if ($maxExecutionTime !== NULL && $maxExecutionTime <= 0) {
			throw new InvalidArgumentException("Max execution time must be NULL or non negative number.");
		}
		$this->maxExecutionTime = $maxExecutionTime;

		return $this;
	}
386039
public function setMaxNbColumns($maxNbColumns)
    {
        $this->minNbColumns = min($this->minNbColumns, $maxNbColumns);
        $this->maxNbColumns = $maxNbColumns;

        return $this;
    }
905483
public function setMax($value)
    {
        $this->max = $value === null ? null : (int) $value;

        return $this;
    }
448969
public function setMaxFileCount(int $maxFileCount)
    {
        if ($maxFileCount > 0) {
            $properties = $this->getProperties();
            $properties['maxFileCount'] = $maxFileCount;
            $this->setProperties($properties);
            return $this;
        }
        return false;
    }
1063475
public void setDamages(int min, int max)
    {
        this.min = UtilMath.clamp(min, 0, Integer.MAX_VALUE);
        this.max = UtilMath.clamp(max, this.min, Integer.MAX_VALUE);
    }
791612
public function update($properties, $context = null, $maxbytes = null) {
        if ($properties->enableotheranswers) {
            $properties->response_editor = array_values($properties->response_editor);
            $properties->jumpto = array_values($properties->jumpto);
            $properties->score = array_values($properties->score);
            $wrongresponse = end($properties->response_editor);
            $wrongkey = key($properties->response_editor);
            $properties->answer_editor[$wrongkey] = LESSON_OTHER_ANSWERS;
        }
        parent::update($properties, $context, $maxbytes);
    }