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

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

?? network.java

?? MASON代表多主體鄰里或網絡仿真(Multi-Agent Simulator of Neighborhoods or Networks)。它是喬治梅森大學用Java開發的離散事件多主體仿真核心庫
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
//    /** Same as <code>getMultigraphAdjacencyMatrix</code>, but it makes two passes //     * through the graph://     * 1. it counts the edges between every node, so it can allocate the right size of arrays//     * 2. it fills the arrays.//     * //     * This replaces the "array copy"s with a bunch of hash-table look-ups//     * //     * @see getMultigraphAdjacencyMatrix//     */ //    public Edge[][][] getMultigraphAdjacencyMatrix_II()//        {//        final int n = allNodes.numObjs;//        final Edge[][][] matrix = new Edge[n][n][]; //I assume it filled with nulls?//        int[][] counts = new int[n][n];////        //phase 1: counting//        for(int x=0;x<n;x++)//            {//            int[] counts_x = counts[x];//            Object sourceNode = allNodes.objs[x]; //            final Bag edges =  getEdgesOut(sourceNode);//                                                        //            for(int i=0;i<edges.numObjs;i++)//                counts_x[((IndexOutIn)indexOutInHash.get(((Edge)edges.objs[i]).getOtherNode(sourceNode))).index]++;//            }//                                //        //phase 2: memory allocation//        for(int x=0;x<n;x++)//            {//            int[] counts_x = counts[x];//            Edge[][] edges_x = matrix[x];//            for(int y=0;y<n;y++)//                {//                int count_xy= counts_x[y];//                edges_x[y]=(count_xy==0)? emptyEdgeArray: new Edge[count_xy];//                }//            }//                //        //phase 3: copy the data//        for(int x=0;x<n;x++)//            {//            int[] counts_x = counts[x];//            Edge[][] edges_x = matrix[x];//            Object fromNode =  allNodes.objs[x];//            final Bag edges =  getEdgesOut(fromNode);//                                                        //            for(int i=0;i<edges.numObjs;i++)//                {//                Edge e = (Edge)edges.objs[i];//                int y = ((IndexOutIn)indexOutInHash.get(e.getOtherNode(fromNode))).index;//                edges_x[y][--counts_x[y]]=e;//                }//            }//                                //        return matrix;//        }    /** Get all edges that leave a node.  Do NOT modify this Bag -- it is used internally. */    // this bizarre construction puts us just at 32 bytes so we can be inlined    public Bag getEdgesOut( final Object node )        {        IndexOutIn ioi = (IndexOutIn)(indexOutInHash.get(node));        Bag b;        if (ioi==null || (b=ioi.out)==null) return emptyBag;        return b;        }    /** Get all edges that enter a node.  Do NOT modify this Bag -- it is used internally. */    // this bizarre construction puts us just at 32 bytes so we can be inlined    public Bag getEdgesIn( final Object node )        {        IndexOutIn ioi = (IndexOutIn)(indexOutInHash.get(node));        Bag b;        if (ioi==null || (b=ioi.in)==null) return emptyBag;        return b;        }        /** Get all the edges that enter or leave a node.  If a Bag is provided, it will be cleared, then filled and returned.        Else a Bag will be constructed and returned.  If the graph is undirected, then edgesIn and edgesOut should        be the same thing, and so this is roughly equivalent to bag.addAll(getEdgesIn(node));  If the graph is        directed, then both the edgesIn AND the edgesOut are added to the Bag.  Generally speaking you should        try to use the more efficient getEdgesIn(...) and getEdgesOut(...) methods instead if you can.    */    public Bag getEdges( final Object node, Bag bag )        {        if( !directed )            {            if ( bag == null) bag = new Bag();            else bag.clear();                                    IndexOutIn ioi = (IndexOutIn)(indexOutInHash.get(node));            if (ioi==null) return bag;            if (ioi.in!=null && ioi.in.numObjs>0) bag.addAll(ioi.in);            //if (ioi.out!=null && ioi.in!=ioi.out && ioi.out.numObjs>0) bag.addAll(ioi.out);            return bag;            }        else            {            if ( bag == null) bag = new Bag();            else bag.clear();                                    IndexOutIn ioi = (IndexOutIn)(indexOutInHash.get(node));            if (ioi==null) return bag;            if (ioi.in!=null && ioi.in.numObjs>0) bag.addAll(ioi.in);            if (ioi.out!=null && ioi.out.numObjs>0) bag.addAll(ioi.out);            return bag;            }        }            /** Add a node */    public void addNode( final Object node )        {        if( indexOutInHash.get( node ) != null ) // if the object already exists            return;        allNodes.add( node );        IndexOutIn ioih = new IndexOutIn( allNodes.numObjs-1, null, null );        indexOutInHash.put( node, ioih );        }    /** Add an edge, storing info as the edge's associated information object.         If you add an edge, and its nodes have not been added yet, they will        automatically be added as well. */    public void addEdge( final Object from, final Object to, final Object info )        {        addEdge( new Edge( from, to, info ) );        }    /** Add an edge. If you add an edge, and its nodes have not been added yet, they will        automatically be added as well. Throws an exception if the edge is null or if it's        already added to a Field (including this one).     */    public void addEdge( final Edge edge )        {        if (edge==null)             throw new RuntimeException("Attempted to add a null Edge.");                    // assert ownership        if (edge.owner!=null)            throw new RuntimeException("Attempted to add an Edge already added elsewhere");        edge.owner = this;            edge.indexFrom = 0;        edge.indexTo = 0;        IndexOutIn outNode = (IndexOutIn)(indexOutInHash.get(edge.from));        if( outNode==null)            {            addNode( edge.from );            outNode = (IndexOutIn)(indexOutInHash.get(edge.from));            }        if( outNode.out == null )            {            if(directed)                outNode.out = new Bag();            else                {                if(outNode.in!=null)                    outNode.out = outNode.in;                else                    outNode.out = outNode.in = new Bag();                }            }        outNode.out.add( edge );        edge.indexFrom = outNode.out.numObjs-1;        IndexOutIn inNode = (IndexOutIn)(indexOutInHash.get(edge.to));        if( inNode==null)            {            addNode( edge.to );            inNode = (IndexOutIn)(indexOutInHash.get(edge.to));            }        if( inNode.in == null )            {            if(directed)                inNode.in = new Bag();            else                {                if(inNode.out!=null)                    inNode.in = inNode.out;                else                    inNode.in = inNode.out = new Bag();                }            }        inNode.in.add( edge );        edge.indexTo = inNode.in.numObjs-1;        }    /** Removes an edge and returns it.  The edge will still retain its info, to, and from fields, so you can        add it again with addEdge.   Returns null if the edge is null or if there is no such         edge added to the field.      */    public Edge removeEdge( final Edge edge )        {        if( edge == null )            return null;                // remove ownership        if (edge.owner != this)            return null;        edge.owner = null;                // remove the edge out the "out" node's "out" bag        final Bag outNodeBag = ((IndexOutIn)(indexOutInHash.get(edge.from))).out;        outNodeBag.remove( edge.indexFrom );        if( outNodeBag.numObjs > edge.indexFrom )            ((Edge)(outNodeBag.objs[edge.indexFrom])).indexFrom = edge.indexFrom;        // remove the edge out the "in" node's "in" bag        final Bag inNodeBag = ((IndexOutIn)(indexOutInHash.get(edge.to))).in;        inNodeBag.remove( edge.indexTo );        if( inNodeBag.numObjs > edge.indexTo )            ((Edge)(inNodeBag.objs[edge.indexTo])).indexTo = edge.indexTo;        // return the edge        return edge;        }    /** Removes a node, deleting all incoming and outgoing edges from the Field as well.  Returns the node,        or null if there is no such node in the field.     */    public Object removeNode( final Object node )        {        IndexOutIn ioi = (IndexOutIn)(indexOutInHash.get(node));        if (ioi == null) return null;        // remove all edges coming in the node        while( ioi.out != null && ioi.out.numObjs > 0 )            {            removeEdge( (Edge)(ioi.out.objs[0]) );            }        // remove all edges leaving the node        while( ioi.in != null && ioi.in.numObjs > 0 )            {            removeEdge( (Edge)(ioi.in.objs[0]) );            }        // remove the node        allNodes.remove(ioi.index);        if (allNodes.numObjs > ioi.index)    // update the index of the guy who just got moved            ((IndexOutIn)(indexOutInHash.get(allNodes.objs[ioi.index]))).index = ioi.index;        // return the edge        return node;        }    /** Removes all nodes, deleting all edges from the Field as well.  Returns the nodes as a Bag, which you        are free to modify as it's no longer used internally by the Network. */    public Bag clear()        {        indexOutInHash = new HashMap();        Bag retval = allNodes;        allNodes = new Bag();        return retval;        }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人黄色一级视频| 国产伦精品一区二区三区免费迷| av在线不卡观看免费观看| 日本一区二区免费在线| av电影在线观看不卡| 亚洲摸摸操操av| 欧美日韩一区三区| 日本系列欧美系列| 久久久精品蜜桃| av在线不卡观看免费观看| 亚洲黄色性网站| 欧美日韩国产成人在线免费| 欧美aaa在线| 国产精品卡一卡二| 欧美综合一区二区三区| 青青草国产成人av片免费| 久久影院午夜片一区| 91麻豆精品秘密| 日韩av中文在线观看| 国产网站一区二区| 色婷婷综合久久久中文字幕| 日本免费新一区视频| 国产日韩精品一区| 在线观看视频一区| 国产一区二区三区四区在线观看| 国产精品污网站| 91精品国产欧美一区二区18| 国产精品 欧美精品| 一区二区三区中文字幕电影 | 日本一区二区免费在线| 色天天综合色天天久久| 麻豆久久久久久| 亚洲视频你懂的| 日韩视频免费观看高清完整版| 粗大黑人巨茎大战欧美成人| 亚洲福利视频三区| 欧美国产日韩亚洲一区| 69精品人人人人| 91丝袜高跟美女视频| 国产一区不卡在线| 日韩主播视频在线| 玉米视频成人免费看| 久久亚洲精品小早川怜子| 欧美色图12p| 99国产精品久久久久久久久久久| 日韩黄色小视频| 一区二区三区日韩欧美精品| 久久久久久久久久久久久夜| 欧美军同video69gay| 色婷婷综合中文久久一本| 国产成人高清视频| 日韩和欧美一区二区三区| 日韩一区中文字幕| 国产清纯美女被跳蛋高潮一区二区久久w | 日韩午夜精品电影| 欧美日韩免费高清一区色橹橹| 岛国av在线一区| 久久精品国产亚洲5555| 亚洲1区2区3区4区| 亚洲一区二区欧美激情| 亚洲婷婷在线视频| 国产精品久久免费看| 国产亚洲欧洲一区高清在线观看| 911精品国产一区二区在线| 欧美性一二三区| 在线免费亚洲电影| 91女神在线视频| 91亚洲午夜精品久久久久久| www.欧美.com| 成人一区在线看| 成人小视频免费在线观看| 国产精品99久久久| 国产精品一区二区你懂的| 美国三级日本三级久久99| 天天综合网天天综合色| 亚洲高清在线视频| 日韩精品欧美精品| 另类人妖一区二区av| 麻豆精品一二三| 极品尤物av久久免费看| 久久se这里有精品| 国产成人亚洲精品狼色在线| 福利电影一区二区三区| 国产成人免费视频网站高清观看视频 | 欧美一区二区三区在线电影| 欧美一区二区网站| 日韩欧美一级在线播放| 精品免费视频一区二区| 精品91自产拍在线观看一区| 欧美精品一区二区不卡| 国产日产欧美一区二区视频| 国产精品久久久久久久久图文区 | 欧美一区二区网站| 欧美videos中文字幕| 国产偷国产偷亚洲高清人白洁| 中文字幕二三区不卡| 一级日本不卡的影视| 天天亚洲美女在线视频| 精品综合久久久久久8888| 国产精品2024| 一本久久a久久精品亚洲| 欧美视频一区在线观看| 精品国精品国产尤物美女| 欧美极品xxx| 亚洲国产欧美在线| 免费在线视频一区| 福利一区二区在线| 欧美三电影在线| 欧美tickling挠脚心丨vk| 国产精品久线在线观看| 亚洲成人免费视| 国产一区二区伦理| 色丁香久综合在线久综合在线观看| 欧美图区在线视频| 久久久久久久久久久久久女国产乱 | 色婷婷综合久久久久中文一区二区| 欧美卡1卡2卡| 亚洲欧洲一区二区在线播放| 亚洲高清在线精品| 丁香婷婷综合网| 欧美精品日韩一本| 亚洲欧洲色图综合| 美日韩一区二区三区| 99九九99九九九视频精品| 日韩免费高清电影| 又紧又大又爽精品一区二区| 国产综合成人久久大片91| 色综合一区二区| 2020日本不卡一区二区视频| 亚洲高清免费视频| www.欧美精品一二区| 精品日韩99亚洲| 偷拍与自拍一区| 91蝌蚪porny九色| 国产喂奶挤奶一区二区三区| 轻轻草成人在线| 欧美在线一区二区三区| 久久婷婷久久一区二区三区| 亚洲一级不卡视频| 成人av影视在线观看| 日韩美女一区二区三区四区| 亚洲综合成人在线视频| 成人免费av网站| 久久综合国产精品| 全国精品久久少妇| 91黄色免费看| 亚洲另类中文字| 99久久久久免费精品国产 | 激情综合色播五月| 欧美精品777| 亚洲一区二区三区四区五区中文| 成人福利视频网站| 国产清纯在线一区二区www| 国产做a爰片久久毛片| 欧美一区二区三区播放老司机| 一级女性全黄久久生活片免费| 91在线无精精品入口| 欧美激情中文字幕一区二区| 国产麻豆视频一区二区| 久久综合久久综合九色| 国产主播一区二区三区| 日韩欧美卡一卡二| 美腿丝袜亚洲三区| 精品日韩一区二区| 国产乱子伦一区二区三区国色天香| 精品久久久久久久久久久院品网| 麻豆视频观看网址久久| 日韩三级伦理片妻子的秘密按摩| 秋霞电影网一区二区| 日韩视频中午一区| 久草热8精品视频在线观看| 欧美电影免费观看高清完整版在 | 亚洲图片你懂的| 99久久久国产精品| 亚洲欧美日韩一区| 色欧美日韩亚洲| 亚洲国产乱码最新视频| 欧美日韩免费在线视频| 亚洲高清视频中文字幕| 91麻豆精品国产91久久久久久| 日韩国产精品久久久久久亚洲| 日韩一级二级三级| 国产曰批免费观看久久久| 国产欧美日韩卡一| 99久久精品免费精品国产| 亚洲日本丝袜连裤袜办公室| 日本高清无吗v一区| 日韩专区欧美专区| 久久久久国产精品麻豆ai换脸| www.av亚洲| 亚洲国产精品久久不卡毛片| 日韩精品一区二区三区四区| 国产精品资源在线| 曰韩精品一区二区| 日韩一区二区在线观看| 福利视频网站一区二区三区| 一区二区三区不卡视频| 精品久久久久久久久久久久包黑料 | 天堂午夜影视日韩欧美一区二区| 91精品一区二区三区在线观看|