Feature suggestion: time interval

Hi folks,

I’ve often needed a time interval when using Orekit, with some convenient utility methods based upon it (BoundedAttitudeProvider, EventDetector). So I thought such a feature could be contributed to the library. It is pretty low level.
You’ll find in MR766 how the main code would look like. Let me know if that sounds good.

Cheers,
Romain.

3 Likes

Seems good to me!
+1 for the addition.

1 Like

Good idea @Serrof :+1:

1 Like

Simple and yet a powerful feature, +1 !

1 Like

Looks like a useful feature. +1

Looks like there is only one implementation of the TimeInterval interface. Do you anticipate other implementations?

Consider adding equals(Object) and hashcode(). Then they could be used in collections. For example, it might be useful to “view” a TimeSpanMap as a Map<TimeInterval, ...>.

I’m guessing a future request will be to make a TimeIntervalSet. :wink: Hipparchus has classes for 1D geometry. Perhaps make field versions of them so they can work with AbsoluteDates. Then TimeInterval could implement FieldInterval<AbsoluteDate> and be used in a FieldIntervalsSet.

Anyways, just some thoughts on future directions. It’s a nice contribution as is.

Regards,
Evan

1 Like

Hi Evan,

Thanks for the feedback.
I’m inclined to leave it as an interface with only a static implementation (so not mandatory at all). This way people can easily tweak it.
Your suggestion on the set is interesting. Maybe open an issue on Hipparchus then.
Anyway I’ve just merged but we can definitely build further upon this in the future, I also have a couple ideas.

Cheers,
Romain.

1 Like