亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sum_last.java

?? ptolemyModel嵌入式系統建模實例代碼
?? JAVA
字號:
/* An actor that outputs the sum of the inputs so far.*/

package ptolemy.actor.lib;

import ptolemy.actor.IOPort;
import ptolemy.actor.TypedIOPort;
import ptolemy.data.BooleanToken;
import ptolemy.data.IntToken;
import ptolemy.data.DoubleToken;
import ptolemy.data.Token;
import ptolemy.data.expr.Parameter;
import ptolemy.data.type.BaseType;
import ptolemy.data.type.Type;
import ptolemy.kernel.CompositeEntity;
import ptolemy.kernel.util.*;

//////////////////////////////////////////////////////////////////////////
//// Sum
/**
Output the initial value plus the sum of all the inputs since
the last time a true token was received at the reset port.
One output is produced each time the actor is fired. The
inputs and outputs can be any token type that supports addition.
The output type is constrained to be the greater than or
equal to the input type and the initial value type.

*/

public class Sum extends Transformer {

    /** Construct an actor with the given container and name.
     *  @param container The container.
     *  @param name The name of this actor.
     *  @exception IllegalActionException If the actor cannot be contained
     *   by the proposed container.
     *  @exception NameDuplicationException If the container already has an
     *   actor with this name.
     */
    public Sum(CompositeEntity container, String name)
            throws NameDuplicationException, IllegalActionException  {
        super(container, name);

        input.setMultiport(true);
		

        reset = new TypedIOPort(this, "reset", true, false);
        reset.setTypeEquals(BaseType.BOOLEAN);
		STC_out=new TypedIOPort(this,"STC_out",false,true);
		

        init = new Parameter(this, "init", new IntToken(0));
		//rotation=new Parameter(this,"rotation");
		//rotation.setExpression("200");

        // set the type constraints.
        output.setTypeAtLeast(init);
        output.setTypeAtLeast(input);
        STC_out.setTypeAtLeast(input);
    }

    ///////////////////////////////////////////////////////////////////
    ////                     ports and parameters                  ////

    /** The value produced by the ramp on its first iteration.
     *  The default value of this parameter is the integer 0.
     */
    public Parameter init;

    /** The reset port of type BooleanToken. If this port
     *  receives a True token, then the Sum state will be
     *  reset to the initial value.
     */
    public TypedIOPort reset;

   /* the count of cycle   */
  // public Parameter rotaiton;

   public TypedIOPort  STC_out;

    ///////////////////////////////////////////////////////////////////
    ////                         public methods                    ////

    /** Clone the actor into the specified workspace. This calls the
     *  base class and then sets up the type constraints.
     *  @param workspace The workspace for the new object.
     *  @return A new actor.
     *  @exception CloneNotSupportedException If a derived class contains
     *   an attribute that cannot be cloned.
     */
    public Object clone(Workspace workspace)
            throws CloneNotSupportedException {
        Sum newObject = (Sum)super.clone(workspace);
        // set the type constraints.
        newObject.output.setTypeAtLeast(newObject.init);
        newObject.output.setTypeAtLeast(newObject.input);
        return newObject;
    }

    /** Consume at most one token from the <i>input</i> port,
     *  add it to the running sum, and produce the result at the
     *  <i>output</i> port.  If there is no input token available,
     *  the current value of the running sum is the output value.
     *  If there is a true-valued token on the <i>reset</i> input,
     *  then the running sum is reset to the initial value before
     *  adding the input.
     *  @exception IllegalActionException If addition is not
     *   supported by the supplied tokens.
     */
    public void fire() throws IllegalActionException {
        _latestSum = _sum;
        // Check whether to reset.
        for (int i = 0; i < reset.getWidth(); i++) {
            if (reset.hasToken(i)) {
                BooleanToken r = (BooleanToken)reset.get(i);
                if (r.booleanValue()) {
                    // Being reset at this firing.
                    STC_out.send(0,_latestSum);
					_latestSum = output.getType().convert(init.getToken());
                    				}
            }
        }
        for (int i = 0; i < input.getWidth(); i++) {
            if (input.hasToken(i)) {
                Token in = input.get(i);
                _latestSum = _latestSum.add(in);
            }
        }
        output.broadcast(_latestSum);
    }

    /** Reset the running sum to equal the value of <i>init</i>.
     *  @exception IllegalActionException If the parent class throws it.
     */
    public void initialize() throws IllegalActionException {
        super.initialize();
        _latestSum = _sum = output.getType().convert(init.getToken());
    }

    /** Record the most recent input as part of the running average.
     *  Do nothing if there is no input.
     *  @exception IllegalActionException If the base class throws it.
     */
    public boolean postfire() throws IllegalActionException {
        _sum = _latestSum;
        return super.postfire();
    }

    ///////////////////////////////////////////////////////////////////
    ////                         private members                   ////

    private Token _sum;
    private Token _latestSum;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人开心网精品视频| 亚洲自拍偷拍图区| 精品久久久久久久久久久久久久久| 色综合久久久网| 99久久精品免费精品国产| 成人app网站| 99精品视频一区| 91同城在线观看| 99精品欧美一区二区三区综合在线| 成人一区二区三区视频| www.欧美.com| 欧美视频自拍偷拍| 欧美一级片免费看| 精品美女一区二区三区| 国产婷婷色一区二区三区四区| 国产精品久久久一区麻豆最新章节| 国产精品久久久久毛片软件| 国产精品福利av| 一区二区三区不卡视频在线观看| 亚洲一区二区三区视频在线播放 | www.在线成人| 色狠狠av一区二区三区| 91精品国产一区二区三区香蕉| 精品国产1区2区3区| 国产人成一区二区三区影院| 国产精品久久久久久福利一牛影视| 亚洲精品国产一区二区精华液 | 久久先锋资源网| 亚洲欧洲日产国码二区| 亚洲成人7777| 国产一区二三区| 91麻豆福利精品推荐| 欧美一级黄色片| 亚洲色图一区二区三区| 亚洲va欧美va国产va天堂影院| 国内久久婷婷综合| 日本福利一区二区| 欧美激情在线看| 三级在线观看一区二区 | 99视频超级精品| 制服丝袜中文字幕一区| 中文在线资源观看网站视频免费不卡| 美女任你摸久久| 91小视频在线免费看| 日韩视频中午一区| 亚洲一区在线播放| 国产一区二区三区黄视频 | 亚洲日本在线观看| 国精产品一区一区三区mba视频| 欧洲在线/亚洲| 国产精品美日韩| 理论电影国产精品| 欧日韩精品视频| 国产精品私人影院| 国产专区综合网| 69av一区二区三区| 伊人色综合久久天天人手人婷| 国产乱子伦视频一区二区三区 | 国产精品自拍三区| 欧美一区二区三区视频| 有坂深雪av一区二区精品| 国产精品一区二区三区四区| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 久久久天堂av| 国模冰冰炮一区二区| 欧美一区二区三区视频免费 | 欧美一级久久久| 亚洲国产人成综合网站| www.亚洲色图.com| 国产精品久久久久久久久晋中| 国产麻豆精品在线观看| 精品成人一区二区三区| 日本女优在线视频一区二区 | 精品制服美女丁香| 精品欧美一区二区在线观看| 日韩电影在线免费| 制服.丝袜.亚洲.中文.综合| 亚洲国产精品影院| 69堂成人精品免费视频| 日日噜噜夜夜狠狠视频欧美人| 91成人免费在线视频| 夜夜爽夜夜爽精品视频| 在线亚洲高清视频| 亚洲成年人影院| 在线成人免费观看| 美国三级日本三级久久99| 亚洲精品一区二区三区四区高清| 精品中文字幕一区二区| 久久久精品免费免费| 成年人午夜久久久| 一区二区理论电影在线观看| 51精品久久久久久久蜜臀| 日韩成人精品在线观看| 久久影院电视剧免费观看| 国产高清亚洲一区| 亚洲欧洲av一区二区三区久久| 色婷婷亚洲综合| 天堂在线一区二区| 久久综合九色欧美综合狠狠| 风间由美性色一区二区三区| 亚洲精品日日夜夜| 337p亚洲精品色噜噜| 国产自产2019最新不卡| 中文字幕一区二区三区乱码在线| 欧美在线999| 久久精品久久综合| 国产精品久久久99| 8x8x8国产精品| 国产麻豆精品95视频| 亚洲欧美日韩国产中文在线| 91精品国产综合久久久久久久 | 午夜国产不卡在线观看视频| 欧美成人欧美edvon| 成人动漫一区二区| 无码av中文一区二区三区桃花岛| 精品99一区二区| 91成人国产精品| 国产成人综合在线播放| 一区二区三区在线视频播放| 亚洲精品一区在线观看| 欧美亚洲国产bt| 成人一区二区三区在线观看| 日精品一区二区三区| 一区在线中文字幕| 欧美精品一区二区高清在线观看| 色老综合老女人久久久| 久久99国产精品久久| 亚洲综合精品久久| 欧美激情一二三区| 精品国产91乱码一区二区三区| 欧美日韩综合在线免费观看| av网站一区二区三区| 国产精品影音先锋| 轻轻草成人在线| 亚洲v精品v日韩v欧美v专区 | 亚洲一区二区三区视频在线播放| 国产色综合久久| 日韩欧美一区在线观看| 在线观看视频一区| 91免费国产在线观看| 国产一区二区久久| 麻豆精品视频在线| 午夜婷婷国产麻豆精品| 一区二区三区日本| **网站欧美大片在线观看| 久久久亚洲精品一区二区三区| 欧美变态口味重另类| 日韩一区二区三区视频| 欧美精品日日鲁夜夜添| 欧美日韩国产中文| 欧美欧美欧美欧美| 欧美久久一二三四区| 欧美美女一区二区三区| 欧美日韩1区2区| 欧美精品第1页| 3atv在线一区二区三区| 欧美一区二区精品在线| 欧美一区二区免费视频| 日韩视频中午一区| 久久亚洲精品国产精品紫薇| 久久久美女毛片| 国产精品丝袜一区| 亚洲人成7777| 亚洲永久精品国产| 天天亚洲美女在线视频| 久久97超碰国产精品超碰| 国产精品一线二线三线精华| 99视频在线精品| 欧美日韩亚洲综合| 日韩一级片网站| 国产午夜亚洲精品午夜鲁丝片 | 欧美中文字幕不卡| 日韩一级免费观看| 中文字幕精品—区二区四季| 亚洲日本丝袜连裤袜办公室| 午夜精品福利一区二区三区av| 美女免费视频一区| 99在线视频精品| 欧美军同video69gay| 国产性做久久久久久| 一二三区精品视频| 国产精品自在欧美一区| 色婷婷av一区二区| 久久亚洲精华国产精华液| 亚洲精品伦理在线| 国产一区二区三区在线观看免费| 99精品久久久久久| 69堂精品视频| 亚洲人成人一区二区在线观看| 日日摸夜夜添夜夜添精品视频 | 久久先锋影音av鲁色资源网| 综合久久国产九一剧情麻豆| 无码av中文一区二区三区桃花岛| 国产成人亚洲综合a∨猫咪| 色屁屁一区二区| 国产色产综合色产在线视频| 日韩在线卡一卡二| 97se亚洲国产综合自在线| 欧美一卡二卡三卡四卡| 一区精品在线播放|