Class AbstractAlgorithm<Observer>

    • Constructor Detail

      • AbstractAlgorithm

        protected AbstractAlgorithm​(AbstractInputData data)
        Create a new algorithm with an empty list of observers.
        Parameters:
        data - Input data for the algorithm.
      • AbstractAlgorithm

        protected AbstractAlgorithm​(AbstractInputData data,
                                    java.util.ArrayList<Observer> observers)
        Create a new algorithm with the given list of observers.
        Parameters:
        data - Input data for the algorithm.
        observers - Initial list of observers for the algorithm.
    • Method Detail

      • addObserver

        public void addObserver​(Observer observer)
        Add an observer to this algorithm.
        Parameters:
        observer - Observer to add to this algorithm.
      • getObservers

        public java.util.ArrayList<Observer> getObservers()
        Returns:
        The list of observers for this algorithm.
      • getInputData

        public AbstractInputData getInputData()
        Returns:
        Input for this algorithm.
      • run

        public AbstractSolution run()
        Run the algorithm and return the solution. This methods internally time the call to doRun() and update the result of the call with the computed solving time.
        Returns:
        The solution found by the algorithm (may not be a feasible solution).
      • doRun

        protected abstract AbstractSolution doRun()
        Abstract method that should be implemented by child class.
        Returns:
        The solution found, must not be null (use an infeasible or unknown status if necessary).