001/* Base class for sequence-based sources. 002 003 Copyright (c) 1998-2014 The Regents of the University of California. 004 All rights reserved. 005 Permission is hereby granted, without written agreement and without 006 license or royalty fees, to use, copy, modify, and distribute this 007 software and its documentation for any purpose, provided that the above 008 copyright notice and the following two paragraphs appear in all copies 009 of this software. 010 011 IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY 012 FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 013 ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF 014 THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF 015 SUCH DAMAGE. 016 017 THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, 018 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 019 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE 020 PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF 021 CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, 022 ENHANCEMENTS, OR MODIFICATIONS. 023 024 PT_COPYRIGHT_VERSION_2 025 COPYRIGHTENDKEY 026 027 */ 028package ptolemy.actor.lib; 029 030import ptolemy.kernel.CompositeEntity; 031import ptolemy.kernel.util.IllegalActionException; 032import ptolemy.kernel.util.NameDuplicationException; 033 034////////////////////////////////////////////////////////////////////////// 035//// SequenceSource 036 037/** 038 Base class for sequence sources. A sequence source is 039 a source where the output value is logically a sequence, independent 040 of time, but dependent on the iteration number. For some time-based 041 domains, such as CT, actors of this type probably do not make sense 042 because the number of iterations that the actor experiences per unit 043 time is not easily determined or controlled. This actor has a parameter, 044 <i>firingCountLimit</i>, that optionally limits the number of iterations 045 for which the actor is fired. If this number is <i>n</i> > 0, then 046 the <i>n</i>-th invocation of postfire() returns false, which ggindicates 047 to the scheduler that it should stop invocations of this actor. 048 The default value of <i>firingCountLimit</i> 049 is NONE, which results in postfire always returning 050 true. Derived classes must call super.postfire() for this mechanism to 051 work. 052 053 @author Edward A. Lee 054 @version $Id$ 055 @since Ptolemy II 0.3 056 @Pt.ProposedRating Green (eal) 057 @Pt.AcceptedRating Green (bilung) 058 */ 059public class SequenceSource extends LimitedFiringSource 060 implements SequenceActor { 061 /** Construct an actor with the given container and name. 062 * The <i>firingCountLimit</i> parameter is also constructed. 063 * @param container The container. 064 * @param name The name of this actor. 065 * @exception IllegalActionException If the actor cannot be contained 066 * by the proposed container. 067 * @exception NameDuplicationException If the container already has an 068 * actor with this name. 069 */ 070 public SequenceSource(CompositeEntity container, String name) 071 throws NameDuplicationException, IllegalActionException { 072 // NOTE: This actor only adds implementing the 073 // marker interface SequenceActor to its base class. 074 super(container, name); 075 } 076}