/* Interface for attributes that regulate the passage of time. Copyright (c) 2007-2013 The Regents of the University of California. All rights reserved. Permission is hereby granted, without written agreement and without license or royalty fees, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following two paragraphs appear in all copies of this software. IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. PT_COPYRIGHT_VERSION_2 COPYRIGHTENDKEY */ package ptolemy.actor; import ptolemy.actor.util.Time; import ptolemy.kernel.util.IllegalActionException; /////////////////////////////////////////////////////////////////// //// TimeRegulator /** This interface is implemented by attributes that wish to be consulted when a director advances time. In particular, the director will call the one method in this interface, passing it a proposed time to advance to, and the method will return either the same proposed time or a smaller time. The method may not return immediately. For example, it might wait for real time to advance to the proposed time, and then simply return the proposed time. @author Edward A. Lee, Gilles Lasnier, Patricia Derler @version $Id: TimeRegulator.java 66124 2013-04-23 23:09:32Z eal $ @since Ptolemy II 10.0 @Pt.ProposedRating Yellow (eal) @Pt.AcceptedRating Red (cxh) */ public interface TimeRegulator { /////////////////////////////////////////////////////////////////// //// public methods //// /** Propose a time to advance to. * @param proposedTime The proposed time. * @return The proposed time or a smaller time. * @exception IllegalActionException If the time regulator is being misused. */ public Time proposeTime(Time proposedTime) throws IllegalActionException; }