From: <bro...@us...> - 2008-03-12 06:53:06
|
Revision: 149 http://gridsim.svn.sourceforge.net/gridsim/?rev=149&view=rev Author: brobergj Date: 2008-03-11 23:53:08 -0700 (Tue, 11 Mar 2008) Log Message: ----------- Bug fixes Modified Paths: -------------- branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowOutput.java Modified: branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowOutput.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowOutput.java 2008-03-12 06:52:49 UTC (rev 148) +++ branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowOutput.java 2008-03-12 06:53:08 UTC (rev 149) @@ -16,6 +16,7 @@ import eduni.simjava.*; import java.util.*; +import java.util.Random; /** @@ -45,6 +46,8 @@ private ArrayList list_; // list of resources + user entities private boolean hasStarted_; // a flag for background traffic has started private static final int BITS = 8; // 1 byte = 8 bits + + private Random rnd; /** @@ -74,6 +77,8 @@ list_ = null; random_ = null; hasStarted_ = false; + + rnd = new Random(); } /** @@ -244,7 +249,7 @@ int shutdownID = GridSim.getGridSimShutdownEntityId(); // start generating some junk packets or background traffic - startBackgroundTraffic(); + // startBackgroundTraffic(); // Process incoming events while ( Sim_system.running() ) @@ -510,10 +515,11 @@ // last packet contains the actual data FlowPacket np = null; - np = new FlowPacket(obj,pktID_,size,tag,super.get_id(), + np = new FlowPacket(obj,rnd.nextInt(10000000),size,tag,super.get_id(), destId, netServiceType, 1, 1); + - System.out.println("Sending flow packet to link at time = " + GridSim.clock() + " id is " + pktID_); + System.out.println("Sending flow packet to link at time = " + GridSim.clock() + " id is " + np.getID()); pktID_++; // increments packet ID enque(np, GridSimTags.SCHEDULE_NOW); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |