Package org.robwork.sdurw_pathplanning
Class StopCriteria
- java.lang.Object
-
- org.robwork.sdurw_pathplanning.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 Summary
Constructors Constructor Description StopCriteria(long cPtr, boolean cMemoryOwn)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete()
static long
getCPtr(StopCriteria obj)
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.boolean
stop()
True is returned when the computation should be stopped.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.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.static StopCriteriaPtr
stopByFun(SWIGTYPE_p_boost__functionT_bool_fF_t fun)
Stop the computation when fun says so.static StopCriteriaPtr
stopCnt(int cnt)
Stop the computation after cnt calls of the stop criteria.static StopCriteriaPtr
stopEither(StopCriteriaPtr a, StopCriteriaPtr b)
Stop if either a or b says stop.static StopCriteriaPtr
stopEither(VectorStopCriteriaPtr criteria)
Stop if either of criteria says stop.static StopCriteriaPtr
stopNever()
Never stop the computation.static StopCriteriaPtr
stopNow()
Immediately stop the computation.
-
-
-
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.
-
stopByFun
public static StopCriteriaPtr stopByFun(SWIGTYPE_p_boost__functionT_bool_fF_t fun)
Stop the computation when fun says so.
-
stopCnt
public static StopCriteriaPtr stopCnt(int cnt)
Stop the computation after cnt calls of the stop criteria.
-
stopEither
public static StopCriteriaPtr stopEither(VectorStopCriteriaPtr criteria)
Stop if either of criteria says stop.
-
stopEither
public static StopCriteriaPtr stopEither(StopCriteriaPtr a, StopCriteriaPtr b)
Stop if either a or b says stop.
-
-