From: <bro...@us...> - 2008-02-25 01:14:09
|
Revision: 127 http://gridsim.svn.sourceforge.net/gridsim/?rev=127&view=rev Author: brobergj Date: 2008-02-24 17:14:13 -0800 (Sun, 24 Feb 2008) Log Message: ----------- *Changed pktID to static int as it must be unique amongst all flows from all sources! Modified Paths: -------------- branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowBuffer.java Modified: branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowBuffer.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowBuffer.java 2008-02-22 04:36:44 UTC (rev 126) +++ branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowBuffer.java 2008-02-25 01:14:13 UTC (rev 127) @@ -35,7 +35,7 @@ private Link link_; // a link to this output entity private double baudRate_; // baud rate of this entity private final int SIZE = 8; // 1 byte in bits - private int pktID_; // packet ID counter + private static int pktID_; // unique packet ID counter private Vector outPacketList_; // store a list of packets private HashMap<Integer, Packet> activeFlows_; // stores a list of active Flows private Random random_; // selects to which junk packets go to @@ -860,7 +860,6 @@ return; } - // all except last packet in a data session are null packets if (pkt instanceof FlowPacket) { FlowPacket np = (FlowPacket) pkt; @@ -882,7 +881,7 @@ IO_data io = new IO_data( data, np.getSize(), outPort_.get_src()); System.out.println(super.get_name() + ".getDataFromLink() Time now " + GridSim.clock() - + " bottleneck was " + np.getBandwidth_() + " sum lat is " + np.getLatency() ); + + " bottleneck is " + np.getBandwidth_() + " sum lat is " + np.getLatency() ); // if flow terminates at next entity, add to active flows // & hold for appropriate duration @@ -892,7 +891,9 @@ duration = np.getSize()*SIZE / np.getBandwidth_(); activeFlows_.put(pkt.getID(), pkt); super.sim_schedule(super.get_id(), duration, GridSimTags.FLOW_HOLD, new Integer(pkt.getID())); - + System.out.println(super.get_name() + ".getDataFromLink() forecast flow end at " + (GridSim.clock() + + duration)); + // if flow is just an ACK of a finished flow do not hold } else if (pkt.getTag() == GridSimTags.FLOW_RETURN){ duration = 0.0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |