From: <bro...@us...> - 2008-03-13 05:08:07
|
Revision: 151 http://gridsim.svn.sourceforge.net/gridsim/?rev=151&view=rev Author: brobergj Date: 2008-03-12 22:08:11 -0700 (Wed, 12 Mar 2008) Log Message: ----------- Minor updates Modified Paths: -------------- branches/gridsim4.0-branch2/examples/FlowNetEx01/FlowNetUser.java Modified: branches/gridsim4.0-branch2/examples/FlowNetEx01/FlowNetUser.java =================================================================== --- branches/gridsim4.0-branch2/examples/FlowNetEx01/FlowNetUser.java 2008-03-13 05:07:42 UTC (rev 150) +++ branches/gridsim4.0-branch2/examples/FlowNetEx01/FlowNetUser.java 2008-03-13 05:08:11 UTC (rev 151) @@ -85,16 +85,20 @@ public void body() { int packetSize = 5242880; // packet size in bytes [5MB] - int size = 1; // number of packets sent + int size = 3; // number of packets sent int i = 0; // get the destination entity ID this.destID_ = GridSim.getEntityId(destName_); + + //super.sim_pause(this.wait_); + this.gridSimHold(this.wait_); + // sends messages over the other side of the link for (i = 0; i < size; i++) { - super.sim_pause(this.wait_); + String msg = "Message_" + i; IO_data data = new IO_data(msg, packetSize, destID_); System.out.println(name_ + ".body(): Sending " + msg + @@ -103,6 +107,10 @@ // sends through Output buffer of this entity super.send(super.output, GridSimTags.SCHEDULE_NOW, GridSimTags.FLOW_SUBMIT, data); + + //super.sim_pause(); + super.sim_pause(10.0); + //this.gridSimHold((Math.random()*10)+1.0); } @@ -113,18 +121,17 @@ { // waiting for incoming event in the Input buffer obj = super.receiveEventObject(); - if (obj instanceof IO_data) { - System.out.println(name_ + ".body(): Receives Ack for " + ((IO_data)obj).getData()); - } - } + System.out.println(name_ + ".body(): Receives Ack for " + obj); + } // Wait for other FlowNetUser instances to finish - //super.sim_pause(600); + this.gridSimHold(1000.0); super.send(destID_, GridSimTags.SCHEDULE_NOW, GridSimTags.END_OF_SIMULATION); + //////////////////////////////////////////////////////// // shut down I/O ports This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |