Class StopCriteria


  • public class StopCriteria
    extends java.lang.Object

    StopCriteria is a class for specifying an instant a compution
    should be aborted.

    The computation determines when to stop by repeatedly polling the
    StopCriteria::stop() method. Therefore the stop() method should be
    implemented to have a very short, preferably deterministic running time.
    • Constructor Detail

      • StopCriteria

        public StopCriteria​(long cPtr,
                            boolean cMemoryOwn)
    • Method Detail

      • getCPtr

        public static long getCPtr​(StopCriteria obj)
      • delete

        public void delete()
      • stop

        public boolean stop()
        True is returned when the computation should be stopped.
      • instance

        public StopCriteriaPtr instance()
        A new instance of the property constructed to match the
        original initial state of the criteria.

        This implies, for example, that instance() called for a time criteria
        creates a new criteria that stops after the same amount of time that
        was specified for the original stop criteria.

        Not all stop criteria returned are required to behave this way. For
        some types of stop criteria, the instances of the stop criteria will
        be effectively identical to the stop criteria itself.
      • stopAfter

        public static StopCriteriaPtr stopAfter​(double time)
        Stop the computation after time seconds from now.

        RobWork does not link with a thread library, and therefore this
        function is implemented by polling a timer. This makes the function
        relatively slow for its purpose.
      • stopNever

        public static StopCriteriaPtr stopNever()
        Never stop the computation.
      • stopNow

        public static StopCriteriaPtr stopNow()
        Immediately stop the computation.
      • stopByFlag

        public static StopCriteriaPtr stopByFlag​(SWIGTYPE_p_bool stop)
        Stop the computation when stop says so.

        stop must be non-null.

        Ownership of stop is not taken.
      • stopCnt

        public static StopCriteriaPtr stopCnt​(int cnt)
        Stop the computation after cnt calls of the stop criteria.