protected function getObjective()
    {
        $sum = 0.0;
        $distance = new Euclidean();
        for ($i = 0; $i < $this->clustersNumber; ++$i) {
            $clust = $this->clusters[$i]->getCoordinates();
            for ($k = 0; $k < $this->sampleCount; ++$k) {
                $point = $this->samples[$k];
                $sum += $distance->distance($clust, $point);
            }
        }

        return $sum;
    }