⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spatialnetwork3d.java

📁 MASON代表多主体邻里或网络仿真(Multi-Agent Simulator of Neighborhoods or Networks)。它是乔治梅森大学用Java开发的离散事件多主体仿真核心库
💻 JAVA
字号:
package sim.portrayal3d.network;import sim.field.grid.*;import sim.field.continuous.*;import sim.field.network.*;import sim.util.*;/** A wrapper used by NetworkPortrayal3D to hold a Network and EITHER a Continuous3D OR a SparseGrid3D.    The Continuous3D/SparseGrid3D specifies the spatial location of the nodes; the Network specifies the    edges connecting those nodes. */public class SpatialNetwork3D    {    public Continuous3D field;    public SparseGrid3D grid;    public Network network;    public SpatialNetwork3D( final Continuous3D field, final Network network )        {        this.field = field;        this.network = network;        }        public SpatialNetwork3D( final SparseGrid3D grid, final Network network )        {        this.grid = grid;        this.network = network;        }    public Double3D getObjectLocation(Object node)        {        if (field!=null) return field.getObjectLocation(node);        else return new Double3D(grid.getObjectLocation(node));        }    public double getWidth()        {        if (field!=null) return field.getWidth();        else return grid.getWidth();        }            public double getHeight()        {        if (field!=null) return field.getHeight();        else return grid.getHeight();        }    public double getLength()         {        if (field!=null) return field.getLength();         else return grid.getLength();        }    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -