public function setPotential($potential, VertexInterface $from)
    {
        $potential = (int) $potential;

        if (!$this->getPotential() || $potential < $this->getPotential()) {
            $this->potential = $potential;
            $this->potentialFrom = $from;

            return true;
        }

        return false;
    }
public function setPotential($potential, VertexInterface $from)
    {
        $potential = (int) $potential;

        if (!$this->getPotential() || $potential < $this->getPotential()) {
            $this->potential = $potential;
            $this->potentialFrom = $from;

            return true;
        }

        return false;
    }
public function setPotential ( $ potential , VertexInterface $ from ) { $ potential = ( int ) $ potential ; if ( ! $ this -> getPotential ( ) || $ potential < $ this -> getPotential ( ) ) { $ this -> potential = $ potential ; $ this -> potentialFrom = $ from ; return true ; } return false ; }
Sets the potential for the vertex, if the vertex has no potential or the
one it has is higher than the new one.

@param   integer $potential
@param   Vertex $from
@return  boolean
Sets the potential for the vertex if the vertex has no potential or the one it has is higher than the new one .