package multipath; import java.util.*; import multipath.*; public class Server extends Node{ public int serverNum;//Server id public double speed;//Server speed public Node fatherNode;//father node of the server public Server() { } public Server(int serverNump, double serverSpeedp) { serverNum=serverNump; speed=serverSpeedp; nodeNum=serverNum; isServer=true; } //calc the fatherNode for all servers by searching the path public static void calcFatherNode(){ for(int sid=1;sid<=Multipath.maxServer;sid++){ for(int pid=1;pid<=Multipath.maxPath;pid++){ if(((Node)Multipath.servers[sid]).isEqual(Multipath.pathes[pid].startNode) &&(Multipath.pathes[pid].startNode.isServer))//node is server { Multipath.servers[sid].fatherNode=Multipath.pathes[pid].endNode; } } } } }