Java Code Examples for org.apache.commons.math.ode.events.CombinedEventsManager#getEventsStates()

The following examples show how to use org.apache.commons.math.ode.events.CombinedEventsManager#getEventsStates() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               Math.ulp(Math.max(Math.abs(startTime), Math.abs(endTime))),
                               100);
    return newManager;
}
 
Example 2
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               FastMath.ulp(FastMath.max(FastMath.abs(startTime), FastMath.abs(endTime))),
                               100);
    return newManager;
}
 
Example 3
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               Math.ulp(Math.max(Math.abs(startTime), Math.abs(endTime))),
                               100);
    return newManager;
}
 
Example 4
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               Math.ulp(Math.max(Math.abs(startTime), Math.abs(endTime))),
                               100);
    return newManager;
}
 
Example 5
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               Math.ulp(Math.max(Math.abs(startTime), Math.abs(endTime))),
                               100);
    return newManager;
}
 
Example 6
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               Math.ulp(Math.max(Math.abs(startTime), Math.abs(endTime))),
                               100);
    return newManager;
}
 
Example 7
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               Math.ulp(Math.max(Math.abs(startTime), Math.abs(endTime))),
                               100);
    return newManager;
}
 
Example 8
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               Math.ulp(Math.max(Math.abs(startTime), Math.abs(endTime))),
                               100);
    return newManager;
}
 
Example 9
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               Math.ulp(Math.max(Math.abs(startTime), Math.abs(endTime))),
                               100);
    return newManager;
}
 
Example 10
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               Math.ulp(Math.max(Math.abs(startTime), Math.abs(endTime))),
                               100);
    return newManager;
}
 
Example 11
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               Math.ulp(Math.max(Math.abs(startTime), Math.abs(endTime))),
                               100);
    return newManager;
}
 
Example 12
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               Math.ulp(Math.max(Math.abs(startTime), Math.abs(endTime))),
                               100);
    return newManager;
}
 
Example 13
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               Math.ulp(Math.max(Math.abs(startTime), Math.abs(endTime))),
                               100);
    return newManager;
}