001/* An actor that merges two monotonically increasing streams into one. 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.domains.ddf.lib; 029 030import ptolemy.actor.lib.OrderedMerge; 031import ptolemy.kernel.CompositeEntity; 032import ptolemy.kernel.util.IllegalActionException; 033import ptolemy.kernel.util.NameDuplicationException; 034 035////////////////////////////////////////////////////////////////////////// 036//// DDFOrderedMerge 037 038/** 039 This actor merges two monotonically nondecreasing streams of tokens 040 into one monotonically nondecreasing stream. On each firing, it reads 041 data from one of the inputs. On the first firing, it simply records 042 that token. On the second firing, it reads data from the other input 043 and outputs the smaller of the recorded token and the one it just read. 044 If they are equal, then it outputs the recorded token. It then records 045 the larger token. On each subsequent firing, it reads a token from the 046 input port that did not provide the recorded token, and produces at the 047 output the smaller of the recorded token and the one just read. 048 <p> 049 If both input sequences are nondecreasing, then the output sequence 050 will be nondecreasing. 051 Note that if the inputs are not nondecreasing, then the output is 052 rather complex. The key is that in each firing, it produces the smaller 053 of the recorded token and the token it is currently reading. 054 This derived class only updates rate parameters to indicate the next input 055 port. 056 057 @author Gang Zhou 058 @version $Id$ 059 @since Ptolemy II 4.1 060 @Pt.ProposedRating Yellow (zgang) 061 @Pt.AcceptedRating Yellow (cxh) 062 @deprecated Use OrderedMerge, which now supports DDF. 063 */ 064@Deprecated 065public class DDFOrderedMerge extends OrderedMerge { 066 /** Construct an actor with the given container and name. 067 * @param container The container. 068 * @param name The name of this actor. 069 * @exception IllegalActionException If the actor cannot be contained 070 * by the proposed container. 071 * @exception NameDuplicationException If the container already has an 072 * actor with this name. 073 */ 074 public DDFOrderedMerge(CompositeEntity container, String name) 075 throws NameDuplicationException, IllegalActionException { 076 super(container, name); 077 } 078}