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

📄 bigparticle.java

📁 MASON代表多主体邻里或网络仿真(Multi-Agent Simulator of Neighborhoods or Networks)。它是乔治梅森大学用Java开发的离散事件多主体仿真核心库
💻 JAVA
字号:
package sim.app.tutorial4;import sim.engine.*;import sim.util.*;/** A bouncing particle that cannot be randomized */public class BigParticle extends Particle implements Proxiable    {    // we can't "turn off" setRandomize by making it protected or whatnot.    // but we can tell SimpleProperties to use a proxy of our invention    // rather than querying us directly.  The proxy class MUST be public;    // and if it's to be used in our model, it must be Serializable.    // Also remember that if it's a non-static inner class, and we care    // about cross-platform serialization, it needs to have a serialversionUID,    // as well as its inclosing class!    public class MyProxy implements java.io.Serializable        {        public int getXDir() { return xdir; }        public int getYDir() { return ydir; }        // because we are a non-static inner class        static final long serialVersionUID = -2815745192429358605L;        }            // because we contain a non-static inner class    static final long serialVersionUID = 7720089824883511682L;    public Object propertiesProxy()        {        return new MyProxy();        }     public BigParticle(int xdir, int ydir) { super(xdir,ydir); }    public void step(SimState state)        {        // hard-code me to be non-randomized        randomize = false;        super.step(state);        }    }

⌨️ 快捷键说明

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