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

📄 entity1.java

📁 //folowed for shotest path algorithm
💻 JAVA
字号:
public class Entity1 extends Entity{        // Perform any necessary initialization in the constructor    public Entity1()    {    }        // Handle updates when a packet is received.  Students will need to call    // NetworkSimulator.toLayer2() with new packets based upon what they    // send to update.  Be careful to construct the source and destination of    // the packet correctly.  Read the warning in NetworkSimulator.java for more    // details.    public void update(Packet p)    {    }        public void linkCostChangeHandler(int whichLink, int newCost)    {    }        public void printDT()    {        System.out.println();        System.out.println("         via");        System.out.println(" D1 |   0   2");        System.out.println("----+--------");        for (int i = 0; i < NetworkSimulator.NUMENTITIES; i++)        {            if (i == 1)            {                continue;            }                        System.out.print("   " + i + "|");            for (int j = 0; j < NetworkSimulator.NUMENTITIES; j += 2)            {                            if (distanceTable[i][j] < 10)                {                        System.out.print("   ");                }                else if (distanceTable[i][j] < 100)                {                    System.out.print("  ");                }                else                 {                    System.out.print(" ");                }                                System.out.print(distanceTable[i][j]);            }            System.out.println();        }    }}

⌨️ 快捷键说明

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