From: <aca...@us...> - 2008-07-22 09:39:42
|
Revision: 187 http://gridsim.svn.sourceforge.net/gridsim/?rev=187&view=rev Author: acaminero Date: 2008-07-22 09:39:48 +0000 (Tue, 22 Jul 2008) Log Message: ----------- Finite buffers extension Modified Paths: -------------- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbDroppedPacketInfo.java branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbEndToEndPath.java branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbNetPacket.java branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbOutput.java branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbSCFQScheduler.java branches/gridsim4.0-branch2/source/gridsim/net/fnb/RED.java branches/gridsim4.0-branch2/source/gridsim/net/fnb/firstLastPacketsGridlet.java Added Paths: ----------- branches/gridsim4.0-branch2/source/gridsim/net/fnb/Fnb_FileName_FileMyID.java branches/gridsim4.0-branch2/source/gridsim/net/fnb/Fnb_failed_gridlet_file.java Modified: branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbDroppedPacketInfo.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbDroppedPacketInfo.java 2008-07-14 05:43:43 UTC (rev 186) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbDroppedPacketInfo.java 2008-07-22 09:39:48 UTC (rev 187) @@ -23,8 +23,10 @@ private int userID; + // private String fileName; + /**Creates a new object of this class. This is used by FnbSCFQScheduler * @param g the gridlet id * @param u user id @@ -35,7 +37,21 @@ userID = u; } + /** Sets the filename. + * */ + /*public void setFilename(String f) + { + fileName = f; + }*/ + /** Gets the filename. + * @return the gridlet id. + * */ + /*public String getFilename() + { + return fileName; + }*/ + /** Gets the gridlet id. * @return the gridlet id. * */ Modified: branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbEndToEndPath.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbEndToEndPath.java 2008-07-14 05:43:43 UTC (rev 186) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbEndToEndPath.java 2008-07-22 09:39:48 UTC (rev 187) @@ -1,34 +1,43 @@ /* - * Title: GridSim Toolkit - * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation - * of Parallel and Distributed Systems such as Clusters and Grids - * Licence: GPL - http://www.gnu.org/copyleft/gpl.html - * + * Title: GridSim Toolkit + * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation + * of Parallel and Distributed Systems such as Clusters and Grids + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * $Id: FnbNetPacket.java,v 1.13 2008/05/09 05:56:31 agustin Exp $ - */ + */ package gridsim.net.fnb; - /** - * This class keeps some information which are common to all the packets of a gridlet. - * When a packet is dropped in a router, the router must inform the user/owner - * about this scenario. - * Since many packets from the same gridlet may get dropped, the router only sends - * one event for the whole process, not for each dropped packet. - * Thus, we put all of the common information (e.g. source and destination IDs) - * into this class. - * - * @since GridSim Toolkit 4.1 - * @author Agustin Caminero +/** + * This class keeps some information which are common to all the packets of a gridlet. + * When a packet is dropped in a router, the router must inform the user/owner + * about this scenario. + * Since many packets from the same gridlet may get dropped, the router only sends + * one event for the whole process, not for each dropped packet. + * Thus, we put all of the common information (e.g. source and destination IDs) + * into this class. + * + * @since GridSim Toolkit 4.1 + * @author Agustin Caminero */ public class FnbEndToEndPath { private int destID; private int srcID; private int classtype; - private int totalPkts; // total num of packet that belongs to a group - private int glID; // the id of the gridlet/file this packet belongs to, + private int totalPkts; // total num of packet that belongs to a group + private int glID; + // the id of the gridlet/file this packet belongs to, or GridSimTags.FNB_PKT_CONTAINS_FILE + // if the pkt contains a file + /*private String fileName; // the name of the file contained in this pkt. + //We have to use the file name since files may not have a id, if they've not been registered yet.*/ + + //private int fileMyID;// This is a temporary id for the file. This is necesary as files dont have + // id unteil they are registered. + + /**Creates a new object of this class. Tihs is used in the FnbOutput class. * @param destID destination id * @param sourceID source id @@ -36,32 +45,70 @@ * @param totalPkts total number of packets this connection is made of * @param glID the gridlet/file id * */ - public FnbEndToEndPath (int destID, int srcID, int classtype, int totalPkts, int glID) + public FnbEndToEndPath(int destID, int srcID, int classtype, int totalPkts, + int glID) { this.destID = destID; this.srcID = srcID; this.classtype = classtype; this.totalPkts = totalPkts; this.glID = glID; + //this.fileName = null; + //this.fileMyID = -1; } /**Creates a new object of this class. Tihs is used in the FnbOutput class. - * @param destID destination id - * @param sourceID source id - * @param classType network service level - * @param totalPkts total number of packets this connection is made of - * @param glID the gridlet id - * */ - public FnbEndToEndPath (int destID, int srcID, int classtype, int totalPkts) - { - this.destID = destID; - this.srcID = srcID; - this.classtype = classtype; - this.totalPkts = totalPkts; - this.glID = -1; - } + * @param destID destination id + * @param sourceID source id + * @param classType network service level + * @param totalPkts total number of packets this connection is made of + * @param glID the gridlet id + * */ + public FnbEndToEndPath(int destID, int srcID, int classtype, int totalPkts) + { + this.destID = destID; + this.srcID = srcID; + this.classtype = classtype; + this.totalPkts = totalPkts; + this.glID = -1; + //this.fileName = null; + //this.fileMyID = -1; + } + /** Sets the fileName for a connection, in the case it carries a file. + * @param d the destination id + * */ + /*public void setFileName(String f) + { + fileName = f; + }*/ + + /** Returns the fileName for a connection, in the case it carries a file. + * @param d the destination id + * */ + /*public String getFileName() + { + return fileName; + }*/ + + /** Sets the file my_id. + * @param d the destination id + * */ + /*public void setFileMyID(int d) + { + fileMyID = d; + }*/ + + /** Returns the file my_id. + * @param d the destination id + * */ + /*public int getFileMyID() + { + return fileMyID; + }*/ + + /** Sets the destination id for a connection. * @param d the destination id * */ @@ -94,7 +141,7 @@ * */ public void setTotalPkts(int t) { - totalPkts = t; + totalPkts = t; } /** Gets the source id of a connection. @@ -115,7 +162,6 @@ } - /** Gets the classtype of a connection. * @return the classtype of the connection * */ @@ -125,7 +171,6 @@ } - /** Gets the total number of packets of a connection. * @return the total number of packets of the connection * */ Modified: branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbNetPacket.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbNetPacket.java 2008-07-14 05:43:43 UTC (rev 186) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbNetPacket.java 2008-07-22 09:39:48 UTC (rev 187) @@ -334,5 +334,6 @@ return conn.getObjectID(); } + } // end class Modified: branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbOutput.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbOutput.java 2008-07-14 05:43:43 UTC (rev 186) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbOutput.java 2008-07-22 09:39:48 UTC (rev 187) @@ -53,6 +53,8 @@ private ArrayList packetsGridletsList_; // list of firstLastPacketsGridlet objects // This list contains the first/last packets belonging to each gridlet + private ArrayList filesname_fileMyIDs_; // keep a list of Fnb_FileName_FileMyID objects + /** * Allocates a new Output object * @param name the name of this object @@ -83,6 +85,8 @@ hasStarted_ = false; packetsGridletsList_ = new ArrayList(); + filesname_fileMyIDs_ = new ArrayList(); + System.out.println(super.get_name()); } @@ -315,20 +319,20 @@ * */ public void processPacketDropped(Sim_event ev) { - FnbDroppedUserPacket userPkt = (FnbDroppedUserPacket) ev.get_data(); int pkt_dropped_id = userPkt.getPkt(); int user_id = userPkt.getUser(); - int glID = lookForGridlet(pkt_dropped_id); + Fnb_failed_gridlet_file fglf = lookForGridlet(pkt_dropped_id); + int glID = fglf.getEntityID(); - if (glID != 99) + if (glID != 9999) { // Tell the user that the gridlet is failed because of the dropping of a packet super.sim_schedule(user_id, GridSimTags.SCHEDULE_NOW, - GridSimTags.FNB_GRIDLET_FAILED_BECAUSE_PACKET_DROPPED, - new Integer(glID)); + GridSimTags.FNB_GRIDLET_FAILED_BECAUSE_PACKET_DROPPED, fglf); } + ev = null; // new, to call the garbage collector @@ -532,6 +536,7 @@ */ private synchronized void submitToLink(Sim_event ev) { + //Object[] packet = new Object[2]; IO_data data = (IO_data) ev.get_data(); Object obj = data.getData(); long size = data.getByteSize(); @@ -547,32 +552,100 @@ int glID = 9999; int fileID = 9999; firstLastPacketsGridlet packGl = new firstLastPacketsGridlet(); - FnbEndToEndPath conn; - if (obj instanceof Gridlet) - { - glID = ((Gridlet) obj).getGridletID(); - // Here we will keep the packets belonging to each gridlet + FnbEndToEndPath conn = null; + try{ - packGl.setFirst(pktID_); // the first packet of this gridlet - packGl.setGridletID(glID); + if (obj instanceof Gridlet) + { + glID = ((Gridlet) obj).getGridletID(); + // Here we will keep the packets belonging to each gridlet - conn = new FnbEndToEndPath(destId, super.get_id(), netServiceType, numPackets, glID); + packGl.setFirst(pktID_); // the first packet of this gridlet + packGl.setGridletID(glID); - } - /******* TODO: not yet done - else if (obj instanceof File) // For the datagrid extension + conn = new FnbEndToEndPath(destId, super.get_id(), + netServiceType, numPackets, glID); + + } + else if (obj instanceof DataGridlet) // For the datagrid extension + { + glID = ((DataGridlet) obj).getGridletID(); + + // Here we will keep the packets belonging to each gridlet + + packGl.setFirst(pktID_); // the first packet of this gridlet + packGl.setGridletID(glID); + + conn = new FnbEndToEndPath(destId, super.get_id(), + netServiceType, numPackets, glID); + + } + else if (obj instanceof Object[]) // For the datagrid extension (File) + { + + + String fileName = null; + + try + { + // Add master (from user to resource) + + fileName = ((File) ((Object[]) obj)[0]).getName(); + + }catch(Exception e) + { + + fileName = ((String) ((Object[]) obj)[0]); + + } + + + /* + int length = ((Object[])obj).length; + if (length == 2) + { + // Add master (from user to resource) + + fileName = ((File) ((Object[]) obj)[0]).getName(); + + }// if (length == 2) + else if (length == 3) + { + // Add master (from res to user) + fileName = ((String) ((Object[]) obj)[0]); + + }*/ + + glID = checkFilename(fileName); // get a id for the file + + packGl.setFirst(pktID_); // the first packet of this file + packGl.setGridletID(glID); // the name of the file + + packGl.setIsFile(true); + + + conn = new FnbEndToEndPath(destId, super.get_id(), + netServiceType, numPackets, glID); + //GridSimTags.FNB_PKT_CONTAINS_FILE); + + //System.out.println(super.get_name() + ": fileName: " + fileName); + + + + } + else + { + conn = new FnbEndToEndPath(destId, super.get_id(), + netServiceType, numPackets); + } + + }catch(Exception e) { - fileID = ((File) obj).getRegistrationID(); - System.out.println("FileID: " + fileID); - conn = new FnbEndToEndPath(destId, super.get_id(), netServiceType, numPackets, fileID); - } - ******/ - else - { - conn = new FnbEndToEndPath(destId, super.get_id(), netServiceType, numPackets); - } + System.out.println(super.get_name() + ":ERROR."); + e.printStackTrace(); + } // make dummy packets with null data convertIntoPacket(MTU, numPackets, tag, conn); @@ -590,14 +663,15 @@ super.get_id(), destId, netServiceType, numPackets, numPackets);*/ - if (obj instanceof Gridlet) + if ((obj instanceof Gridlet) || (obj instanceof DataGridlet) || + (obj instanceof Object[])) { packGl.setLast(pktID_); // the last packet of this gridlet packetsGridletsList_.add(packGl); // put this firstLastPacketsGridlet entity into the list /*System.out.println(">>>>>>>>>> "+super.get_name() + - ": submitting gl: " + glID + " .(First, last): (" + + ": submitting entity: " + glID + " .(First, last): (" + packGl.getFirst() + ", " + packGl.getLast() + ")");*/ } @@ -607,6 +681,59 @@ pktID_++; // increments packet ID } + /**Returns the my_id of the file. */ + int checkFilename(String fname) + { + Fnb_FileName_FileMyID fname_fid; + int last_fileID = 0; + for (int i =0; i< filesname_fileMyIDs_.size(); i++) + { + fname_fid = (Fnb_FileName_FileMyID) filesname_fileMyIDs_.get(i); + + last_fileID = fname_fid.getFileId(); + + if (fname_fid.getFileName().compareTo(fname) == 0) + { + return last_fileID; + } + } + + fname_fid = new Fnb_FileName_FileMyID(fname, last_fileID + 1); + + filesname_fileMyIDs_.add(fname_fid); + + + return last_fileID + 1; + } + + /**Returns the file name of the file with the given my_id*/ + String getFilename(int fileID) + { + Fnb_FileName_FileMyID fname_fid; + int last_fileID = 0; + + /*System.out.println(super.get_name() + ": getFilename(). fileID " + fileID + + ". filesname_fileMyIDs_.size() : " + + filesname_fileMyIDs_.size());*/ + + for (int i = 0; i < filesname_fileMyIDs_.size(); i++) + { + fname_fid = (Fnb_FileName_FileMyID) filesname_fileMyIDs_.get(i); + + last_fileID = fname_fid.getFileId(); + + //System.out.println(super.get_name() + ": last_fileID: " + last_fileID + ". filename: " + fname_fid.getFileName()); + + if (last_fileID == fileID) + { + return fname_fid.getFileName(); + } + } + + return null; + + } + /** * Creates many dummy or null packets * @param size packet size (in bytes) @@ -865,12 +992,13 @@ return packetsGridletsList_; } - /**This function returns the gridlet to which a packet belongs + /**This function returns the entity (gridlet/file) to which a packet belongs * @param pkt the ID of the packet of interest - * @return the gridlet ID + * @return a Fnb_failed_gridlet_file object, containing the entity (gridlet/file) ID, and if the entity is a file * */ - int lookForGridlet(int pktID) + Fnb_failed_gridlet_file lookForGridlet(int pktID) { + Fnb_failed_gridlet_file fglfile = new Fnb_failed_gridlet_file(9999, false); for (int i = 0; i < packetsGridletsList_.size(); i++) { firstLastPacketsGridlet flPktGl = (firstLastPacketsGridlet) @@ -878,11 +1006,21 @@ if ((flPktGl.getFirst() <= pktID) && (flPktGl.getLast() > pktID)) { - return flPktGl.getGridletID(); + fglfile.setEntityID(flPktGl.getGridletID()); + fglfile.setIsFile(flPktGl.getIsFile()); + + fglfile.setFilename(getFilename(fglfile.getEntityID())); + + /*System.out.println(super.get_name() + ": lookForGridlet: entiyID: " + + flPktGl.getGridletID() + ". isFile " + flPktGl.getIsFile() + + ". filename " + getFilename(fglfile.getEntityID()));*/ + + return fglfile; } } - return 99;// if there is no gridlet, return this + return fglfile;// if there is no gridlet, return this } + } // end class Modified: branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbSCFQScheduler.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbSCFQScheduler.java 2008-07-14 05:43:43 UTC (rev 186) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbSCFQScheduler.java 2008-07-22 09:39:48 UTC (rev 187) @@ -82,7 +82,8 @@ private int MAX_BUFF_SIZE_PK; //max number of packets that fit into a buffer private ArrayList droppedGl_user; - // in this array, we keep the list of glID_userID objects, showing the (gridlets, userID) already dropped in this scheduler. + // in this array, we keep the list of FnbDroppedPacketInfo objects, showing the (gridlets, userID) + // already dropped in this scheduler. // This way, we will only send a PACKET_DROPPED event for the first dropped packet of a gridlet. // This way, we will avoid a lot of events, thus saving memory. @@ -675,7 +676,13 @@ String dst_str; int glID; + //String filename; + /*System.out.println("\n" + super.get_name() + + ":(make) Size(): " + + size() + " pkts. Time: " + GridSim.clock());*/ + + for (int i = 0; i < size() ; i++) { pkt = (Packet) pktList.get(i); @@ -718,9 +725,9 @@ (dst_str.indexOf("RC") != -1))*/ - // if the src or the dest of the packet are in the whitelist, then try not to drop the packet - if ((GridSim.fnbWhiteList_.checkList(dst) == true) || - (GridSim.fnbWhiteList_.checkList(src_outputPort) == true)) + // if the src and the dest of the packet are not in the whitelist, then we can drop the pkt + if ((GridSim.fnbWhiteList_.checkList(dst) == false) && + (GridSim.fnbWhiteList_.checkList(src_outputPort) == false)) { // To remove a packet form this queue we have to do some stuff // I've copied this from the deque method @@ -888,6 +895,7 @@ } /**Checks if there is an existing gridletID_userID in the droppedGl_user array. + * We consider gridlets, datagridlets and files * @return true, if there is a gridletID_userID object, false otherwise */ public boolean checkDroppedGlList(int gl, int user) { @@ -895,8 +903,9 @@ FnbDroppedPacketInfo glID_uID; while (i < droppedGl_user.size()) { - glID_uID = (FnbDroppedPacketInfo)droppedGl_user.get(i); + glID_uID = (FnbDroppedPacketInfo) droppedGl_user.get(i); if ((glID_uID.getGlID() == gl) && (glID_uID.getUserID() == user)) + return true; else i++; Added: branches/gridsim4.0-branch2/source/gridsim/net/fnb/Fnb_FileName_FileMyID.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/Fnb_FileName_FileMyID.java (rev 0) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/Fnb_FileName_FileMyID.java 2008-07-22 09:39:48 UTC (rev 187) @@ -0,0 +1,26 @@ +package gridsim.net.fnb; + +public class Fnb_FileName_FileMyID +{ + // Since files don't have an id until they are registered, we need an id for them. + String filename; + int fileMyID; + + Fnb_FileName_FileMyID(String f, int fid) + { + filename = f; + fileMyID = fid; + + } + + + String getFileName() + { + return filename; + } + + int getFileId() + { + return fileMyID; + } +} Added: branches/gridsim4.0-branch2/source/gridsim/net/fnb/Fnb_failed_gridlet_file.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/Fnb_failed_gridlet_file.java (rev 0) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/Fnb_failed_gridlet_file.java 2008-07-22 09:39:48 UTC (rev 187) @@ -0,0 +1,51 @@ +package gridsim.net.fnb; + +public class Fnb_failed_gridlet_file +{ + int entityID; // the id of the gl or file + + boolean isFile; // true if this is a file, false otherwise + + String filename; + + public Fnb_failed_gridlet_file(int e, boolean f) + { + entityID = e; + isFile = f; + } + + public void setFilename(String f) + { + filename = f; + } + + public String getFilename() + { + return filename; + } + + + + + public void setEntityID(int i) + { + entityID = i; + } + + public void setIsFile(boolean f) + { + isFile = f; + } + + public int getEntityID() + { + return entityID; + } + + + public boolean getIsFile() + { + return isFile; + } + +} Modified: branches/gridsim4.0-branch2/source/gridsim/net/fnb/RED.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/RED.java 2008-07-14 05:43:43 UTC (rev 186) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/RED.java 2008-07-22 09:39:48 UTC (rev 187) @@ -99,6 +99,8 @@ MAX_P = max_p; QUEUE_WEIGHT = queue_weigth; + System.out.println(super.get_name() + ": RED. MIN_TH: " +MIN_TH +". MAX_TH: " +MAX_TH ); + initialize(); } @@ -117,6 +119,8 @@ double avgQueueSize = avgQueueSize(); + //System.out.println(super.get_name() + ": enque. MIN_TH: " +MIN_TH ); + if ((MIN_TH <= avgQueueSize) && (avgQueueSize < MAX_TH)) { // when the avgQueueSize is between the thrsholds, then calculate the dropping probability @@ -161,27 +165,8 @@ */ public void setThresholds() { + // This is empty, since thresholds are set by hand in the constructor - // The code below is also useds in setBaudRate(...) - double C = super.getBaudRate() / (Link.DEFAULT_MTU * 8); - // baudRate_is in bits per second, MTU is in bytes. ( (bits / sec) / (bits/pkt) ) - QUEUE_WEIGHT = 1 - Math.exp( -1 / C); - - double DELAY_TARGET = 0.005; // 5 milliseconds - double var = DELAY_TARGET * C / 2; - - if (5 > var) - { - MIN_TH = 5; - } - else - { - MIN_TH = var; - - } - - MAX_TH = 3 * MIN_TH; - } /** @@ -298,11 +283,11 @@ } } - /* - // If u want more info on the progress of sims, uncomment this. - System.out.println(super.get_name() + ": packet dropped. Src: " + + + // If u want more info on the progress of sims, uncomment this. + System.out.println(super.get_name() + ": packet dropped. Src: " + src_outputPort_str + ", Dst: " + dst_str + - ". Pkt num: " + ((FnbNetPacket) pnp).getPacketNum());*/ + ". Pkt num: " + ((FnbNetPacket) pnp).getPacketNum()); // If the packet is not a control packet, we will have to remove the packet, and // also, we will have to tell the user involved in the transmission about the dropping. @@ -343,6 +328,7 @@ int pktID; int tag; int glID; + //String filename= null; //int userID; if (pnp instanceof InfoPacket) { @@ -357,8 +343,7 @@ // check the user and the gl this packet belongs to glID = ((FnbNetPacket) pnp).getObjectID(); - - + //filename = ((FnbNetPacket) pnp).getFileName(); } if (tag != GridSimTags.JUNK_PKT) // && (tag != GridSimTags.EMPTY_PKT)) @@ -394,26 +379,30 @@ FnbDroppedPacketInfo gu = new FnbDroppedPacketInfo(glID, entity); insertGlID_userID(gu); - /*System.out.println("\n" + super.get_name() + + System.out.println("\n" + super.get_name() + ": A packet has been dropped, and an ACK has been sent.\n" + " src.output: " + src_outputPort_str + ". dst_inputPort: " + dst_str + "\n Time: " + - GridSim.clock() + ". PktID: " + pnp.getID() +". Gl: " + glID);*/ + GridSim.clock() + ". PktID: " + pnp.getID() + + ". Gl: " + glID + + ". destination_packetsDroppedEvent: " + + destination_packetsDroppedEvent); } else{ - /* System.out.println("\n" + super.get_name() + + System.out.println("\n" + super.get_name() + ": A packet has been dropped.\n" + " src.output: " + src_outputPort_str + ". dst_inputPort: " + dst_str + "\n Time: " + GridSim.clock() + ". PktID: " + pnp.getID() + ". Gl: " + - glID);*/ - } + glID + ". destination_packetsDroppedEvent: " + + destination_packetsDroppedEvent); + } pnp = null; // remove the packet. } Modified: branches/gridsim4.0-branch2/source/gridsim/net/fnb/firstLastPacketsGridlet.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/firstLastPacketsGridlet.java 2008-07-14 05:43:43 UTC (rev 186) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/firstLastPacketsGridlet.java 2008-07-22 09:39:48 UTC (rev 187) @@ -25,9 +25,11 @@ { int firstPacket; // the id of the first packet in a gridlet int lastPacket; // the id of the last packet in a gridlet - int gridletID; // the gridlet id + int gridletID; // the gridlet/file id + boolean isFile; + /**Creates a new object of this class. This is used in the FnbInput and FnbOutput classes. * @param first id of the first packet * @param last id of the last packet @@ -38,8 +40,26 @@ firstPacket = first; lastPacket = last; gridletID = gl; + isFile = false; } + + + /** Sets the isFile. + * */ + public void setIsFile(boolean f) + { + isFile = f; + } + + /** Gets the isFile. + * @return true is this is a file + * */ + public boolean getIsFile() + { + return isFile; + } + /** Gets the id of the first packet. * @return the id of the first packet * */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |