public abstract class AccessConstraintEvaluator extends MotionEvaluator1<Double>
The base class for Access constraint evaluators.
The result of the MotionEvaluator1.evaluate(JulianDate,int)
method should be a scalar value indicating satisfaction for positive values. If possible, it
should also report the rates of change of the scalar constraint value.
Modifier and Type | Field and Description |
---|---|
protected static double |
DefaultTolerance
|
Modifier | Constructor and Description |
---|---|
protected |
AccessConstraintEvaluator(AccessConstraintEvaluator existingInstance,
CopyContext context)
Initializes a new instance as a copy of an existing instance.
|
protected |
AccessConstraintEvaluator(EvaluatorGroup group)
Initializes a new instance.
|
Modifier and Type | Method and Description |
---|---|
IEvaluator |
getCachingWrapper()
Gets a version of this evaluator that caches the previously computed value so that if it is evaluated
twice at the same date the computation is done only once.
|
HierarchicalLogger |
getDebuggingLogger()
Gets the logger used to examine access query evaluations.
|
AccessEvaluator |
getQueryEvaluator(IServiceProvider inputTimeObserver,
AccessConstraint constraint,
IServiceProvider requiredTimeObserver,
EvaluatorGroup group)
Creates and returns an
AccessEvaluator wrapping a given constraint evaluator. |
double |
getTolerance()
Gets the tolerance on the constraint value to use when computing the time when this constraint crosses its threshold.
|
boolean |
isSatisfied(JulianDate date)
Determines if the constraint is satisfied for a particular
JulianDate . |
void |
setDebuggingLogger(HierarchicalLogger value)
Sets the logger used to examine access query evaluations.
|
protected void |
setTolerance(double value)
Sets the tolerance on the constraint value to use when computing the time when this constraint crosses its threshold.
|
evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, getAvailabilityIntervals, getAvailabilityIntervals, getGroup, getIsTimeVarying, isAvailable, updateEvaluatorReferences
clone, dispose, dispose, getIsThreadSafe, getNextSampleSuggestion
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getIsThreadSafe
clone
close, dispose
protected static final double DefaultTolerance
protected AccessConstraintEvaluator(@Nonnull EvaluatorGroup group)
group
- The group that contains this evaluator.ArgumentNullException
- Thrown when group
is null
.protected AccessConstraintEvaluator(@Nonnull AccessConstraintEvaluator existingInstance, @Nonnull CopyContext context)
See ICloneWithContext.clone(CopyContext)
for more information about how to implement this constructor
in a derived class.
existingInstance
- The existing instance to copy.context
- A CopyContext
that controls the depth of the copy.ArgumentNullException
- Thrown when existingInstance
or context
is null
.public IEvaluator getCachingWrapper()
This method is called by EvaluatorGroup
to create a caching version of an evaluator
that is shared between multiple computations.
To implement this method in your own evaluator, construct and return a caching version of the evaluator's base class.
For example, if your evaluator implements IEvaluator1
directly, return an instance of
CachingEvaluator
. In many cases, such as when implementing a PointEvaluator
this method does not need to be overridden because the default implementation returns an appropriate
caching wrapper already. If you do not want the last value computed by your evaluator to ever be cached, or
if your evaluator does its own caching internally, this method can return this
.
Shows an example implementation in an evaluator that implements IEvaluator1
directly, where T is double.
@Override
public IEvaluator getCachingWrapper() {
return new CachingEvaluator<Double>(this);
}
getCachingWrapper
in interface IEvaluator
getCachingWrapper
in class MotionEvaluator1<Double>
this
should be returned by this method.public boolean isSatisfied(@Nonnull JulianDate date)
JulianDate
.date
- The date to examine.true
if the constraint is satisfied; otherwise false
.public final double getTolerance()
protected final void setTolerance(double value)
@Nullable public final HierarchicalLogger getDebuggingLogger()
public final void setDebuggingLogger(@Nullable HierarchicalLogger value)
@Nonnull public final AccessEvaluator getQueryEvaluator(IServiceProvider inputTimeObserver, @Nonnull AccessConstraint constraint, IServiceProvider requiredTimeObserver, @Nonnull EvaluatorGroup group)
AccessEvaluator
wrapping a given constraint evaluator.inputTimeObserver
- The IServiceProvider
to use as a time observer
in creating this query evaluator. Input times to be evaluated will be with respect to this observer,
and this method will adjust the times as necessary for the constraint's
requiredTimeObserver
.constraint
- The constraint being evaluated.requiredTimeObserver
- The time observer that is required by the constraint function. This method will attempt to reconcile the
constraint's requested time observer against the IServiceProvider
specified in
inputTimeObserver
.group
- The group with which to associate the new evaluator. By grouping evaluators
that are often evaluated at the same Julian dates, common computations can be performed only once
for the entire group instead of multiple times for each evaluator.ArgumentNullException
- Thrown when constraint
or group
is null
.