Package ptolemy.domains.continuous.kernel

Examples of ptolemy.domains.continuous.kernel.ContinuousDirector


    /** Return the refined step size if there is a missed event,
     *  otherwise return the current step size.
     *  @return The refined step size.
     */
    public double refinedStepSize() {
        ContinuousDirector dir = (ContinuousDirector) getDirector();
        double refinedStep = dir.getCurrentStepSize();

        if (_eventMissed) {
            // The refined step size is a linear interpolation.
            // NOTE: we always to get a little overshoot to make sure the
            // level crossing happens. The little overshoot chosen here
            // is half of the error toelrance.
            refinedStep = ((Math.abs(_lastTrigger - _level) + (_errorTolerance / 2)) * dir
                    .getCurrentStepSize())
                    / Math.abs(_thisTrigger - _lastTrigger);

            if (_debugging) {
                _debug(getFullName() + " Event Missed: refined step to "
                        + refinedStep + " at " + dir.getModelTime());
            }
        }

        return refinedStep;
    }
View Full Code Here

TOP

Related Classes of ptolemy.domains.continuous.kernel.ContinuousDirector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.