diff --git a/sweep.py b/algorithm.py similarity index 96% rename from sweep.py rename to algorithm.py index 3fa4ba8..cd44cad 100644 --- a/sweep.py +++ b/algorithm.py @@ -8,20 +8,18 @@ import copy import linesegment import point -class Sweep(): +class Algorithm(): "The Sweep class is the base class for each individual sweep algorithm" # pylint: disable=too-many-instance-attributes def __init__(self): - self._sss = None # The sweep status structure - self._es = None # The event structure self._input = None # The input values + self._result = None # The result of the sweep self._ready = False # If the sweep is reade to be executed self._running = False # If the sweep is currently running self._num_steps = {} # The number of steps that were needed to solve the problem - self._result = None # The result of the sweep def start(self): """Start the performing the algorithm. Return True if it was successful""" @@ -30,8 +28,10 @@ class Sweep(): return False self._running = True return True + def get_result(self): + return self._result -class SweepNearestNeighbors(Sweep): +class NearestNeighborsSweep(Algorithm): """Calculate the pair of points inside a set, that have the minimal distance between each other inside this set"""