From: <sul...@us...> - 2008-08-18 09:52:50
|
Revision: 201 http://gridsim.svn.sourceforge.net/gridsim/?rev=201&view=rev Author: sulistio Date: 2008-08-18 09:52:58 +0000 (Mon, 18 Aug 2008) Log Message: ----------- modify this example to use the new gridsim.net.flow package Modified Paths: -------------- trunk/examples/DataGrid/example4/DataGridSim.java trunk/examples/DataGrid/example4/SimUser.java Modified: trunk/examples/DataGrid/example4/DataGridSim.java =================================================================== --- trunk/examples/DataGrid/example4/DataGridSim.java 2008-08-12 02:53:06 UTC (rev 200) +++ trunk/examples/DataGrid/example4/DataGridSim.java 2008-08-18 09:52:58 UTC (rev 201) @@ -15,8 +15,8 @@ import gridsim.util.NetworkReader; import java.util.Calendar; import java.util.LinkedList; +import gridsim.net.flow.*; // To use the new flow network package - GridSim 4.2 - /** * This is the main class of the simulation package. It reads all the parameters * from a file, constructs the simulation defined in the configuration files, @@ -45,6 +45,7 @@ // Initialize the GridSim package System.out.println("Initializing GridSim package"); GridSim.init(num_user, calendar, trace_flag, gisFlag); + GridSim.initNetworkType(GridSimTags.NET_FLOW_LEVEL); // set the GIS into DataGIS that handles specifically for data grid // scenarios @@ -60,11 +61,13 @@ LinkedList files = FilesReader.read(ParameterReader.filesFilename); //read topology - LinkedList routerList = NetworkReader.createFIFO(ParameterReader.networkFilename); + //LinkedList routerList = NetworkReader.createFIFO(ParameterReader.networkFilename); + LinkedList routerList = NetworkReader.createFlow(ParameterReader.networkFilename); //attach central RC entity to one of the routers //Create a central RC - Link l = new SimpleLink("rc_link", baud_rate, propDelay, mtu); + //Link l = new SimpleLink("rc_link", baud_rate, propDelay, mtu); + Link l = new FlowLink("rc_link", baud_rate, propDelay, mtu); TopRegionalRC rc = new TopRegionalRC(l); //connect the TopRC to a router specified in the parameters file Modified: trunk/examples/DataGrid/example4/SimUser.java =================================================================== --- trunk/examples/DataGrid/example4/SimUser.java 2008-08-12 02:53:06 UTC (rev 200) +++ trunk/examples/DataGrid/example4/SimUser.java 2008-08-18 09:52:58 UTC (rev 201) @@ -12,8 +12,8 @@ import gridsim.net.SimpleLink; import java.util.ArrayList; import java.util.Iterator; +import gridsim.net.flow.*; // To use the new flow network package - GridSim 4.2 - /** * This class defines a user which executes a set of commands. * @author Uros Cibej and Anthony Sulistio @@ -25,7 +25,8 @@ // constructor SimUser(String name, double baud_rate, double delay, int MTU) throws Exception { - super(name, new SimpleLink(name + "_link", baud_rate, delay, MTU)); + //super(name, new SimpleLink(name + "_link", baud_rate, delay, MTU)); + super(name, new FlowLink(name + "_link", baud_rate, delay, MTU)); this.name_ = name; this.tasks = new ArrayList(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |