From: <bro...@us...> - 2008-02-22 02:11:12
|
Revision: 125 http://gridsim.svn.sourceforge.net/gridsim/?rev=125&view=rev Author: brobergj Date: 2008-02-21 18:11:17 -0800 (Thu, 21 Feb 2008) Log Message: ----------- *Added comments and javadoc Modified Paths: -------------- branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowRouter.java Modified: branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowRouter.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowRouter.java 2008-02-22 02:11:02 UTC (rev 124) +++ branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowRouter.java 2008-02-22 02:11:17 UTC (rev 125) @@ -38,6 +38,7 @@ * * @invariant $none * @since GridSim Toolkit 3.1 + * @author James Broberg, The University of Melbourne * @author Gokul Poduval & Chen-Khong Tham, National University of Singapore */ public class FlowRouter extends Router @@ -52,14 +53,14 @@ /** - * Creates a new RIPRouter object. + * Creates a new FlowRouter object. * By default, <b>no recording or logging</b> * is done for packets' activities. If you want to log operations of this - * entity, please use {@link #RIPRouter(String, boolean)}. + * entity, please use {@link #FlowRouter(String, boolean)}. * * @param name Name of this router * @throws NullPointerException This happens when name is empty or null - * @see #RIPRouter(String, boolean) + * @see #FlowRouter(String, boolean) * @pre name != null * @post $none */ @@ -68,7 +69,7 @@ } /** - * Creates a new RIPRouter object with logging facility if it is turned on. + * Creates a new FlowRouter object with logging facility if it is turned on. * <br> * NOTE: If logging facility is turned on, there are some overheads * in terms of performance and memory consumption. @@ -288,10 +289,6 @@ System.out.println(super.get_name() + ".processEvent(): processNetPacket() + at time = " + GridSim.clock()); processNetPacket(ev, ev.get_tag()); break; - - //case GridSimTags.FLOW_FORWARD: - // processFlowPacket(ev, ev.get_tag()); - // break; case GridSimTags.ROUTER_AD: receiveAd(ev); @@ -312,8 +309,6 @@ /** * Processes incoming network packets, one at a time. - * The incoming packet will be split up into smaller pieces if - * the packet size > MTU of the other end. * * @param ev a Sim_event object * @pre ev != null @@ -346,18 +341,7 @@ ((InfoPacket) pkt).addBaudRate(sched.getBaudRate()); } -// if (pkt instanceof FlowPacket && pkt.getTag() == GridSimTags.FLOW_SUBMIT ) { -// ((FlowPacket)pkt).addBaudRate( ((Link)Sim_system.get_entity(getLinkName(pkt.getDestID()))).getBaudRate() ); -// ((FlowPacket)pkt).addLatency( ((Link)Sim_system.get_entity(getLinkName(pkt.getDestID()))).getDelay() ); -// } - - // check downlink MTU, and split accordingly - //String linkName = getLinkName( pkt.getDestID() ); - //Link downLink = (Link) Sim_system.get_entity(linkName); - //int MTU = downLink.getMTU(); - //int numPackets = (int) Math.ceil(pkt.getSize() / (MTU * 1.0)); - System.out.println(super.get_name() + ".processNetPacket() check sched Time now " + GridSim.clock()); // if no packets at the moment if (sched.size() == 0) @@ -366,12 +350,7 @@ " size " + pkt.getSize()*BITS + " baud sched " + sched.getBaudRate() + " largest double " + Double.MAX_VALUE); - //if (numPackets == 1) { - // nextTime = (pkt.getSize() * BITS) / sched.getBaudRate(); - //} - //else { - // nextTime = (MTU * BITS * 1.0) / sched.getBaudRate(); - //} + System.out.println(super.get_name() + ".processNetPacket() set internal event to " + "fire"); // Fire internal event without delay (delay is incurred entirely at source @@ -389,19 +368,6 @@ //super.write("break this packet into, " + numPackets); } - // break a large packet into smaller ones that fit into MTU - // by making null or empty packets except for the last one - /*for (int i = 0; i < numPackets - 1; i++) - { - NetPacket np = new NetPacket(null, pkt.getID(), MTU, tag, - pkt.getSrcID(), pkt.getDestID(), - pkt.getNetServiceType(),i+1,numPackets); - - np.setLast(id); - super.write("enqueing, " + np); - sched.enque(np); // put the packet into the scheduler - }*/ - // put the actual packet into the last one and resize it accordingly pkt.setLast(id); pkt.setSize(pkt.getSize()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |