@inheritDoc

Note that when fitness is set and there is a {@link #bestConfiguration} set, it recalculates {@link #bestFitness} as well.
964210
public void setFitness(Fitness fitness) {
        this.fitness = fitness;

        if (this.bestConfiguration != null) this.bestFitness = fitness.getValue(this.bestConfiguration);
    }
436582
public function recalculateRatings()
    {
        // Compute rating value.
        // @todo Need to know weather comments has changed or not.
        // Unfortunately, persistent collection gets no dirty flag,
        // if existing entries are changed....
        // We limit recalculates to the cases where comments gets loaded from
        // the database (which still does not neccessarly mean, there are changes...

        $comments = $this->getComments();
        if ($comments instanceof ArrayCollection // new Comments
            || $comments->isInitialized() // Comments were loaded and eventually changed (we do not know)
            || $comments->isDirty() // new Comments added w/o initializing
        ) {
            $this->getRating(/*recalculate*/ true);
        }
    }
1021454
protected function recalculateTotal(): void
    {
        $this->total = $this->unitsTotal + $this->adjustmentsTotal;

        if ($this->total < 0) {
            $this->total = 0;
        }

        if (null !== $this->order) {
            $this->order->recalculateItemsTotal();
        }
    }
979789
public function setStateToVote () : bool
    {
        if ( $this->_State === 1 ) :
                if (empty($this->_Candidates)) :
                    throw new CondorcetException(20);
                endif;

                $this->_State = 2;

        // If voting continues after a first set of results
        elseif ( $this->_State > 2 ) :
                $this->cleanupResult();
        endif;

        return true;
    }
1335459
public function setMax($max)
  {
    if (!is_numeric($max))
    {
      $max = null;
    }
    $this->max = $max;

    return $this;
  }
1276099
public function isSetter() {
    	$methodName = $this->getName();
    	
    	   
    	if (strpos($methodName, "set") === 0 && strlen($methodName)>3) {
    		// A setter must have exactly one compulsory parameter
    		$parameters = $this->getParameters();
    		if (count($parameters) == 0) {
    			return false;
    		}
    		if (count($parameters)>1) {
    			for ($i=1, $count=count($parameters); $i<$count; $i++) {
    				$param = $parameters[$i];
    				if (!$param->isDefaultValueAvailable()) {
    					return false;
    				}
    			}
    		}
    		
    		return true;
    	}
    	return false;
    }
831237
public function setMax($v)
    {
        if ($v !== null) {
            $v = (double) $v;
        }

        if ($this->max !== $v) {
            $this->max = $v;
            $this->modifiedColumns[AttributeTypeTableMap::MAX] = true;
        }


        return $this;
    }
855396
public void setMax(int max)
    {
        this.max = max;
        if (this.max < Alterable.MIN)
        {
            this.max = Alterable.MIN;
        }
        set(cur);
    }
183826
@Override
    public final void setReliability(Reliability value) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setReliability", value);
        if (value != null) {
            /* Call the superclass's method to get the int value of the Reliability instance and set it into the field */
            super.setReliability(value);
        }
        else {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "setReliability", "NullPointerException");
            throw new NullPointerException();
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setReliability");
    }
671093
private void checkRecursiveConfigs(Set<Class> resolvedConfigs, Class<?> configClass) {
        if (resolvedConfigs.contains(configClass)) {
            throw new PropertyLoaderException(String.format("Recursive configuration <%s>", configClass));
        }
    }
1234964
@SuppressWarnings("checkstyle:npathcomplexity")
	public void setFrom(SARLConfiguration config) {
		if (this.input == null) {
			this.input = config.getInput();
		}
		if (this.output == null) {
			this.output = config.getOutput();
		}
		if (this.binOutput == null) {
			this.binOutput = config.getBinOutput();
		}
		if (this.testInput == null) {
			this.testInput = config.getTestInput();
		}
		if (this.testOutput == null) {
			this.testOutput = config.getTestOutput();
		}
		if (this.testBinOutput == null) {
			this.testBinOutput = config.getTestBinOutput();
		}
		if (this.inputCompliance == null) {
			this.inputCompliance = config.getInputCompliance();
		}
		if (this.outputCompliance == null) {
			this.outputCompliance = config.getOutputCompliance();
		}
		if (this.encoding == null) {
			this.encoding = config.getEncoding();
		}
	}
334164
public function setMax($max)
    {
        if (is_array($max) and isset($max['max'])) {
            $max = $max['max'];
        }

        if (!is_string($max) and !is_numeric($max)) {
            // require_once 'Zend/Validate/Exception.php';
            throw new Zend_Validate_Exception ('Invalid options to validator provided');
        }

        $max = (integer) $max;
        if (($this->_min !== null) && ($max < $this->_min)) {
            // require_once 'Zend/Validate/Exception.php';
            throw new Zend_Validate_Exception("The maximum must be greater than or equal to the minimum file count, but "
                                            . "$max < {$this->_min}");
        }

        $this->_max = $max;
        return $this;
    }
1222841
public function recalculateStats()
	{
		if (empty($this->stats)) {
			$this->stats = new Stats();
		}

		$this->stats->reset();

		if (empty($this->segments)) {
			return;
		}

		$segmentsCount = count($this->segments);

		$firstSegment = null;
		$firstPoint = null;

		// Identify first Segment/Point
		for ($s = 0; $s < $segmentsCount; $s++) {
			$pointCount = count($this->segments[$s]->points);
			for ($p = 0; $p < $pointCount; $p++) {
				if (is_null($firstPoint)) {
					$firstPoint = &$this->segments[$s]->points[$p];
					$firstSegment = &$this->segments[$s];
					break;
				}
			}
		}

		if (empty($firstPoint)) {
			return;
		}

		$lastSegment = end($this->segments);
		$lastPoint = end(end($this->segments)->points);

		$this->stats->startedAt = $firstPoint->time;
		$this->stats->finishedAt = $lastPoint->time;
		$this->stats->minAltitude = $firstPoint->elevation;

		for ($s = 0; $s < $segmentsCount; $s++) {
			$this->segments[$s]->recalculateStats();

			$this->stats->cumulativeElevationGain += $this->segments[$s]->stats->cumulativeElevationGain;
			$this->stats->cumulativeElevationLoss += $this->segments[$s]->stats->cumulativeElevationLoss;

			$this->stats->distance += $this->segments[$s]->stats->distance;

			if ($this->stats->minAltitude === null) {
				$this->stats->minAltitude = $this->segments[$s]->stats->minAltitude;
			}
			if ($this->stats->maxAltitude < $this->segments[$s]->stats->maxAltitude) {
				$this->stats->maxAltitude = $this->segments[$s]->stats->maxAltitude;
			}
			if ($this->stats->minAltitude > $this->segments[$s]->stats->minAltitude) {
				$this->stats->minAltitude = $this->segments[$s]->stats->minAltitude;
			}
		}

		if (($firstPoint->time instanceof \DateTime) && ($lastPoint->time instanceof \DateTime)) {
			$this->stats->duration = $lastPoint->time->getTimestamp() - $firstPoint->time->getTimestamp();

			if ($this->stats->duration != 0) {
				$this->stats->averageSpeed = $this->stats->distance / $this->stats->duration;
			}

			if ($this->stats->distance != 0) {
				$this->stats->averagePace = $this->stats->duration / ($this->stats->distance / 1000);
			}
		}
	}
953347
@Override
	public void setMaxZ(double z) {
		double o = this.minzProperty.doubleValue() ;
		if (o>z) {
			this.maxzProperty.set(o);
			this.minzProperty.set(z);
		}
		else {
			this.maxzProperty.set(z);
		}
	}
983656
public final void setRect(double xMin, double xMax, double yMin, double yMax)
    {
        this.xMin = xMin;
        this.xMax = xMax;
        this.yMin = yMin;
        this.yMax = yMax;
    }
161645
public function recalculateStats()
	{
		if (empty($this->stats)) {
			$this->stats = new Stats();
		}

		$this->stats->reset();

		if (empty($this->points)) {
			return;
		}

		$pointCount = count($this->points);

		$firstPoint = &$this->points[0];
		$lastPoint = end($this->points);

		$this->stats->startedAt = $firstPoint->time;
		$this->stats->finishedAt = $lastPoint->time;
		$this->stats->minAltitude = $firstPoint->elevation;

		list($this->stats->cumulativeElevationGain, $this->stats->cumulativeElevationLoss) =
			ElevationGainLossCalculator::calculate($this->getPoints());

		$this->stats->distance = DistanceCalculator::calculate($this->getPoints());

		for ($p = 0; $p < $pointCount; $p++) {
			if ((phpGPX::$IGNORE_ELEVATION_0 === false || $this->points[$p]->elevation > 0) && $this->stats->minAltitude > $this->points[$p]->elevation) {
				$this->stats->minAltitude = $this->points[$p]->elevation;
			}

			if ($this->stats->maxAltitude < $this->points[$p]->elevation) {
				$this->stats->maxAltitude = $this->points[$p]->elevation;
			}

			if ($this->stats->minAltitude > $this->points[$p]->elevation) {
				$this->stats->minAltitude = $this->points[$p]->elevation;
			}
		}

		if (($firstPoint->time instanceof \DateTime) && ($lastPoint->time instanceof \DateTime)) {
			$this->stats->duration = $lastPoint->time->getTimestamp() - $firstPoint->time->getTimestamp();

			if ($this->stats->duration != 0) {
				$this->stats->averageSpeed = $this->stats->distance / $this->stats->duration;
			}

			if ($this->stats->distance != 0) {
				$this->stats->averagePace = $this->stats->duration / ($this->stats->distance / 1000);
			}
		}
	}
166374
@Override
  public int compare(S solution1, S solution2) {
    if (solution1 == null) {
      return 1;
    } else if (solution2 == null) {
      return -1;
    }

    double fitness1 = solutionFitness.getAttribute(solution1);
    double fitness2 = solutionFitness.getAttribute(solution2);
    if (fitness1 < fitness2) {
      return -1;
    }

    if (fitness1 > fitness2) {
      return 1;
    }

    return 0;
  }