Class IterationManager


  • public class IterationManager
    extends Object
    This abstract class provides a general framework for managing iterative algorithms. The maximum number of iterations can be set, and methods are provided to monitor the current iteration count. A lightweight event framework is also provided.
    • Method Detail

      • getIterations

        public int getIterations()
        Returns the number of iterations of this solver, 0 if no iterations has been performed yet.
        Returns:
        the number of iterations.
      • getMaxIterations

        public int getMaxIterations()
        Returns the maximum number of iterations.
        Returns:
        the maximum number of iterations.
      • incrementIterationCount

        public void incrementIterationCount()
        Increments the iteration count by one, and throws an exception if the maximum number of iterations is reached. This method should be called at the beginning of a new iteration.
        Throws:
        MaxCountExceededException - if the maximum number of iterations is reached.
      • removeIterationListener

        public void removeIterationListener​(IterationListener listener)
        Removes the specified iteration listener from the list of listeners currently attached to this object. Attempting to remove a listener which was not previously registered does not cause any error.
        Parameters:
        listener - The IterationListener to be removed.
      • resetIterationCount

        public void resetIterationCount()
        Sets the iteration count to 0. This method must be called during the initial phase.