Hi all,
Sorry to bother you again. I met a problem with the event detectors, and I hope you could give me some suggestions.
I would like to form an ISL that only connects during a certain period of time.
For this purpose, I noticed that using BooleanDetector.andCombine() might be a solution. Also, according to the API documentation of BooleanDetector:
Using this detector with detectors that are not based on entry to or exit from a region, e.g.
DateDetector,LongitudeCrossingDetector, will likely lead to unexpected results. To apply conditions to this latter type of event detectors aEventEnablingPredicateFilteris usually more appropriate.
So, after building an InterSatDirectViewDetector (islDetector), I also built an EventEnablingPredicateFilter, and combined them through BooleanDetector:
// Date detector
DateDetector raw = new DateDetector(startDate).withMaxCheck(step-1.0).withHandler(new ContinueOnEvent<DateDetector>());
for (AbsoluteDate extrapDate = startDate.shiftedBy(step); extrapDate.compareTo(endDate) <= 0; extrapDate = extrapDate.shiftedBy(step)) {
raw.addEventDate(extrapDate);
}
EventEnablingPredicateFilter<DateDetector> timeDetector = new EventEnablingPredicateFilter<DateDetector>(raw, new EnablingPredicate<DateDetector>() {
@Override
public boolean eventIsEnabled(SpacecraftState state, DateDetector eventDetector, double g) {
return false;
}
});
// Combine both detectors
BooleanDetector detector = BooleanDetector.andCombine(islDetector, timeDetector);
Here I used return false; just to test if this detector would work. Then I used this combined detector to build EventBasedScheduler<InterSatellitesRange> and then added this scheduler to a generator.
But when I ran the program, I found that the generated measurements are the same with the InterSatDirectViewDetector only. Namely, it seems that the date detector doesn’t work, even if I specifically disabled all events by using return false;.
I also tried to directly combine InterSatDirectViewDetector with DateDetector. And the generated measurements are indeed odd.
Is there anything I missed or did wrong? Do you have any suggestions? Thanks a lot for your help!
PS: the reason why I didn’t directly change the dates via generator.generate(startDate, endDate); is that I also need to add range measurements scheduler to the generator, which would be connected during the whole period.
