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

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

?? petrinet.java

?? Petri網繪制圖形、仿真、計算工具。可用于進行結構分析和性能分析。
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*    IMPORTS*/import java.applet.*;import java.awt.*;import java.lang.*;import java.util.*;import java.io.*;import java.net.*;/*    PetriNet class - implements Petri Net abstraction - a collection of    place and transition objects and operations on them.*/class PetriNet implements PlaceTransitionIdResolver{    /*        CLASS CONSTANTS    */    /*        return values from some calls    */    /* normal status */    final static int    STATUS_NORMAL            = 1;    /* file specified for loading was not found */    final static int    STATUS_FILE_NOT_FOUND    = 2;    /* file specified for savinging could not be created */    final static int    STATUS_FILE_CREATE_ERROR = 3;    /* file read error */    final static int    STATUS_READ_ERROR        = 4;    /* file write error */    final static int    STATUS_WRITE_ERROR       = 5;    /* input file improperly constructed error */    final static int    STATUS_BAD_INPUT_FILE    = 6;        /* input file improperly constructed error */    final static int    STATUS_NO_ACTIVABLE_TRANSITION	 = 7;    /* maximum number of places */    final static int    PLACES = 10;    /* maximum number of transitions */    final static int    TRANSITIONS = 10;    /*        code characters used to mark the file as created by this program    */    final static int    CODE1 = (int) 'T';    final static int    CODE2 = (int) 'P';    final static int    CODE3 = (int) 'N';    final static int    CODE4 = (int) 'S';    /*        codes characters used to delimit fields in the files    */    /* beginning of place data */    final static int    BOP = 0x7D;    /* beginning of transition data */    final static int    BOT = 0x7E;    /* end of net data (end of file) */    final static int    EON = 0x7F;    /*        INSTANCE VARIABLES    */    /* array of place objects */    private Place       places [];    /* number of places currently present */    private int         numPlaces;    /* array of transition objects */    private Transition	transitions [];    /* number of transitions currently present */    private int         numTransitions;    /* place we are currently removing */    private Place       removingPlace;    /* transition we are currently removing */    private Transition  removingTransition;    /* Place of a new arc*/    private Place       newArcPlace;    /* Transition of a new arc*/    private Transition  newArcTransition;    /* Direction of a new arc and direction set flag */    public boolean	newArcToPlace;    public boolean	newArcDirectionSet;    /* Place being dragged */    private Place       dragPlace;    /* Transition being dragged */    private Transition  dragTransition;    /* Vector of activable transitions */        private Vector	activableTransitions;    /* Random number generator used to randomly select a transition */        private Random	wheelOfFortune;    /*        PUBLIC METHODS    */    /*        constructor method    */    PetriNet ()    {        /* initialize instance variables */        removingPlace = newArcPlace = dragPlace = (Place) null;        numPlaces = 0;        places = new Place [PLACES];        for (int i = 0; i < PLACES; i ++)            places [i] = (Place) null;        removingTransition = newArcTransition = dragTransition = (Transition) null;        numTransitions = 0;        transitions = new Transition [TRANSITIONS];        for (int i = 0; i < TRANSITIONS; i ++)            transitions [i] = (Transition) null;	activableTransitions = new Vector(TRANSITIONS);	wheelOfFortune = new Random();	newArcToPlace = false;	newArcDirectionSet = false;    } /* end PetriNet */    /*        these routines implements StateIdResolver interface. returns the state        corresponding to the specified id.    */    public Place resolvePlaceId (int id)    {        if (id < 0 || id >= PLACES)            return (Place) null;        return places [id];    } /* end resolvePlaceId */    public Transition resolveTransitionId (int id)    {        if (id < 0 || id >= TRANSITIONS)            return (Transition) null;        return transitions [id];    } /* end resolveTransitionId */    /*        display state machine on the specified graphics context.    */    public synchronized void paint (Graphics g, int offset)    {        /* if a place was marked for removal - call its remove method to delete           its image */        if (removingPlace != (Place) null)        {            removingPlace . remove (g);            removingPlace = (Place) null;        }        /* if a transition was marked for removal - call its remove method to delete           its image */        if (removingTransition != (Transition) null)        {            removingTransition . remove (g);            removingTransition = (Transition) null;        }        /* paint all existing places on the screen. notice that we traverse           the array in the reverse order, so that if places overlap on the           screen, the ones with the lowest ids will end up on top and will           correspond to the ones that get selected when user clicks on them */        for (int i = PLACES - 1; i >= 0; i --)            if (places [i] != (Place) null)                places [i] . paint (g);        /* paint all existing transitions on the screen. notice that we traverse           the array in the reverse order, so that if transitions overlap on the           screen, the ones with the lowest ids will end up on top and will           correspond to the ones that get selected when user clicks on them */        for (int i = TRANSITIONS - 1; i >= 0; i --)            if (transitions [i] != (Transition) null)                transitions [i] . paint (g);    } /* end paint */    /*        add a new place at specified coordinates.    */    public boolean addPlace (int x, int y)    {        /* if maximum number of places already exists - exit */        if (numPlaces == PLACES)            return false;        numPlaces ++;        int i;        /* look for the first empty slot in the places array */        for (i = 0; i < PLACES; i ++)            if (places [i] == (Place) null)                break;        /* create new place */        places [i] = new Place (i, x, y);        return true;    } /* end addPlace */    /*        add a new place at specified coordinates.    */    public boolean addTransition (int x, int y)    {        /* if maximum number of transitions already exists - exit */        if (numTransitions == TRANSITIONS)            return false;        numTransitions ++;        int i;        /* look for the first empty slot in the transitions array */        for (i = 0; i < TRANSITIONS; i ++)            if (transitions [i] == (Transition) null)                break;        /* create new transition */        transitions [i] = new Transition (i, x, y);        return true;    } /* end addTransition */    /*        remove place at specified coordinates. if more than one place exist        at that location, the one with the lowest id will be removed.    */    public boolean removePlace (int x, int y)    {        /* make sure we have something to remove */        if (numPlaces == 0)            return false;        numPlaces --;        int i;        /* find the first place that acknowledges that the point lays inside           of its space */        for (i = 0; i < PLACES; i ++)            if (places [i] != (Place) null && places [i] . inside (x, y))                break;        if (i == PLACES)            return false;        /* we cannot completely get rid of it yet, as we will have to remove           the places drawings. this will be done at the next call to paint,           so just set the removingPlace to places object. */        removingPlace = places [i];        /* Invalidate the place. invalidation is needed to remove the arcs           whose destination this place is. place knows only of arcs           starting with it, but it cannot invalidate the ones ending at it.           arcs will check if their traget state is valid during update           calls and invalidate themselves if necessary. */        removingPlace . makeInvalid ();        places [i] = (Place) null;        return true;    } /* end removePlace */    /*        remove transition at specified coordinates. if more than one transition exist        at that location, the one with the lowest id will be removed.    */    public boolean removeTransition (int x, int y)    {        /* make sure we have something to remove */        if (numTransitions == 0)            return false;        numTransitions --;        int i;        /* find the first transition that acknowledges that the point lays inside           of its space */        for (i = 0; i < TRANSITIONS; i ++)            if (transitions [i] != (Transition) null && transitions [i] . inside (x, y))                break;        if (i == TRANSITIONS)            return false;        /* we cannot completely get rid of it yet, as we will have to remove           the transitions drawings. this will be done at the next call to paint,           so just set the removingTransition to transitions object. */        removingTransition = transitions [i];        /* Invalidate the transition. invalidation is needed to remove the arcs           whose destination this transition is. transition knows only of arcs           starting with it, but it cannot invalidate the ones ending at it.           arcs will check if their traget state is valid during update           calls and invalidate themselves if necessary. */        removingTransition . makeInvalid ();        transitions [i] = (Transition) null;        return true;    } /* end removeTransition */    /*        add token to place at specified coordinates. if more than one place exist        at that location, the one with the lowest id will have the token.    */    public boolean addTokenToPlaceAt (int x, int y)    {        int i;        /* find the first place that acknowledges that the point lays inside           of its space */        for (i = 0; i < PLACES; i ++)            if (places [i] != (Place) null && places [i] . inside (x, y))                break;        if (i == PLACES)            return false;        /* add a token to the found place */        places [i] . addToken();        return true;    } /* end addTokenToPlaceAt */    /*        add token to place at specified coordinates. if more than one place exist        at that location, the one with the lowest id will have the token.    */    public boolean removeTokenFromPlaceAt (int x, int y)    {        int i;        /* find the first place that acknowledges that the point lays inside           of its space */        for (i = 0; i < PLACES; i ++)            if (places [i] != (Place) null && places [i] . inside (x, y))                break;        if (i == PLACES)            return false;        /* remove a token from the found place returns false if no token in that place*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精一区二区三区| 日本丶国产丶欧美色综合| 岛国av在线一区| 日本精品视频一区二区三区| 91精品国产麻豆国产自产在线| 日本一区二区三区在线观看| 丝袜美腿一区二区三区| caoporm超碰国产精品| 日韩视频一区二区| 亚洲综合久久久久| 99久久国产综合精品色伊| 久久亚洲精品国产精品紫薇| 午夜精品久久久久久| va亚洲va日韩不卡在线观看| 久久在线观看免费| 午夜视频一区二区| 色丁香久综合在线久综合在线观看| 亚洲精品在线观看网站| 五月婷婷色综合| 在线影视一区二区三区| 亚洲同性同志一二三专区| 国产美女久久久久| 2欧美一区二区三区在线观看视频| 亚洲成人动漫一区| 一本一本大道香蕉久在线精品| 国产视频在线观看一区二区三区| 日韩—二三区免费观看av| 欧美三级午夜理伦三级中视频| 成人欧美一区二区三区在线播放| 国产福利一区二区三区| 国产亚洲成年网址在线观看| 欧美aⅴ一区二区三区视频| 在线精品视频一区二区三四| 亚洲免费观看在线视频| av日韩在线网站| 亚洲婷婷在线视频| 一本久久综合亚洲鲁鲁五月天 | 中文字幕五月欧美| 成人激情av网| 国产精品久久久99| 色综合久久99| 日韩av二区在线播放| 91精品国产综合久久香蕉的特点 | 欧美日韩三级一区| 日韩在线一区二区| 91精品国产综合久久久蜜臀粉嫩| 日韩激情视频在线观看| 日韩一级大片在线| 国产盗摄精品一区二区三区在线 | 亚洲国产日日夜夜| 欧美日本在线一区| 久久99精品久久只有精品| 欧美韩国日本一区| 91视频一区二区| 亚洲va韩国va欧美va精品| 精品区一区二区| av动漫一区二区| 日韩福利视频导航| 中文字幕+乱码+中文字幕一区| 色噜噜狠狠成人网p站| 丝袜诱惑亚洲看片| 国产精品每日更新| 5858s免费视频成人| 国产伦精品一区二区三区视频青涩| 国产精品美日韩| 欧美日韩精品欧美日韩精品| 国产精品一品二品| 亚洲午夜免费电影| 国产色综合一区| 欧美视频在线一区二区三区 | 久久久国产精品麻豆| 一本高清dvd不卡在线观看| 婷婷丁香激情综合| 亚洲欧美在线高清| 久久综合久久综合九色| 91久久精品一区二区三| 久久精品99国产精品日本| 最近中文字幕一区二区三区| 欧美α欧美αv大片| 91在线观看美女| 国产精品一卡二| 石原莉奈一区二区三区在线观看| 国产日韩精品视频一区| 777色狠狠一区二区三区| 99热在这里有精品免费| 韩国av一区二区三区四区 | 91在线观看污| 美腿丝袜亚洲综合| 亚洲一区在线播放| 一区二区中文字幕在线| 久久久欧美精品sm网站| 欧美一区二区三区色| 欧美在线观看一二区| 成人精品电影在线观看| 狠狠狠色丁香婷婷综合激情| 五月综合激情网| 亚洲福利视频一区| 国产精品福利一区二区三区| 亚洲精品在线免费播放| 精品入口麻豆88视频| 欧美巨大另类极品videosbest | 大尺度一区二区| 九九久久精品视频| 日韩国产欧美在线观看| 亚洲国产一二三| 亚洲国产精品精华液网站| 亚洲欧美色综合| 亚洲摸摸操操av| 中文字幕在线一区二区三区| wwww国产精品欧美| 精品国产乱码久久| 精品少妇一区二区三区| 欧美大片在线观看一区| 欧美一级午夜免费电影| 3d动漫精品啪啪| 日韩精品一区二区三区视频在线观看| 欧美日韩一级视频| 欧美视频第二页| 欧美日韩精品一二三区| 欧美日韩高清不卡| 日韩三级在线观看| 精品久久久久av影院| 久久午夜电影网| 国产精品免费视频一区| 《视频一区视频二区| 亚洲黄色片在线观看| 亚洲自拍另类综合| 久久国内精品自在自线400部| 免费成人你懂的| 国产精品影视在线观看| 99精品偷自拍| 欧美专区在线观看一区| 制服.丝袜.亚洲.中文.综合| 亚洲精品一区二区三区影院| 欧美韩国日本一区| 亚洲成a人片综合在线| 日本伊人午夜精品| 国产成人精品免费一区二区| 91蜜桃在线免费视频| 日韩一区二区免费电影| 国产欧美日韩精品一区| 亚洲精品老司机| 男女男精品网站| 大陆成人av片| 337p亚洲精品色噜噜噜| 中文天堂在线一区| 天天操天天综合网| 成人精品视频.| 欧美高清激情brazzers| 久久久国际精品| 曰韩精品一区二区| 国内久久精品视频| 色婷婷综合久色| 欧美va亚洲va| 一区二区免费视频| 国产成人av电影在线播放| 欧美日韩精品是欧美日韩精品| 久久久久久97三级| 亚洲成av人在线观看| 国产黄色91视频| 欧美日本一区二区三区四区| 国产蜜臀97一区二区三区| 日韩在线卡一卡二| 91国内精品野花午夜精品| 久久精品在线免费观看| 日日夜夜精品视频天天综合网| 成人h版在线观看| 精品国产乱码久久久久久图片 | 韩国av一区二区三区| 欧美日韩亚洲高清一区二区| 国产日韩欧美精品电影三级在线| 日韩在线一二三区| 欧美亚洲尤物久久| 亚洲欧洲国产日本综合| 国产精品一区二区三区乱码| 欧美精品久久久久久久久老牛影院| 亚洲国产精品成人综合色在线婷婷 | 国产日韩欧美制服另类| 日韩av一级电影| 日本道免费精品一区二区三区| 亚洲国产精品二十页| 国产毛片精品视频| 日韩视频一区二区三区| 日韩精品欧美精品| 欧美日韩精品系列| 亚洲国产精品久久久久婷婷884| av电影一区二区| 中文字幕在线不卡视频| 丁香婷婷综合五月| 久久精品亚洲麻豆av一区二区| 久久精品72免费观看| 欧美成人国产一区二区| 视频一区二区三区中文字幕| 制服丝袜亚洲网站| 日本免费新一区视频| 91精品婷婷国产综合久久竹菊| 手机精品视频在线观看| 欧美日韩国产大片| 天堂av在线一区| 欧美一级一区二区|