Orekit should provide a least one implementation of AdapableInterval
For fixed size interval, a lambda method can be used (e.g. state -> interval
) to implement AdapableInterval. However, the fix interval can be computed using a method (sometimes complex) so, each time the lambda is used, the complex method is called (usually to compute the same value of fixed interval). Using an implemntation of the AdaptableInterval which perform the computation only once solves the problem.
A simple implementation could be:
public class FixedSizeInterval implements AdaptableInterval {
/** The fixed interval. */
private final double interval;
/** Constructor.
* @param interval the fixed interval
*/
public FixedSizeInterval(interval) {
this.interval = interval;
}
@Override
public double currentInterval(SpacecraftState state) {
return interval;
}
}