package NetLayout; import java.util.*; // for StringTokenizer and Vector import java.io.*; import java.awt.Point; public class Net { final static int CLIENT = 1; final static int SERVER = 2; final static int CACHE = 3; final static int DNS = 4; final static int LBA = 5; final static int ROUTER = 6; final static int SWITCH = 7; final static int NoOfNodeTypes = 7; final static int PTPLINK = 8; final static int MALINK = 9; final static int CABLE = 10; final static int NoOfObjects = 10; final static int NOTFOUND = -2; final static int NOTDEFINED = -1; String name = "net1"; NetLayoutFrame f; int[] objNo = new int[NoOfObjects+1]; int objID = 0; Vector nodes = new Vector(10, 10); Vector routers = new Vector(10, 10); Vector switches = new Vector(10, 10); Vector links = new Vector(10, 10); Vector malinks = new Vector(10, 10); ComponentDelayList cdl = new ComponentDelayList(this); int[][] pred; int[][] dist; int[][] sp_dist; EventList el; EventRecord er; double msgProcessingTime = 0.0001; // for power=1 unit 0.1msec, related to msgheader double retrieveSpeed = 1.0E+6; // 1MBps file retrieval double msgProcessingSpeed = 1.0E+6; // 1MBps for power=1 unit, relate to msgSize double signalPropagationSpeed = 2.0E+8; // use fiber propagation speed here int reqID = 0; double totalEndToEndRespTime = 0; int noOfFinishedRequests = 0; int noOfDocs = 1000000; // use for generate doc index at client site DataOutputStream debugOS; PrintWriter logPW; boolean debug = false; boolean verbose = false; public boolean animationOn = true; public int animationMaxSteps = 20; // thing to adjust in animation speed // here we divide propagation deley with this public Net() { } public Net(NetLayoutFrame frame, String name) { f=frame; this.name = name; } public void addComponentDelay(int id) { cdl.addComponentDelay(id); } public void addComponentDelayList(ComponentDelayList list) { // accumulate delay on each network component from the list // add ranking to give each session a fair contribution for (int j=0; j sp_dist[i][k]+sp_dist[k][j]) { sp_dist[i][j] = sp_dist[i][k]+sp_dist[k][j]; pred[i][j] = pred[k][j]; } } for (int i=0; i