-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Milestone
Description
Since resuming the algorithm is possible (see #28), why not give the user the ability to pause it as well?
Here's an implementation target:
$algo = new Kmeans\Algorithm(new Kmeans\RandomInitialization());
$aglo->registerIterationCallback(function ($algo) {
if ($algo->getStatus()->startedAt() > new \DateTime('1 hour ago')) {
return $algo->pause();
}
});
$result = $algo->clusterize($points, $nbClusters);
if ($result->getStatus()->isPaused()) {
echo "Clusterization ran for more than 1h and had to be paused.";
}What do you think?
Metadata
Metadata
Assignees
Labels
No labels