|Modifier||Constructor and Description|
Initializes a new instance.
Initializes a new instance as a copy of an existing instance.
|Modifier and Type||Method and Description|
Gets a value indicating whether the methods on this instance are safe to call from multiple threads simultaneously.
This method will examine from the state and return
Performs a simple check of the
areConstraintsSatisfied, clone, dispose, dispose, getAvailabilityIntervals, getCachingWrapper, getGroup, getName, getWhenToCheck, initialize, isAvailable, updateEvaluatorReferences
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected ThresholdStoppingConditionConstraintEvaluator(@Nonnull EvaluatorGroup group, @Nonnull ThresholdStoppingConditionConstraint definition)
protected ThresholdStoppingConditionConstraintEvaluator(@Nonnull ThresholdStoppingConditionConstraintEvaluator existingInstance, @Nonnull CopyContext context)
ICloneWithContext.clone(CopyContext) for more information about how to implement this constructor
in a derived class.
public boolean getIsThreadSafe()
If this property is
true, all methods and properties are guaranteed to be thread safe.
Conceptually, an object that returns
true for this method acts as if there is a lock
protecting each method and property such that only one thread at a time can be inside any method or
property in the class. In reality, such locks are generally not used and are in fact discouraged. However,
the user must not experience any exceptions or inconsistent behavior that would not be experienced if such
locks were used.
If this property is
false, the behavior when using this class from multiple threads
simultaneously is undefined and may include inconsistent results and exceptions. Clients wishing to use
multiple threads should call
CopyForAnotherThread.copy(T) to get a separate instance of the
object for each thread.
public static boolean simpleCheck(double currentValue, double threshold, double tolerance, boolean useAbsoluteValue, @Nonnull InequalityCondition inequalityCriteria, double smallestValue, double largestValue)
tolerance, using the
inequalityCriteriato determine if this constraint is satisfied by the
currentValue. This method can be called by
ThresholdStoppingConditionConstraintEvaluator.isConstraintSatisfied(agi.foundation.coordinates.ITimeBasedState)if your constraint is simply computing a value to be compared to a threshold.
currentValue- The current computed value.
threshold- The threshold.
tolerance- The tolerance.
smallestValue- The smallest value that has been computed up to this point.
largestValue- The largest value that has been computed up to this point.
InequalityConditionthat should be used to compare the
useAbsoluteValue- Whether or not the absolute value of the
currentValueshould be used when determining if the constraint is satisfied.
currentValuesatisfies the constraint; otherwise
public void checkCurrentState(ITimeBasedState currentState)
ITimeBasedStateis checked by the parent
StoppingConditionEvaluator. This method should be used when the criteria of your
StoppingConditionConstraintEvaluatorneeds to check every computed state. For example,
ThresholdStoppingConditionConstraintEvaluatorneeds to keep track of extrema if its
set) is set to
public boolean isConstraintSatisfied(ITimeBasedState state)
constraintis satisfied, and
protected abstract double evaluateSingleValue(ITimeBasedState state)