Specify a weighting factor for the driver. normally 1 - 10

{@inheritDoc}
@param  int $factor weight factor for round-robin
335983
public function addDriver(DriverInterface $driver, /*# int */ $factor = 1)
    {
        // get unique driver id
        $id = $this->getDriverId($driver);

        // fix factor range: 1 - 10
        $this->factors[$id] = $this->fixFactor($factor);

        // add to the pool
        $this->drivers[$id] = $driver;

        return $this;
    }
1171902
public void max(DiscreteFactor factor) {
    Preconditions.checkArgument(factor.getVars().equals(getVars()));
    weightBuilder.maximum(factor.getWeights());
  }
1320497
public function changeToFactor($factor)
    {
        if (!$factor) {
            $this->perTaxRate = [];

            return $this;
        }

        // Note: do not round here!
        foreach (array_keys($this->perTaxRate) as $percent) {
            foreach (['gross', 'net'] as $property) {
                $this->perTaxRate[$percent][$property] *= $factor;
            }
        }

        return $this;
    }
421591
private function factorizeSizes($size, $limit)
    {
        $coef = self::MIB_BYTES;
        $coefFactor = self::KIB_BYTES;

        $limitAsString = (string) ($limit / $coef);

        // Restrict the limit to 2 decimals (without rounding! we
        // need the precise value)
        while (self::moreDecimalsThan($limitAsString, 2)) {
            $coef /= $coefFactor;
            $limitAsString = (string) ($limit / $coef);
        }

        // Convert size to the same measure, but round to 2 decimals
        $sizeAsString = (string) round($size / $coef, 2);

        // If the size and limit produce the same string output
        // (due to rounding), reduce the coefficient
        while ($sizeAsString === $limitAsString) {
            $coef /= $coefFactor;
            $limitAsString = (string) ($limit / $coef);
            $sizeAsString = (string) round($size / $coef, 2);
        }

        return [$limitAsString, self::$suffixes[$coef]];
    }
668266
public void setMinorTickMarkLengthFactor(final double FACTOR) {
        if (null == minorTickMarkLengthFactor) {
            _minorTickMarkLengthFactor = Helper.clamp(0.0, 1.0, FACTOR);
            fireUpdateEvent(REDRAW_EVENT);
        } else {
            minorTickMarkLengthFactor.set(FACTOR);
        }
    }
1036287
public function scale(Point $center, $factor)
	{
		return $this->scaleX($center, $factor)->scaleY($center, $factor);
	}
832146
private function _getNodesByFactor($nodes, $factor)
    {
        $ret = array();
        foreach ($nodes as $node) {
            $items = $factor->filter($node);
            $ret = Dom::mergeNodes($ret, $items);
        }
        return $ret;
    }
527893
public Quaternionf scaling(float factor) {
        float sqrt = (float) Math.sqrt(factor);
        this.x = 0.0f;
        this.y = 0.0f;
        this.z = 0.0f;
        this.w = sqrt;
        return this;
    }
114982
public function setReplicationFactor($value)
    {
        assert(null === $value || is_numeric($value) || $value === 'satellite');
        $this->_replicationFactor = $value;
    }
1186892
protected function marshall(QtiComponent $component)
    {
        $element = parent::marshall($component);
        $this->setDOMElementAttribute($element, 'outcomeIdentifier', $component->getOutcomeIdentifier());

        $weightIdentifier = $component->getWeightIdentifier();
        if (!empty($weightIdentifier)) {
            $this->setDOMElementAttribute($element, 'weightIdentifier', $weightIdentifier);
        }

        return $element;
    }
533335
public void addUnreplicatedFactor(String factorName, ParametricFactor factor) {
    super.addUnreplicatedFactor(factorName, factor, factor.getVars());
  }
1059227
protected function factor()
    {
        $combinator = null;

        if ($combinator = $this->is("combinator")) {
            if (!$element = $this->is("element")) {
                throw new TextParserException("Invalid expression", $this);
            }
        } elseif ($element = $this->is("element")) {
            // 'descendant' is the default combinator
            $combinator = CssParserCombinatorFactory::getInstance(
                "CssParserCombinatorDescendant"
            );
        } else {
            return false;
        }

        return new CssParserModelFactor($combinator, $element);
    }
1374355
public void rescore(double factor) {
    for (int i = 0; i < this.prior.size(); i++)
      this.prior.set(i, this.prior.get(i) * factor);
  }
563643
public function factors(): array
    {
        // 0 has infinite factors
        if ($this->number === 0 || !is_int($this->number)) {
            throw new InvalidNumberException();
        }

        $x = abs($this->number);
        $sqrx = floor(sqrt($x));

        $factors = [];
        for ($i = 1; $i <= $sqrx; $i++) {
            if ($x % $i === 0) {
                $factors[] = $i;
                if ($i !== $sqrx) {
                    $factors[] = $x / $i;
                }
            }
        }
        sort($factors);
        return $factors;
    }
52328
public function setWeight($weight)
    {
        if ($weight < 0.1) {
            throw new InvalidArgumentException("Expected weight greater than 100g.");
        }

        $this->set(Config::T530, (string)round($weight, 2));

        return $this;
    }
361933
private function factorizeSizes($size, $limit, $binaryFormat)
    {
        if ($binaryFormat) {
            $coef = self::MIB_BYTES;
            $coefFactor = self::KIB_BYTES;
        } else {
            $coef = self::MB_BYTES;
            $coefFactor = self::KB_BYTES;
        }

        $limitAsString = (string) ($limit / $coef);

        // Restrict the limit to 2 decimals (without rounding! we
        // need the precise value)
        while (self::moreDecimalsThan($limitAsString, 2)) {
            $coef /= $coefFactor;
            $limitAsString = (string) ($limit / $coef);
        }

        // Convert size to the same measure, but round to 2 decimals
        $sizeAsString = (string) round($size / $coef, 2);

        // If the size and limit produce the same string output
        // (due to rounding), reduce the coefficient
        while ($sizeAsString === $limitAsString) {
            $coef /= $coefFactor;
            $limitAsString = (string) ($limit / $coef);
            $sizeAsString = (string) round($size / $coef, 2);
        }

        return [$sizeAsString, $limitAsString, self::$suffices[$coef]];
    }
921066
def setSpeedFactor(self, vehID, factor):
        
        self._connection._sendDoubleCmd(
            tc.CMD_SET_VEHICLE_VARIABLE, tc.VAR_SPEED_FACTOR, vehID, factor)