// If current time matches a time on the breakpoint table
// with the current index, then remove that breakpoint because we have
// just completed execution of that iteration.
if (!_breakpoints.isEmpty()) {
SuperdenseTime nextBreakpoint = (SuperdenseTime) _breakpoints
.first();
Time breakpointTime = nextBreakpoint.timestamp();
int comparison = breakpointTime.compareTo(_currentTime);
if (comparison == 0 && nextBreakpoint.index() == _index) {
if (_debugging) {
_debug("Removing breakpoint at " + nextBreakpoint);
}
_breakpoints.removeFirst();
}
}
// If the current time is equal to the stop time, return false.
// Check, however, to make sure that the breakpoints table
// does not contain the current model time, which would mean
// that more events may be generated at this time.
// If the index of the breakpoint is the same as the current
// index, then we have executed it. This must be called
// after postfire() of the controlled actors is called, because
// they may call fireAt(), which inserts events in the breakpoint
// table.
if (_currentTime.equals(_stopTime)) {
SuperdenseTime nextBreakpoint = (SuperdenseTime) _breakpoints
.first();
if (nextBreakpoint == null
|| nextBreakpoint.timestamp().compareTo(_currentTime) > 0) {
return false;
}
}
// Set the suggested step size for next integration step by polling