From: <sul...@us...> - 2008-08-03 06:00:34
|
Revision: 195 http://gridsim.svn.sourceforge.net/gridsim/?rev=195&view=rev Author: sulistio Date: 2008-08-03 06:00:43 +0000 (Sun, 03 Aug 2008) Log Message: ----------- modify this class to incorporate the latest network flow functionality into GridSim. Modified Paths: -------------- trunk/source/gridsim/GridSim.java trunk/source/gridsim/GridSimCore.java trunk/source/gridsim/GridSimTags.java trunk/source/gridsim/net/Input.java trunk/source/gridsim/net/Link.java trunk/source/gridsim/net/Output.java trunk/source/gridsim/net/Packet.java Modified: trunk/source/gridsim/GridSim.java =================================================================== --- trunk/source/gridsim/GridSim.java 2008-08-03 05:58:42 UTC (rev 194) +++ trunk/source/gridsim/GridSim.java 2008-08-03 06:00:43 UTC (rev 195) @@ -9,13 +9,13 @@ package gridsim; +//import gridsim.net.fnb.FnbWhiteList; import gridsim.net.Link; import gridsim.filter.*; import java.io.*; import java.util.*; import eduni.simjava.*; - /** * This class is mainly responsible in initialization, running and stopping of * the overall simulation. @@ -71,7 +71,7 @@ private final int ARRAY_SIZE = 3; private final int SIZE = 12; // Integer object size incl. overhead private final int RESULT = 1; // array[0] = gridlet id, [1] = result - private final static String GRIDSIM_VERSION_STRING = "GridSim Version 4.1"; + private final static String GRIDSIM_VERSION_STRING = "4.2"; /////////////////////////// STATIC variables //////////////////// @@ -98,13 +98,21 @@ */ public static int PAUSE = 10; // pause before registering to regional GIS + /** + * A white list that records entity IDs. + * The main purpose is that network packets are not going to be dropped, + * if they are going to/coming from the entity stored in the list. + * @see gridsim.net.fnb.FnbWhiteList + */ + //public static FnbWhiteList fnbWhiteList_ = null; // TODO + private static int gisID_ = -1; // id of GIS entity private static int shutdownID_ = -1; // id of GridSimShutdown entity private static int statsID_ = -1; // id of GridStatistics entity private static Calendar calendar_ = null; // a Calendar object private static GridInformationService gis_ = null; // a GIS object private final static int NOT_FOUND = -1; // a constant - private static boolean traceFlag_; + private static boolean traceFlag_ = false; // trace events or other activities //////////////////////////////////////////////////////////////////////// @@ -544,7 +552,7 @@ Sim_system.initialise(); Sim_system.set_trc_level(1); Sim_system.set_auto_trace(traceFlag); - + traceFlag_ = traceFlag; // Set the current Wall clock time as the starting time of simulation @@ -601,7 +609,7 @@ */ public static void startGridSimulation() throws NullPointerException { - System.out.println("Starting GridSim " + GRIDSIM_VERSION_STRING); + System.out.println("Starting GridSim version " + GRIDSIM_VERSION_STRING); try { Sim_system.run(); } @@ -2135,10 +2143,10 @@ return GridSim.isResourceExist(id); } - + /** * Checks whether simulation's statistics of other log should be created - * @return <tt>true</tt> if the information should be logged + * @return <tt>true</tt> if the information should be logged * or <tt>false</tt> otherwise. */ public static boolean isTraceEnabled() { @@ -2501,5 +2509,56 @@ ); } + /** + * Initializes the {@link gridsim.GridSimCore#NETWORK_TYPE} to be used in + * the simulation. By default, the {@link gridsim.GridSimCore#NETWORK_TYPE} + * is set to {@link gridsim.GridSimTags.NET_PACKET_LEVEL}. + * + * @param networkType network type + * @return <tt>true</tt> if the network type has been initialized successfully + * or <tt>false</tt> otherwise. + * + * @see gridsim.GridSimCore#NETWORK_TYPE + * @see gridsim.GridSimTags.NET_PACKET_LEVEL + * @see gridsim.GridSimTags.NET_FLOW_LEVEL + * @see gridsim.GridSimTags.NET_BUFFER_PACKET_LEVEL + */ + public static boolean initNetworkType(int networkType) + { + boolean result = true; + switch(networkType) + { + case GridSimTags.NET_PACKET_LEVEL: + GridSimCore.NETWORK_TYPE = GridSimTags.NET_PACKET_LEVEL; + break; + + case GridSimTags.NET_FLOW_LEVEL: + GridSimCore.NETWORK_TYPE = GridSimTags.NET_FLOW_LEVEL; + break; + + case GridSimTags.NET_BUFFER_PACKET_LEVEL: + GridSimCore.NETWORK_TYPE = GridSimTags.NET_BUFFER_PACKET_LEVEL; + //fnbWhiteList_ = new FnbWhiteList(); // TODO + break; + + default: + result = false; + break; + } + + return result; + } + + /** Returns the network type used in this simulation. + * @return the network type + * @see gridsim.GridSimCore#NETWORK_TYPE + * @see gridsim.GridSimTags.NET_PACKET_LEVEL + * @see gridsim.GridSimTags.NET_FLOW_LEVEL + * @see gridsim.GridSimTags.NET_BUFFER_PACKET_LEVEL + */ + public static int getNetworkType() { + return GridSimCore.NETWORK_TYPE; + } + } // end class Modified: trunk/source/gridsim/GridSimCore.java =================================================================== --- trunk/source/gridsim/GridSimCore.java 2008-08-03 05:58:42 UTC (rev 194) +++ trunk/source/gridsim/GridSimCore.java 2008-08-03 06:00:43 UTC (rev 195) @@ -13,8 +13,9 @@ import gridsim.net.*; import gridsim.util.*; import java.util.Collection; +import gridsim.net.flow.*; +//import gridsim.net.fnb.*; - /** * Since GridSim version 3.0, this is the overall class of GridSim package, * that must be extended by other GridSim @@ -188,7 +189,19 @@ protected Sim_port output; // Output port but only for a network extension. - private Output out_ = null; + private NetIO out_ = null; + + /** Specifies which type of network to be used. + * By default, the simulation uses the gridsim.net package or differentiated + * network service. To change this default property, please use the + * {@link gridsim.GridSim#initNetworkType(int)} method <b>before</b> the + * simulation starts. + * @see gridsim.GridSim#initNetworkType(int) + * @see gridsim.GridSimTags.NET_PACKET_LEVEL + * @see gridsim.GridSimTags.NET_FLOW_LEVEL + * @see gridsim.GridSimTags.NET_BUFFER_PACKET_LEVEL + */ + protected static int NETWORK_TYPE = GridSimTags.NET_PACKET_LEVEL; /** @@ -253,13 +266,7 @@ super.add_port(input); super.add_port(output); - // Every GridSim entity with network has its own input/output channels. - // Connect this entity "input" port to its input buffer "in_port" - new Input("Input_" + name, baudRate); - Sim_system.link_ports(name, "input", "Input_" + name, "input_buffer"); - - new Output("Output_" + name, baudRate); - Sim_system.link_ports(name, "output", "Output_"+name, "output_buffer"); + initNetwork(name, baudRate, null); } /** @@ -274,7 +281,7 @@ * @param name the name to be associated with this entity (as * required by Sim_entity class from simjava package) * @param link the link that this GridSim entity will use to - communicate with other GridSim or Network entities. + * communicate with other GridSim or Network entities. * @throws Exception This happens when creating this entity before * initializing GridSim package or this entity name is * <tt>null</tt> or empty @@ -299,15 +306,49 @@ super.add_port(input); super.add_port(output); + initNetwork(name, link.getBaudRate(), link); + } + + /** + * Creates Input and Output entities according to the network type + * @param name the name to be associated with this entity (as + * required by Sim_entity class from simjava package) + * @param baudRate network communication or bandwidth speed + * @param link the link that this GridSim entity will use to + * communicate with other GridSim or Network entities. + */ + private void initNetwork(String name, double baudRate, Link link) + { // Every GridSim entity with network has its own input/output channels. // Connect this entity "input" port to its input buffer "in_port" - Input in = new Input("Input_" + name, link_.getBaudRate()); - in.addLink(link_); + NetIO in = null; + + // Packet Level networking + if (GridSimCore.NETWORK_TYPE == GridSimTags.NET_PACKET_LEVEL) + { + in = new Input("Input_" + name, baudRate); + out_ = new Output("Output_" + name, baudRate); + } + // Flow Level networking + else if (GridSimCore.NETWORK_TYPE == GridSimTags.NET_FLOW_LEVEL) + { + in = new FlowInput("Input_" + name, baudRate); + out_ = new FlowOutput("Output_" + name, baudRate); + } + // Use Finite network buffer + else if (GridSimCore.NETWORK_TYPE == GridSimTags.NET_BUFFER_PACKET_LEVEL) + { // TODO: + //in = new FnbInput("Input_" + name, baudRate); + //out_ = new FnbOutput("Output_" + name, baudRate); + } + Sim_system.link_ports(name, "input", "Input_" + name, "input_buffer"); - - out_ = new Output("Output_" + name, link_.getBaudRate()); - out_.addLink(link_); - Sim_system.link_ports(name, "output", "Output_"+name, "output_buffer"); + Sim_system.link_ports(name, "output", "Output_" + name, "output_buffer"); + if (link != null) + { + in.addLink(link); + out_.addLink(link); + } } /** Modified: trunk/source/gridsim/GridSimTags.java =================================================================== --- trunk/source/gridsim/GridSimTags.java 2008-08-03 05:58:42 UTC (rev 194) +++ trunk/source/gridsim/GridSimTags.java 2008-08-03 06:00:43 UTC (rev 195) @@ -188,7 +188,25 @@ */ public static final int SCHEDULER_DEQUE = NETBASE + 10; + public static final int NET_PACKET_LEVEL = NETBASE + 11; + public static final int NET_FLOW_LEVEL = NETBASE + 12; + + public static final int NET_BUFFER_PACKET_LEVEL = NETBASE + 13; + + // Denotes flow en-route to destination (used manually by entities) + public static final int FLOW_SUBMIT = NETBASE + 14; + + // Internal message to check forecast of flow duration + public static final int FLOW_HOLD = NETBASE + 15; + + // Message to update forecast of flow duration + public static final int FLOW_UPDATE = NETBASE + 16; + + // Denotes flow ack en-route to destination (used manually by entities) + public static final int FLOW_ACK = NETBASE + 17; + + ///////////////////////////////////////////////////////////// // I intentionally put a gap to incorporate future tags // so I don't have to change the numbers! Modified: trunk/source/gridsim/net/Input.java =================================================================== --- trunk/source/gridsim/net/Input.java 2008-08-03 05:58:42 UTC (rev 194) +++ trunk/source/gridsim/net/Input.java 2008-08-03 06:00:43 UTC (rev 195) @@ -11,6 +11,8 @@ import gridsim.*; import gridsim.net.*; +import gridsim.util.TrafficGenerator; +import java.util.Collection; import eduni.simjava.*; /** @@ -29,7 +31,7 @@ * @since GridSim Toolkit 1.0 * @invariant $none */ -public class Input extends Sim_entity +public class Input extends Sim_entity implements NetIO { private Sim_port inPort_; private Link link_; @@ -64,8 +66,10 @@ * @pre link != null * @post $none */ - public void addLink(Link link) { + public void addLink(Link link) + { this.link_ = link; + baudRate_ = link_.getBaudRate(); } /** @@ -113,6 +117,37 @@ } /** + * This is an empty method and only applicable to + * {@link gridsim.net.Output} class. + * @param gen a background traffic generator + * @param userName a collection of user entity name (in String object). + * @return <tt>false</tt> since this method is not used by this class. + * @pre gen != null + * @pre userName != null + * @post $none + * @see gridsim.net.Output + */ + public boolean setBackgroundTraffic(TrafficGenerator gen, + Collection userName) + { + return false; + } + + /** + * This is an empty method and only applicable to + * {@link gridsim.net.Output} class. + * @param gen a background traffic generator + * @return <tt>false</tt> since this method is not used by this class. + * @pre gen != null + * @post $none + * @see gridsim.net.Output + */ + public boolean setBackgroundTraffic(TrafficGenerator gen) + { + return false; + } + + /** * A method that gets one process event at one time until the end * of a simulation, then delivers an event to the entity (its parent) * @pre $none Modified: trunk/source/gridsim/net/Link.java =================================================================== --- trunk/source/gridsim/net/Link.java 2008-08-03 05:58:42 UTC (rev 194) +++ trunk/source/gridsim/net/Link.java 2008-08-03 06:00:43 UTC (rev 195) @@ -96,7 +96,7 @@ throw new ParameterException(msg + "baud rate must be > 0."); } else if (propDelay <= 0) { - throw new ParameterException(msg+"propagation delay mut be < 0."); + throw new ParameterException(msg+"propagation delay must be > 0."); } else if (MTU <= 0) { throw new ParameterException(msg + "MTU must be > 0."); Modified: trunk/source/gridsim/net/Output.java =================================================================== --- trunk/source/gridsim/net/Output.java 2008-08-03 05:58:42 UTC (rev 194) +++ trunk/source/gridsim/net/Output.java 2008-08-03 06:00:43 UTC (rev 195) @@ -31,7 +31,7 @@ * @since GridSim Toolkit 1.0 * @invariant $none */ -public class Output extends Sim_entity +public class Output extends Sim_entity implements NetIO { private Sim_port outPort_; // output port private Link link_; // a link to this output entity @@ -180,6 +180,7 @@ public void addLink(Link link) { this.link_ = link; + baudRate_ = link_.getBaudRate(); packetList_ = new Vector(); } Modified: trunk/source/gridsim/net/Packet.java =================================================================== --- trunk/source/gridsim/net/Packet.java 2008-08-03 05:58:42 UTC (rev 194) +++ trunk/source/gridsim/net/Packet.java 2008-08-03 06:00:43 UTC (rev 195) @@ -17,7 +17,7 @@ /** - * This the structure for packets. + * This class contains the structure for a network packet. * * @since GridSim Toolkit 3.1 * @author Gokul Poduval & Chen-Khong Tham, National University of Singapore @@ -64,7 +64,7 @@ * @post $none */ int getID(); - + /** * Returns the ID of the source of this packet. * @return source id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sul...@us...> - 2008-08-04 02:39:23
|
Revision: 198 http://gridsim.svn.sourceforge.net/gridsim/?rev=198&view=rev Author: sulistio Date: 2008-08-04 02:39:22 +0000 (Mon, 04 Aug 2008) Log Message: ----------- add the copyright statement at the class header for each file. Modified Paths: -------------- trunk/source/gridsim/ARGridResource.java trunk/source/gridsim/ARObject.java trunk/source/gridsim/ARPolicy.java trunk/source/gridsim/ARSimpleSpaceShared.java trunk/source/gridsim/Accumulator.java trunk/source/gridsim/AdvanceReservation.java trunk/source/gridsim/AllocPolicy.java trunk/source/gridsim/GridInformationService.java trunk/source/gridsim/GridResource.java trunk/source/gridsim/GridSim.java trunk/source/gridsim/GridSimCore.java trunk/source/gridsim/GridSimRandom.java trunk/source/gridsim/GridSimShutdown.java trunk/source/gridsim/GridSimStandardPE.java trunk/source/gridsim/GridSimTags.java trunk/source/gridsim/GridStatistics.java trunk/source/gridsim/GridUser.java trunk/source/gridsim/Gridlet.java trunk/source/gridsim/GridletList.java trunk/source/gridsim/IO_data.java trunk/source/gridsim/Machine.java trunk/source/gridsim/MachineList.java trunk/source/gridsim/PE.java trunk/source/gridsim/PEList.java trunk/source/gridsim/ParameterException.java trunk/source/gridsim/ResGridlet.java trunk/source/gridsim/ResGridletList.java trunk/source/gridsim/ResourceCalendar.java trunk/source/gridsim/ResourceCharacteristics.java trunk/source/gridsim/ResourceUserList.java trunk/source/gridsim/Sim_from_port.java trunk/source/gridsim/SpaceShared.java trunk/source/gridsim/Stat.java trunk/source/gridsim/TimeShared.java trunk/source/gridsim/auction/Auction.java trunk/source/gridsim/auction/AuctionObserver.java trunk/source/gridsim/auction/AuctionTags.java trunk/source/gridsim/auction/Auctioneer.java trunk/source/gridsim/auction/ContinuousDoubleAuction.java trunk/source/gridsim/auction/DoubleAuction.java trunk/source/gridsim/auction/DutchAuction.java trunk/source/gridsim/auction/EnglishAuction.java trunk/source/gridsim/auction/FirstPriceSealedBidAuction.java trunk/source/gridsim/auction/Message.java trunk/source/gridsim/auction/MessageAsk.java trunk/source/gridsim/auction/MessageBid.java trunk/source/gridsim/auction/MessageCallForBids.java trunk/source/gridsim/auction/MessageInformOutcome.java trunk/source/gridsim/auction/MessageInformStart.java trunk/source/gridsim/auction/MessageRejectBid.java trunk/source/gridsim/auction/MessageRejectCallForBid.java trunk/source/gridsim/auction/OneSidedAuction.java trunk/source/gridsim/auction/Responder.java trunk/source/gridsim/auction/ReverseDutchAuction.java trunk/source/gridsim/auction/ReverseEnglishAuction.java trunk/source/gridsim/auction/ReverseFirstPriceSealedBidAuction.java trunk/source/gridsim/datagrid/DataGridResource.java trunk/source/gridsim/datagrid/DataGridTags.java trunk/source/gridsim/datagrid/DataGridUser.java trunk/source/gridsim/datagrid/DataGridlet.java trunk/source/gridsim/datagrid/File.java trunk/source/gridsim/datagrid/FileAttribute.java trunk/source/gridsim/datagrid/ReplicaManager.java trunk/source/gridsim/datagrid/SimpleReplicaManager.java trunk/source/gridsim/datagrid/filter/FileNameFilter.java trunk/source/gridsim/datagrid/filter/Filter.java trunk/source/gridsim/datagrid/filter/FilterDataResult.java trunk/source/gridsim/datagrid/index/AbstractRC.java trunk/source/gridsim/datagrid/index/DataGIS.java trunk/source/gridsim/datagrid/index/DataRegionalGIS.java trunk/source/gridsim/datagrid/index/RegionalRC.java trunk/source/gridsim/datagrid/index/TopRegionalRC.java trunk/source/gridsim/datagrid/storage/HarddriveStorage.java trunk/source/gridsim/datagrid/storage/Storage.java trunk/source/gridsim/datagrid/storage/TapeStorage.java trunk/source/gridsim/filter/FilterCreateAR.java trunk/source/gridsim/filter/FilterGridlet.java trunk/source/gridsim/filter/FilterQueryTimeAR.java trunk/source/gridsim/filter/FilterResult.java trunk/source/gridsim/index/AbstractGIS.java trunk/source/gridsim/index/RegionalGIS.java trunk/source/gridsim/net/FIFOScheduler.java trunk/source/gridsim/net/FloodAdPack.java trunk/source/gridsim/net/FloodingRouter.java trunk/source/gridsim/net/InfoPacket.java trunk/source/gridsim/net/Input.java trunk/source/gridsim/net/Link.java trunk/source/gridsim/net/NetIO.java trunk/source/gridsim/net/NetPacket.java trunk/source/gridsim/net/Output.java trunk/source/gridsim/net/Packet.java trunk/source/gridsim/net/PacketScheduler.java trunk/source/gridsim/net/RIPAdPack.java trunk/source/gridsim/net/RIPRouter.java trunk/source/gridsim/net/RateControlledRouter.java trunk/source/gridsim/net/RateControlledScheduler.java trunk/source/gridsim/net/Router.java trunk/source/gridsim/net/SCFQScheduler.java trunk/source/gridsim/net/SimpleLink.java trunk/source/gridsim/resFailure/AllocPolicyWithFailure.java trunk/source/gridsim/resFailure/AvailabilityInfo.java trunk/source/gridsim/resFailure/FailureMsg.java trunk/source/gridsim/resFailure/GridResourceWithFailure.java trunk/source/gridsim/resFailure/RegionalGISWithFailure.java trunk/source/gridsim/resFailure/SpaceSharedWithFailure.java trunk/source/gridsim/resFailure/TimeSharedWithFailure.java trunk/source/gridsim/util/NetworkReader.java trunk/source/gridsim/util/SimReport.java trunk/source/gridsim/util/TrafficGenerator.java trunk/source/gridsim/util/Workload.java Modified: trunk/source/gridsim/ARGridResource.java =================================================================== --- trunk/source/gridsim/ARGridResource.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/ARGridResource.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ARGridResource.java,v 1.19 2005/10/21 09:23:20 anthony Exp $ + * Copyright (c) 2004, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/ARObject.java =================================================================== --- trunk/source/gridsim/ARObject.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/ARObject.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ARObject.java,v 1.8 2004/11/01 02:52:33 anthony Exp $ + * Copyright (c) 2004, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/ARPolicy.java =================================================================== --- trunk/source/gridsim/ARPolicy.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/ARPolicy.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ARPolicy.java,v 1.19 2007/08/10 01:50:34 anthony Exp $ + * Copyright (c) 2004, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/ARSimpleSpaceShared.java =================================================================== --- trunk/source/gridsim/ARSimpleSpaceShared.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/ARSimpleSpaceShared.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ARSimpleSpaceShared.java,v 1.11 2005/10/21 09:23:20 anthony Exp $ + * Copyright (c) 2004, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/Accumulator.java =================================================================== --- trunk/source/gridsim/Accumulator.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/Accumulator.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: Accumulator.java,v 1.14 2007/10/18 01:26:48 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/AdvanceReservation.java =================================================================== --- trunk/source/gridsim/AdvanceReservation.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/AdvanceReservation.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: AdvanceReservation.java,v 1.40 2005/10/21 09:23:20 anthony Exp $ + * Copyright (c) 2004, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/AllocPolicy.java =================================================================== --- trunk/source/gridsim/AllocPolicy.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/AllocPolicy.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: AllocPolicy.java,v 1.45 2007/08/30 02:18:10 anthony Exp $ + * Copyright (c) 2003, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/GridInformationService.java =================================================================== --- trunk/source/gridsim/GridInformationService.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/GridInformationService.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: GridInformationService.java,v 1.32 2007/08/30 02:18:10 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/GridResource.java =================================================================== --- trunk/source/gridsim/GridResource.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/GridResource.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: GridResource.java,v 1.62 2007/08/30 02:18:10 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/GridSim.java =================================================================== --- trunk/source/gridsim/GridSim.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/GridSim.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: GridSim.java,v 1.67 2007/08/30 02:18:10 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/GridSimCore.java =================================================================== --- trunk/source/gridsim/GridSimCore.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/GridSimCore.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: GridSimCore.java,v 1.14 2007/08/30 02:18:10 anthony Exp $ + * Copyright (c) 2004, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/GridSimRandom.java =================================================================== --- trunk/source/gridsim/GridSimRandom.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/GridSimRandom.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: GridSimRandom.java,v 1.13 2004/11/01 02:52:35 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/GridSimShutdown.java =================================================================== --- trunk/source/gridsim/GridSimShutdown.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/GridSimShutdown.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: GridSimShutdown.java,v 1.21 2005/03/28 01:31:37 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/GridSimStandardPE.java =================================================================== --- trunk/source/gridsim/GridSimStandardPE.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/GridSimStandardPE.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: GridSimStandardPE.java,v 1.11 2004/11/01 02:52:35 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/GridSimTags.java =================================================================== --- trunk/source/gridsim/GridSimTags.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/GridSimTags.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: GridSimTags.java,v 1.49 2007/08/30 02:18:10 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/GridStatistics.java =================================================================== --- trunk/source/gridsim/GridStatistics.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/GridStatistics.java 2008-08-04 02:39:22 UTC (rev 198) @@ -5,7 +5,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: GridStatistics.java,v 1.21 2004/11/01 02:52:35 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/GridUser.java =================================================================== --- trunk/source/gridsim/GridUser.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/GridUser.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: GridUser.java,v 1.7 2006/04/21 02:46:45 anthony Exp $ + * Copyright (c) 2005, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/Gridlet.java =================================================================== --- trunk/source/gridsim/Gridlet.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/Gridlet.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: Gridlet.java,v 1.37 2007/08/30 02:18:10 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/GridletList.java =================================================================== --- trunk/source/gridsim/GridletList.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/GridletList.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: GridletList.java,v 1.11 2004/11/01 02:52:35 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/IO_data.java =================================================================== --- trunk/source/gridsim/IO_data.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/IO_data.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: IO_data.java,v 1.15 2005/06/21 08:54:37 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/Machine.java =================================================================== --- trunk/source/gridsim/Machine.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/Machine.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: Machine.java,v 1.14 2007/08/20 02:13:29 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ Modified: trunk/source/gridsim/MachineList.java =================================================================== --- trunk/source/gridsim/MachineList.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/MachineList.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: MachineList.java,v 1.15 2007/08/20 02:13:29 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/PE.java =================================================================== --- trunk/source/gridsim/PE.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/PE.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: PE.java,v 1.15 2007/08/30 01:20:19 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/PEList.java =================================================================== --- trunk/source/gridsim/PEList.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/PEList.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: PEList.java,v 1.14 2007/08/20 02:13:52 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/ParameterException.java =================================================================== --- trunk/source/gridsim/ParameterException.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/ParameterException.java 2008-08-04 02:39:22 UTC (rev 198) @@ -8,7 +8,8 @@ * October 2004 * * Licence: GPL - http://www.gnu.org/copyleft/gpl.html - * + * Copyright (c) 2004, The University of Melbourne, Australia and + * National University of Singapore * ParameterException.java - Thrown for illegal parameters * */ Modified: trunk/source/gridsim/ResGridlet.java =================================================================== --- trunk/source/gridsim/ResGridlet.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/ResGridlet.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ResGridlet.java,v 1.27 2005/07/19 07:36:41 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/ResGridletList.java =================================================================== --- trunk/source/gridsim/ResGridletList.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/ResGridletList.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ResGridletList.java,v 1.10 2004/11/01 02:52:36 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/ResourceCalendar.java =================================================================== --- trunk/source/gridsim/ResourceCalendar.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/ResourceCalendar.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ResourceCalendar.java,v 1.16 2005/04/01 06:30:36 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ Modified: trunk/source/gridsim/ResourceCharacteristics.java =================================================================== --- trunk/source/gridsim/ResourceCharacteristics.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/ResourceCharacteristics.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ResourceCharacteristics.java,v 1.23 2007/08/20 02:14:24 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/ResourceUserList.java =================================================================== --- trunk/source/gridsim/ResourceUserList.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/ResourceUserList.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ResourceUserList.java,v 1.9 2004/11/01 02:52:37 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/Sim_from_port.java =================================================================== --- trunk/source/gridsim/Sim_from_port.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/Sim_from_port.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: Sim_from_port.java,v 1.12 2005/04/01 06:20:43 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/SpaceShared.java =================================================================== --- trunk/source/gridsim/SpaceShared.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/SpaceShared.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: SpaceShared.java,v 1.28 2006/03/09 05:56:31 anthony Exp $ + * Copyright (c) 2003, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/Stat.java =================================================================== --- trunk/source/gridsim/Stat.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/Stat.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: Stat.java,v 1.11 2004/11/01 02:52:37 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/TimeShared.java =================================================================== --- trunk/source/gridsim/TimeShared.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/TimeShared.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: TimeShared.java,v 1.39 2006/03/09 05:56:32 anthony Exp $ + * Copyright (c) 2003, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/auction/Auction.java =================================================================== --- trunk/source/gridsim/auction/Auction.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/Auction.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: Auction.java,v 1.4 2006/03/23 03:40:56 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/AuctionObserver.java =================================================================== --- trunk/source/gridsim/auction/AuctionObserver.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/AuctionObserver.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: AuctionObserver.java,v 1.2 2006/03/20 04:15:00 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/AuctionTags.java =================================================================== --- trunk/source/gridsim/auction/AuctionTags.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/AuctionTags.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: AuctionTags.java,v 1.1 2006/03/09 05:29:19 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/Auctioneer.java =================================================================== --- trunk/source/gridsim/auction/Auctioneer.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/Auctioneer.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: Auctioneer.java,v 1.3 2006/03/22 00:50:59 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/ContinuousDoubleAuction.java =================================================================== --- trunk/source/gridsim/auction/ContinuousDoubleAuction.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/ContinuousDoubleAuction.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ContinuousDoubleAuction.java,v 1.2 2006/03/23 03:40:56 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/DoubleAuction.java =================================================================== --- trunk/source/gridsim/auction/DoubleAuction.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/DoubleAuction.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: DoubleAuction.java,v 1.3 2006/03/23 03:40:56 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/DutchAuction.java =================================================================== --- trunk/source/gridsim/auction/DutchAuction.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/DutchAuction.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: DutchAuction.java,v 1.3 2006/03/23 03:40:56 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/EnglishAuction.java =================================================================== --- trunk/source/gridsim/auction/EnglishAuction.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/EnglishAuction.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: EnglishAuction.java,v 1.3 2006/03/23 03:40:56 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/FirstPriceSealedBidAuction.java =================================================================== --- trunk/source/gridsim/auction/FirstPriceSealedBidAuction.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/FirstPriceSealedBidAuction.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: FirstPriceSealedBidAuction.java,v 1.2 2006/03/23 03:40:56 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/Message.java =================================================================== --- trunk/source/gridsim/auction/Message.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/Message.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: Message.java,v 1.3 2006/03/22 00:51:00 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; import java.util.Hashtable; Modified: trunk/source/gridsim/auction/MessageAsk.java =================================================================== --- trunk/source/gridsim/auction/MessageAsk.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/MessageAsk.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: MessageAsk.java,v 1.2 2006/03/20 04:15:00 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/MessageBid.java =================================================================== --- trunk/source/gridsim/auction/MessageBid.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/MessageBid.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: MessageBid.java,v 1.2 2006/03/20 04:15:01 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/MessageCallForBids.java =================================================================== --- trunk/source/gridsim/auction/MessageCallForBids.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/MessageCallForBids.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: MessageCallForBids.java,v 1.2 2006/03/20 04:15:01 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/MessageInformOutcome.java =================================================================== --- trunk/source/gridsim/auction/MessageInformOutcome.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/MessageInformOutcome.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: MessageInformOutcome.java,v 1.2 2006/03/20 04:15:01 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/MessageInformStart.java =================================================================== --- trunk/source/gridsim/auction/MessageInformStart.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/MessageInformStart.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: MessageInformStart.java,v 1.2 2006/03/20 04:15:01 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/MessageRejectBid.java =================================================================== --- trunk/source/gridsim/auction/MessageRejectBid.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/MessageRejectBid.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: MessageRejectBid.java,v 1.2 2006/03/20 04:15:01 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/MessageRejectCallForBid.java =================================================================== --- trunk/source/gridsim/auction/MessageRejectCallForBid.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/MessageRejectCallForBid.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: MessageRejectCallForBid.java,v 1.2 2006/03/20 04:15:01 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/OneSidedAuction.java =================================================================== --- trunk/source/gridsim/auction/OneSidedAuction.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/OneSidedAuction.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: OneSidedAuction.java,v 1.4 2006/03/23 03:40:56 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/Responder.java =================================================================== --- trunk/source/gridsim/auction/Responder.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/Responder.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: Responder.java,v 1.1 2006/03/09 05:29:22 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/ReverseDutchAuction.java =================================================================== --- trunk/source/gridsim/auction/ReverseDutchAuction.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/ReverseDutchAuction.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ReverseDutchAuction.java,v 1.3 2006/03/23 03:40:56 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/ReverseEnglishAuction.java =================================================================== --- trunk/source/gridsim/auction/ReverseEnglishAuction.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/ReverseEnglishAuction.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ReverseEnglishAuction.java,v 1.4 2006/03/23 03:40:57 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/ReverseFirstPriceSealedBidAuction.java =================================================================== --- trunk/source/gridsim/auction/ReverseFirstPriceSealedBidAuction.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/ReverseFirstPriceSealedBidAuction.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ReverseFirstPriceSealedBidAuction.java,v 1.2 2006/03/23 03:40:57 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/datagrid/DataGridResource.java =================================================================== --- trunk/source/gridsim/datagrid/DataGridResource.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/DataGridResource.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,6 +3,8 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ package gridsim.datagrid; @@ -29,7 +31,7 @@ * more storage elements. It also performs registrations of files stored in * the resource to a designated RC. * <br><br> - * <ul><b>Local Replica Catalogue (RC):</b> This component is an optional part + * <li><b>Local Replica Catalogue (RC):</b> This component is an optional part * of a resource. The Local RC is responsible for indexing available files on * the resource only. It also handles users' queries. However, the Local RC * does not serve as a catalogue server to other resources. Modified: trunk/source/gridsim/datagrid/DataGridTags.java =================================================================== --- trunk/source/gridsim/datagrid/DataGridTags.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/DataGridTags.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,6 +3,8 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ package gridsim.datagrid; Modified: trunk/source/gridsim/datagrid/DataGridUser.java =================================================================== --- trunk/source/gridsim/datagrid/DataGridUser.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/DataGridUser.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,6 +3,8 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ package gridsim.datagrid; Modified: trunk/source/gridsim/datagrid/DataGridlet.java =================================================================== --- trunk/source/gridsim/datagrid/DataGridlet.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/DataGridlet.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,7 +3,10 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ + package gridsim.datagrid; import java.util.LinkedList; Modified: trunk/source/gridsim/datagrid/File.java =================================================================== --- trunk/source/gridsim/datagrid/File.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/File.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,6 +3,8 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ package gridsim.datagrid; Modified: trunk/source/gridsim/datagrid/FileAttribute.java =================================================================== --- trunk/source/gridsim/datagrid/FileAttribute.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/FileAttribute.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,6 +3,8 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ package gridsim.datagrid; Modified: trunk/source/gridsim/datagrid/ReplicaManager.java =================================================================== --- trunk/source/gridsim/datagrid/ReplicaManager.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/ReplicaManager.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,6 +3,8 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ package gridsim.datagrid; Modified: trunk/source/gridsim/datagrid/SimpleReplicaManager.java =================================================================== --- trunk/source/gridsim/datagrid/SimpleReplicaManager.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/SimpleReplicaManager.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,6 +3,8 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ package gridsim.datagrid; Modified: trunk/source/gridsim/datagrid/filter/FileNameFilter.java =================================================================== --- trunk/source/gridsim/datagrid/filter/FileNameFilter.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/filter/FileNameFilter.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,6 +3,8 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ package gridsim.datagrid.filter; Modified: trunk/source/gridsim/datagrid/filter/Filter.java =================================================================== --- trunk/source/gridsim/datagrid/filter/Filter.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/filter/Filter.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,7 +3,10 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ + package gridsim.datagrid.filter; import gridsim.datagrid.FileAttribute; Modified: trunk/source/gridsim/datagrid/filter/FilterDataResult.java =================================================================== --- trunk/source/gridsim/datagrid/filter/FilterDataResult.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/filter/FilterDataResult.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,6 +3,8 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ package gridsim.datagrid.filter; Modified: trunk/source/gridsim/datagrid/index/AbstractRC.java =================================================================== --- trunk/source/gridsim/datagrid/index/AbstractRC.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/index/AbstractRC.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,7 +3,10 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ + package gridsim.datagrid.index; import eduni.simjava.*; Modified: trunk/source/gridsim/datagrid/index/DataGIS.java =================================================================== --- trunk/source/gridsim/datagrid/index/DataGIS.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/index/DataGIS.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,7 +3,10 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ + package gridsim.datagrid.index; import eduni.simjava.Sim_event; Modified: trunk/source/gridsim/datagrid/index/DataRegionalGIS.java =================================================================== --- trunk/source/gridsim/datagrid/index/DataRegionalGIS.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/index/DataRegionalGIS.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,7 +3,10 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ + package gridsim.datagrid.index; import eduni.simjava.*; Modified: trunk/source/gridsim/datagrid/index/RegionalRC.java =================================================================== --- trunk/source/gridsim/datagrid/index/RegionalRC.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/index/RegionalRC.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,7 +3,10 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ + package gridsim.datagrid.index; import java.util.*; Modified: trunk/source/gridsim/datagrid/index/TopRegionalRC.java =================================================================== --- trunk/source/gridsim/datagrid/index/TopRegionalRC.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/index/TopRegionalRC.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,7 +3,10 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ + package gridsim.datagrid.index; import java.util.*; Modified: trunk/source/gridsim/datagrid/storage/HarddriveStorage.java =================================================================== --- trunk/source/gridsim/datagrid/storage/HarddriveStorage.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/storage/HarddriveStorage.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,7 +3,10 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ + package gridsim.datagrid.storage; import gridsim.datagrid.File; Modified: trunk/source/gridsim/datagrid/storage/Storage.java =================================================================== --- trunk/source/gridsim/datagrid/storage/Storage.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/storage/Storage.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,7 +3,10 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ + package gridsim.datagrid.storage; import gridsim.datagrid.File; Modified: trunk/source/gridsim/datagrid/storage/TapeStorage.java =================================================================== --- trunk/source/gridsim/datagrid/storage/TapeStorage.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/storage/TapeStorage.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,7 +3,10 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ + package gridsim.datagrid.storage; import gridsim.datagrid.File; Modified: trunk/source/gridsim/filter/FilterCreateAR.java =================================================================== --- trunk/source/gridsim/filter/FilterCreateAR.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/filter/FilterCreateAR.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: FilterCreateAR.java,v 1.2 2005/03/10 04:35:17 anthony Exp $ + * Copyright (c) 2005, The University of Melbourne, Australia */ package gridsim.filter; Modified: trunk/source/gridsim/filter/FilterGridlet.java =================================================================== --- trunk/source/gridsim/filter/FilterGridlet.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/filter/FilterGridlet.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: FilterGridlet.java,v 1.3 2005/03/10 04:35:17 anthony Exp $ + * Copyright (c) 2005, The University of Melbourne, Australia */ package gridsim.filter; Modified: trunk/source/gridsim/filter/FilterQueryTimeAR.java =================================================================== --- trunk/source/gridsim/filter/FilterQueryTimeAR.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/filter/FilterQueryTimeAR.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: FilterQueryTimeAR.java,v 1.2 2005/03/10 04:35:17 anthony Exp $ + * Copyright (c) 2005, The University of Melbourne, Australia */ package gridsim.filter; Modified: trunk/source/gridsim/filter/FilterResult.java =================================================================== --- trunk/source/gridsim/filter/FilterResult.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/filter/FilterResult.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: FilterResult.java,v 1.3 2005/03/10 04:35:17 anthony Exp $ + * Copyright (c) 2005, The University of Melbourne, Australia */ package gridsim.filter; Modified: trunk/source/gridsim/index/AbstractGIS.java =================================================================== --- trunk/source/gridsim/index/AbstractGIS.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/index/AbstractGIS.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: AbstractGIS.java,v 1.8 2007/08/30 01:38:43 anthony Exp $ + * Copyright (c) 2005, The University of Melbourne, Australia */ package gridsim.index; Modified: trunk/source/gridsim/index/RegionalGIS.java =================================================================== --- trunk/source/gridsim/index/RegionalGIS.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/index/RegionalGIS.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: RegionalGIS.java,v 1.8 2006/01/17 01:30:24 anthony Exp $ + * Copyright (c) 2005, The University of Melbourne, Australia */ package gridsim.index; Modified: trunk/source/gridsim/net/FIFOScheduler.java =================================================================== --- trunk/source/gridsim/net/FIFOScheduler.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/net/FIFOScheduler.java 2008-08-04 02:39:22 UTC (rev 198) @@ -8,7 +8,8 @@ * August 2004 * * Licence: GPL - http://www.gnu.org/copyleft/gpl.html - * + * Copyright (c) 2004, The University of Melbourne, Australia and National + * University of Singapore * FIFOScheduler.java - Implements a First in First Out scheduler * */ Modified: trunk/source/gridsim/net/FloodAdPack.java =================================================================== --- trunk/source/gridsim/net/FloodAdPack.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/net/FloodAdPack.java 2008-08-04 02:39:22 UTC (rev 198) @@ -8,7 +8,8 @@ * September 2004 * * Licence: GPL - http://www.gnu.org/copyleft/gpl.html - * + * Copyright (c) 2004, The University of Melbourne, Australia and National + * University of Singapore * FloodAdPack.java - Used to send route advertisements * */ Modified: trunk/source/gridsim/net/FloodingRouter.java =================================================================== --- trunk/source/gridsim/net/FloodingRouter.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/net/FloodingRouter.java 2008-08-04 02:39:22 UTC (rev 198) @@ -8,7 +8,8 @@ * August 2004 * * Licence: GPL - http://www.gnu.org/copyleft/gpl.html - * + * Copyright (c) 2004, The University of Melbourne, Australia and National + * University of Singapore * FloodingRouter.java - Simulates a network router with Flooding as * the advertising protocol * @@ -43,7 +44,6 @@ private Hashtable routerTable; private Hashtable forwardTable; private int id; - private static final int BITS = 8; // 1 byte in bits /** @@ -342,10 +342,10 @@ if (sched.size() == 0) { if (numPackets == 1) { - nextTime = (pkt.getSize() * BITS) / sched.getBaudRate(); + nextTime = (pkt.getSize() * NetIO.BITS) / sched.getBaudRate(); } else { - nextTime = (MTU * BITS * 1.0) / sched.getBaudRate(); + nextTime = (MTU * NetIO.BITS * 1.0) / sched.getBaudRate(); } sendInternalEvent(nextTime, sched); @@ -368,14 +368,18 @@ pkt.getNetServiceType(), i+1, numPackets); np.setLast(id); - super.write("enqueing, " + np); + if (super.reportWriter_ != null) { + 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() - MTU * (numPackets - 1)); - super.write("enqueing, " + pkt); + if (super.reportWriter_ != null) { + super.write("enqueing, " + pkt); + } sched.enque(pkt); // put the packet into the scheduler } @@ -519,7 +523,9 @@ ((InfoPacket) np).addExitTime( GridSim.clock() ); } - ... [truncated message content] |
From: <sul...@us...> - 2008-08-31 07:16:40
|
Revision: 238 http://gridsim.svn.sourceforge.net/gridsim/?rev=238&view=rev Author: sulistio Date: 2008-08-31 07:16:49 +0000 (Sun, 31 Aug 2008) Log Message: ----------- change from DOS formatting to UNIX Modified Paths: -------------- trunk/source/gridsim/auction/Auction.java trunk/source/gridsim/auction/AuctionObserver.java trunk/source/gridsim/auction/AuctionTags.java trunk/source/gridsim/auction/Auctioneer.java trunk/source/gridsim/auction/ContinuousDoubleAuction.java trunk/source/gridsim/auction/DoubleAuction.java trunk/source/gridsim/auction/DutchAuction.java trunk/source/gridsim/auction/EnglishAuction.java trunk/source/gridsim/auction/FirstPriceSealedBidAuction.java trunk/source/gridsim/auction/Message.java trunk/source/gridsim/auction/MessageAsk.java trunk/source/gridsim/auction/MessageBid.java trunk/source/gridsim/auction/MessageCallForBids.java trunk/source/gridsim/auction/MessageInformOutcome.java trunk/source/gridsim/auction/MessageInformStart.java trunk/source/gridsim/auction/MessageRejectBid.java trunk/source/gridsim/auction/MessageRejectCallForBid.java trunk/source/gridsim/auction/OneSidedAuction.java trunk/source/gridsim/auction/Responder.java trunk/source/gridsim/auction/ReverseDutchAuction.java trunk/source/gridsim/auction/ReverseEnglishAuction.java trunk/source/gridsim/auction/ReverseFirstPriceSealedBidAuction.java trunk/source/gridsim/datagrid/index/AbstractRC.java trunk/source/gridsim/datagrid/index/RegionalRC.java trunk/source/gridsim/net/RateControlledScheduler.java Modified: trunk/source/gridsim/auction/Auction.java =================================================================== --- trunk/source/gridsim/auction/Auction.java 2008-08-23 06:55:34 UTC (rev 237) +++ trunk/source/gridsim/auction/Auction.java 2008-08-31 07:16:49 UTC (rev 238) @@ -1,359 +1,359 @@ -/* - * Title: GridSim Toolkit - * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation - * of Parallel and Distributed Systems such as Clusters and Grids - * Licence: GPL - http://www.gnu.org/copyleft/gpl.html - * - * Copyright (c) 2006, The University of Melbourne, Australia - */ -package gridsim.auction; - -import eduni.simjava.Sim_event; -import eduni.simjava.Sim_port; -import eduni.simjava.Sim_system; -import gridsim.GridSim; -import gridsim.GridSimTags; -import gridsim.IO_data; - -import java.util.Hashtable; -import java.util.LinkedList; - -/** - * This class represents an auction. This is class has generic - * attributes common to all auctions - * - * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.0 - * @see gridsim.auction.OneSidedAuction - * @see gridsim.auction.DoubleAuction - * @see gridsim.auction.AuctionTags - */ -public abstract class Auction extends GridSim { - /* - * TODO: Maybe this class does not need to extend GridSim. It could extend - * just Sim_entity. However, to make my experiments easier, I ended up - * extending GridSim. - * - */ - - private int auctionID = -1; - - //starting simulation time - private double startingTime; - - //code of the kind of auction protocol - private int auctionProtocol; - - //additional attributes that need to be assigned to the auction - private Hashtable attributes; - - //list of current bidders engaged in the auction - private LinkedList bidders; - - //used to auto generate auction id - private static int currentID = 0; - - /* The AuctionPolicy will send messages on behalf of the auctioneer, therefore - * it is necessary to specify the auxtioneer's id, so the reply messages - * can be returned to the auctioneer - */ - private int auctioneerID = -1; - - /** - * The Auction output port. This port is mainly used to send - * messages generated by this Auction class. - * This is because an Auction class has to send messages - * on the auctioneer's behalf - */ - protected Sim_port outputPort = null; - - /** - * Default constructor - * @param auctionName name for the auction - * @param auctioneerID the ID of the auctioner because the auction sends messages - * on the auctioneer's behalf - * @param auctionProtocol an int representing the auction protocol - * @param output the auctioneer's output port - * @throws Exception - * @see gridsim.GridSim - */ - public Auction( String auctionName, int auctioneerID, - int auctionProtocol, Sim_port output)throws Exception { - super(auctionName); - this.auctioneerID = auctioneerID; - this.attributes = new Hashtable(); - this.outputPort = output; - setAuctionProtocol(auctionProtocol); - this.auctionID = Auction.genID(); - /* - * TODO: To create a report with information about the auction - */ - } - - /** - * Constructor - * @param auctionName name for the auction - * on the auctioneer's behalf - * @param auctionProtocol an int representing the auction protocol - * @throws Exception - * @see gridsim.GridSim - */ - public Auction( String auctionName, int auctionProtocol)throws Exception { - super(auctionName); - this.attributes = new Hashtable(); - setAuctionProtocol(auctionProtocol); - this.auctionID = Auction.genID(); - /* - * TODO: To create a report with information about the auction - */ - } - - /** - * Returns the auctioneer ID - * @return the ID of a GridSim entity - */ - public int getAuctioneerID(){ - return auctioneerID; - } - - /** - * Sets the id of the auctioneer responsible for this auction - * @param auctioneerID the auctioneer ID - * @return <tt>true</tt> if the id was properly set - */ - public boolean setAuctioneerID(int auctioneerID){ - if(auctioneerID >= 0){ - this.auctioneerID = auctioneerID; - return true; - } - return false; - } - - /** - * Sets the output port to be used by this auction. The output port - * is the auctioneer's output port since the auction sends messages - * on the auctioneer's behalf - * @param output the port to be used - * @return <tt>true</tt> if the output port was properly set - */ - public boolean setOutputPort(Sim_port output){ - if(output!=null){ - this.outputPort = output; - return true; - } - return false; - } - - // Used just to generate a unique ID - //TODO: It might not be necessary, the ID could be the entity's ID - private synchronized static int genID(){ - return currentID++; - } - - /** - * Sets the auction's ID manually - * @param id the id to be used by the auction - * @return <tt>true</tt> if the ID has been set; <tt>false</tt> otherwise. - */ - public boolean setAuctionID(int id) { - if(id < 0) - return false; - - auctionID = id; - return true; - } - - /** - * Returns the ID of this auction - * @return auction ID - */ - public int getAuctionID(){ - return auctionID; - } - - /** - * Sets a list of the bidders associated with this auction - * @param list of bidders. The IDs must be entities' ids - * @pre list != null - * @return <tt>true</tt> if the bidders were correctly set - */ - public boolean setBidders(LinkedList list){ - if(list == null) - return false; - - synchronized(this){ - this.bidders = list; - } - return true; - } - - /** - * Returns the list of bidders - * @return list of GridSim entities' IDs - */ - public LinkedList getBidders(){ - synchronized(this){ - return this.bidders; - } - } - - /** - * Returns the output port used by this auction - * to send messages - * @return the output port - */ - protected Sim_port getOutputPort(){ - return this.outputPort; - } - - /** - * Sets an attribute to this auction. Anything additional has to - * be set as an attribute of the auction. - * @param key the key used to retrieve the value of the attribute - * @param value the value of the attribute - * @pre key != null && value !=null - * @return <tt>true</tt> if the value of the attribute was correctly set - */ - public boolean setAttribute(Object key, Object value){ - if(key == null || value == null) - return false; - - attributes.put(key, value); - return true; - } - - /** - * Returns a Hashtable with the attributes defined in the - * auction. - * @return the attributes defined in this auction - */ - protected Hashtable getAttributes(){ - return attributes; - } - - /** - * Returns a given attribute of the auction - * @param key used to retrieve the attribute - * @return the attribute - */ - public Object getAttribute(Object key){ - return attributes.get(key); - } - - /** - * Sets the auction protocol used by the auction - * @param protocol - * @pre protocol > 0 - * @return <tt>true</tt> if the the auction protocol was properly set - */ - protected boolean setAuctionProtocol(int protocol){ - if(protocol <= 0) - return false; - - auctionProtocol = protocol; - return true; - } - - /** - * Returns the auction protocol - * @return int representing the auction protocol - */ - protected int getAuctionProtocol(){ - return auctionProtocol; - } - - /** - * Sets the initial time of the auction - * @param time is the simulation time - * @pre time >= 0.0D - * @return <tt>true</tt> if the starting time was properly set - */ - protected boolean setStartingTime(double time){ - if(time < 0) - return false; - - startingTime = time; - return true; - } - - /** - * Returns the initial time of the auction - * @return the simulation time in which the auction started - */ - public double getStartingTime(){ - return startingTime; - } - - /** - * Brodcasts a message to all bidders engaged in the auction - * @param msg Message to be broadcast - * @pre Message != null - * @return <tt>true</tt> if the message was properly broadcast - */ - protected synchronized boolean broadcastMessage(Message msg){ - if(msg == null) - return false; - - msg.setSourceID(this.auctioneerID); - msg.setDestinationID(Message.TO_ALL_BIDDERS); - msg.setAuctionID(this.auctionID); - - int tag = -1; - int nBidders = bidders.size(); - if( msg instanceof MessageCallForBids){ - tag = AuctionTags.AUCTION_CFP; - } - else if( msg instanceof MessageInformStart){ - tag = AuctionTags.AUCTION_INFORM_START; - } - else if( msg instanceof MessageInformOutcome){ - tag = AuctionTags.AUCTION_INFORM_OUTCOME; - } - - /* TODO: - * For now, we are assuming that every message has a size of about 100 bytes. - * It would be better to consider some FIPA's encoding schema, for example. - * Please see: www.fipa.org - */ - for(int i=0; i<nBidders; i++){ - int destId = ((Integer)bidders.get(i)).intValue(); - super.sim_schedule(this.outputPort, GridSimTags.SCHEDULE_NOW, - tag, new IO_data(msg, 100, destId)); - } - - return true; - } - - /** - * - */ - public void body(){ - // Process events until END_OF_SIMULATION is received from the - // GridSimShutdown Entity - - Sim_event ev = new Sim_event(); - while ( Sim_system.running() ) - { - super.sim_get_next(ev); - - // if the simulation finishes then exit the loop - if (ev.get_tag() == GridSimTags.END_OF_SIMULATION || - ev.get_tag() == AuctionTags.END_OF_AUCTION){ - break; - } - - // process the received event - processEvent(ev); - } - - // remove I/O entities created during construction of this entity - super.terminateIOEntities(); - } - - protected abstract void processEvent(Sim_event ev); - - /** - * - */ - public abstract void startAuction(); -} +/* + * Title: GridSim Toolkit + * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation + * of Parallel and Distributed Systems such as Clusters and Grids + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * + * Copyright (c) 2006, The University of Melbourne, Australia + */ +package gridsim.auction; + +import eduni.simjava.Sim_event; +import eduni.simjava.Sim_port; +import eduni.simjava.Sim_system; +import gridsim.GridSim; +import gridsim.GridSimTags; +import gridsim.IO_data; + +import java.util.Hashtable; +import java.util.LinkedList; + +/** + * This class represents an auction. This is class has generic + * attributes common to all auctions + * + * @author Marcos Dias de Assuncao + * @since GridSim Toolkit 4.0 + * @see gridsim.auction.OneSidedAuction + * @see gridsim.auction.DoubleAuction + * @see gridsim.auction.AuctionTags + */ +public abstract class Auction extends GridSim { + /* + * TODO: Maybe this class does not need to extend GridSim. It could extend + * just Sim_entity. However, to make my experiments easier, I ended up + * extending GridSim. + * + */ + + private int auctionID = -1; + + //starting simulation time + private double startingTime; + + //code of the kind of auction protocol + private int auctionProtocol; + + //additional attributes that need to be assigned to the auction + private Hashtable attributes; + + //list of current bidders engaged in the auction + private LinkedList bidders; + + //used to auto generate auction id + private static int currentID = 0; + + /* The AuctionPolicy will send messages on behalf of the auctioneer, therefore + * it is necessary to specify the auxtioneer's id, so the reply messages + * can be returned to the auctioneer + */ + private int auctioneerID = -1; + + /** + * The Auction output port. This port is mainly used to send + * messages generated by this Auction class. + * This is because an Auction class has to send messages + * on the auctioneer's behalf + */ + protected Sim_port outputPort = null; + + /** + * Default constructor + * @param auctionName name for the auction + * @param auctioneerID the ID of the auctioner because the auction sends messages + * on the auctioneer's behalf + * @param auctionProtocol an int representing the auction protocol + * @param output the auctioneer's output port + * @throws Exception + * @see gridsim.GridSim + */ + public Auction( String auctionName, int auctioneerID, + int auctionProtocol, Sim_port output)throws Exception { + super(auctionName); + this.auctioneerID = auctioneerID; + this.attributes = new Hashtable(); + this.outputPort = output; + setAuctionProtocol(auctionProtocol); + this.auctionID = Auction.genID(); + /* + * TODO: To create a report with information about the auction + */ + } + + /** + * Constructor + * @param auctionName name for the auction + * on the auctioneer's behalf + * @param auctionProtocol an int representing the auction protocol + * @throws Exception + * @see gridsim.GridSim + */ + public Auction( String auctionName, int auctionProtocol)throws Exception { + super(auctionName); + this.attributes = new Hashtable(); + setAuctionProtocol(auctionProtocol); + this.auctionID = Auction.genID(); + /* + * TODO: To create a report with information about the auction + */ + } + + /** + * Returns the auctioneer ID + * @return the ID of a GridSim entity + */ + public int getAuctioneerID(){ + return auctioneerID; + } + + /** + * Sets the id of the auctioneer responsible for this auction + * @param auctioneerID the auctioneer ID + * @return <tt>true</tt> if the id was properly set + */ + public boolean setAuctioneerID(int auctioneerID){ + if(auctioneerID >= 0){ + this.auctioneerID = auctioneerID; + return true; + } + return false; + } + + /** + * Sets the output port to be used by this auction. The output port + * is the auctioneer's output port since the auction sends messages + * on the auctioneer's behalf + * @param output the port to be used + * @return <tt>true</tt> if the output port was properly set + */ + public boolean setOutputPort(Sim_port output){ + if(output!=null){ + this.outputPort = output; + return true; + } + return false; + } + + // Used just to generate a unique ID + //TODO: It might not be necessary, the ID could be the entity's ID + private synchronized static int genID(){ + return currentID++; + } + + /** + * Sets the auction's ID manually + * @param id the id to be used by the auction + * @return <tt>true</tt> if the ID has been set; <tt>false</tt> otherwise. + */ + public boolean setAuctionID(int id) { + if(id < 0) + return false; + + auctionID = id; + return true; + } + + /** + * Returns the ID of this auction + * @return auction ID + */ + public int getAuctionID(){ + return auctionID; + } + + /** + * Sets a list of the bidders associated with this auction + * @param list of bidders. The IDs must be entities' ids + * @pre list != null + * @return <tt>true</tt> if the bidders were correctly set + */ + public boolean setBidders(LinkedList list){ + if(list == null) + return false; + + synchronized(this){ + this.bidders = list; + } + return true; + } + + /** + * Returns the list of bidders + * @return list of GridSim entities' IDs + */ + public LinkedList getBidders(){ + synchronized(this){ + return this.bidders; + } + } + + /** + * Returns the output port used by this auction + * to send messages + * @return the output port + */ + protected Sim_port getOutputPort(){ + return this.outputPort; + } + + /** + * Sets an attribute to this auction. Anything additional has to + * be set as an attribute of the auction. + * @param key the key used to retrieve the value of the attribute + * @param value the value of the attribute + * @pre key != null && value !=null + * @return <tt>true</tt> if the value of the attribute was correctly set + */ + public boolean setAttribute(Object key, Object value){ + if(key == null || value == null) + return false; + + attributes.put(key, value); + return true; + } + + /** + * Returns a Hashtable with the attributes defined in the + * auction. + * @return the attributes defined in this auction + */ + protected Hashtable getAttributes(){ + return attributes; + } + + /** + * Returns a given attribute of the auction + * @param key used to retrieve the attribute + * @return the attribute + */ + public Object getAttribute(Object key){ + return attributes.get(key); + } + + /** + * Sets the auction protocol used by the auction + * @param protocol + * @pre protocol > 0 + * @return <tt>true</tt> if the the auction protocol was properly set + */ + protected boolean setAuctionProtocol(int protocol){ + if(protocol <= 0) + return false; + + auctionProtocol = protocol; + return true; + } + + /** + * Returns the auction protocol + * @return int representing the auction protocol + */ + protected int getAuctionProtocol(){ + return auctionProtocol; + } + + /** + * Sets the initial time of the auction + * @param time is the simulation time + * @pre time >= 0.0D + * @return <tt>true</tt> if the starting time was properly set + */ + protected boolean setStartingTime(double time){ + if(time < 0) + return false; + + startingTime = time; + return true; + } + + /** + * Returns the initial time of the auction + * @return the simulation time in which the auction started + */ + public double getStartingTime(){ + return startingTime; + } + + /** + * Brodcasts a message to all bidders engaged in the auction + * @param msg Message to be broadcast + * @pre Message != null + * @return <tt>true</tt> if the message was properly broadcast + */ + protected synchronized boolean broadcastMessage(Message msg){ + if(msg == null) + return false; + + msg.setSourceID(this.auctioneerID); + msg.setDestinationID(Message.TO_ALL_BIDDERS); + msg.setAuctionID(this.auctionID); + + int tag = -1; + int nBidders = bidders.size(); + if( msg instanceof MessageCallForBids){ + tag = AuctionTags.AUCTION_CFP; + } + else if( msg instanceof MessageInformStart){ + tag = AuctionTags.AUCTION_INFORM_START; + } + else if( msg instanceof MessageInformOutcome){ + tag = AuctionTags.AUCTION_INFORM_OUTCOME; + } + + /* TODO: + * For now, we are assuming that every message has a size of about 100 bytes. + * It would be better to consider some FIPA's encoding schema, for example. + * Please see: www.fipa.org + */ + for(int i=0; i<nBidders; i++){ + int destId = ((Integer)bidders.get(i)).intValue(); + super.sim_schedule(this.outputPort, GridSimTags.SCHEDULE_NOW, + tag, new IO_data(msg, 100, destId)); + } + + return true; + } + + /** + * + */ + public void body(){ + // Process events until END_OF_SIMULATION is received from the + // GridSimShutdown Entity + + Sim_event ev = new Sim_event(); + while ( Sim_system.running() ) + { + super.sim_get_next(ev); + + // if the simulation finishes then exit the loop + if (ev.get_tag() == GridSimTags.END_OF_SIMULATION || + ev.get_tag() == AuctionTags.END_OF_AUCTION){ + break; + } + + // process the received event + processEvent(ev); + } + + // remove I/O entities created during construction of this entity + super.terminateIOEntities(); + } + + protected abstract void processEvent(Sim_event ev); + + /** + * + */ + public abstract void startAuction(); +} Modified: trunk/source/gridsim/auction/AuctionObserver.java =================================================================== --- trunk/source/gridsim/auction/AuctionObserver.java 2008-08-23 06:55:34 UTC (rev 237) +++ trunk/source/gridsim/auction/AuctionObserver.java 2008-08-31 07:16:49 UTC (rev 238) @@ -1,197 +1,197 @@ -/* - * Title: GridSim Toolkit - * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation - * of Parallel and Distributed Systems such as Clusters and Grids - * Licence: GPL - http://www.gnu.org/copyleft/gpl.html - * - * Copyright (c) 2006, The University of Melbourne, Australia - */ -package gridsim.auction; - -import eduni.simjava.Sim_event; -import eduni.simjava.Sim_port; -import eduni.simjava.Sim_system; -import gridsim.GridSim; -import gridsim.GridSimTags; -import gridsim.IO_data; - -/** - * This class is used by entities that want to participate - * as bidders in auctions. - * <p> - * To use this class, you need to redirect the events that - * the entity cannot treat. You need to call - * {@link #processEvent(Sim_event)} passing the event that - * the entity is not able to process. If the event is related - * to the auctions (ie. has a tag code corresponding to an auction event) - * the observer is able to process it by passing the message - * to its Responder. - * - * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.0 - * @see gridsim.auction.Responder - */ -public class AuctionObserver extends GridSim { - private Responder responder; - private int bidderID; - private Object syncSteps = new Object(); - - /** The Bidder output port. This port is mainly used to send - * messages generated by this AuctionObserver class. - * This is because an AuctionObserver class doesn't have networked - * entities (Input and Output). - */ - protected Sim_port outputPort; - - /** - * Constructor - * @param bidderID the bidder if, since it sends messages on the bidder's behalf - * @param entityName a name for this entity - * @param port the port to be used as output of messages - * @throws Exception - */ - public AuctionObserver(int bidderID, String entityName, Sim_port port) throws Exception { - super(bidderID + "_" + entityName); - this.bidderID = bidderID; - this.outputPort = port; - } - - /** - * Constructor - * @param bidderID the bidder if, since it sends messages on the bidder's behalf - * @param entityName entityName a name for this entity - * @param responder the responder which will deal with the messages - * that this responder receives - * @param port the port to be used as output of messages - * @throws Exception - */ - public AuctionObserver(int bidderID, String entityName, Sim_port port, - Responder responder) throws Exception { - this(bidderID, entityName, port); - this.responder = responder; - } - - /** - * Sets a responder to this observer - * @param responder the responder - * @pre responder != null - * @return <tt>true</tt> if the responder was correctly set - */ - public boolean setResponder(Responder responder){ - if(responder == null) - return false; - - this.responder = responder; - return true; - } - - /** - * Returns the responder that the observer is using - * @return the responder - */ - public Responder getResponder(){ - return responder; - } - - /** - * - */ - public void body(){ - // Process events until END_OF_SIMULATION is received from the - // GridSimShutdown Entity - - Sim_event ev = new Sim_event(); - while ( Sim_system.running() ) - { - super.sim_get_next(ev); - - // if the simulation finishes then exit the loop - if (ev.get_tag() == GridSimTags.END_OF_SIMULATION){ - break; - } - - // process the received event - processEvent(ev); - } - - // remove I/O entities created during construction of this entity - super.terminateIOEntities(); - - } - - - /** - * Process an event. - * @param ev - * @return <tt>true</tt> if the event was treated; <tt>false</tt> otherwise. - */ - public boolean processEvent(Sim_event ev){ - int src_id = -1; - Message msg = null; - Message respMsg = null; - - if (responder == null){ - System.out.println("No responder to deal with auction messages!"); - return false; - } - - switch ( ev.get_tag() ){ - case AuctionTags.AUCTION_INFORM_START: - msg = (Message)ev.get_data(); - src_id = msg.getSourceID(); - synchronized(syncSteps){ - respMsg = responder.onReceiveStartAuction((MessageInformStart)msg); - } - break; - - case AuctionTags.AUCTION_CFP: - msg = (Message)ev.get_data(); - src_id = msg.getSourceID(); - synchronized(syncSteps){ - respMsg = responder.onReceiveCfb((MessageCallForBids)msg); - } - break; - - case AuctionTags.AUCTION_INFORM_OUTCOME: - msg = (Message)ev.get_data(); - src_id = msg.getSourceID(); - synchronized(syncSteps){ - respMsg = responder.onReceiveInformOutcome((MessageInformOutcome)msg); - } - break; - - case AuctionTags.AUCTION_REJECT_PROPOSAL: - msg = (Message)ev.get_data(); - src_id = msg.getSourceID(); - synchronized(syncSteps){ - respMsg = responder.onReceiveRejectProposal((MessageRejectBid)msg); - } - break; - - // other unknown tags are processed by this method - default: - return false; - } - - if(respMsg!=null){ - respMsg.setDestinationID(src_id); - - int tag = - 1; - if(respMsg instanceof MessageBid){ - tag = AuctionTags.AUCTION_PROPOSE; - ((MessageBid)respMsg).setBidder(this.bidderID); - } - else if(respMsg instanceof MessageRejectCallForBid){ - tag = AuctionTags.AUCTION_REJECT_CALL_FOR_BID; - ((MessageRejectCallForBid)respMsg).setBidder(this.bidderID); - } - - double scheduleAt = (respMsg.getScheduleTime() > 0.0) ? - respMsg.getScheduleTime() : GridSimTags.SCHEDULE_NOW; - - super.sim_schedule(this.outputPort, scheduleAt, - tag, new IO_data(respMsg, 100, src_id)); - } - return true; - } -} +/* + * Title: GridSim Toolkit + * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation + * of Parallel and Distributed Systems such as Clusters and Grids + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * + * Copyright (c) 2006, The University of Melbourne, Australia + */ +package gridsim.auction; + +import eduni.simjava.Sim_event; +import eduni.simjava.Sim_port; +import eduni.simjava.Sim_system; +import gridsim.GridSim; +import gridsim.GridSimTags; +import gridsim.IO_data; + +/** + * This class is used by entities that want to participate + * as bidders in auctions. + * <p> + * To use this class, you need to redirect the events that + * the entity cannot treat. You need to call + * {@link #processEvent(Sim_event)} passing the event that + * the entity is not able to process. If the event is related + * to the auctions (ie. has a tag code corresponding to an auction event) + * the observer is able to process it by passing the message + * to its Responder. + * + * @author Marcos Dias de Assuncao + * @since GridSim Toolkit 4.0 + * @see gridsim.auction.Responder + */ +public class AuctionObserver extends GridSim { + private Responder responder; + private int bidderID; + private Object syncSteps = new Object(); + + /** The Bidder output port. This port is mainly used to send + * messages generated by this AuctionObserver class. + * This is because an AuctionObserver class doesn't have networked + * entities (Input and Output). + */ + protected Sim_port outputPort; + + /** + * Constructor + * @param bidderID the bidder if, since it sends messages on the bidder's behalf + * @param entityName a name for this entity + * @param port the port to be used as output of messages + * @throws Exception + */ + public AuctionObserver(int bidderID, String entityName, Sim_port port) throws Exception { + super(bidderID + "_" + entityName); + this.bidderID = bidderID; + this.outputPort = port; + } + + /** + * Constructor + * @param bidderID the bidder if, since it sends messages on the bidder's behalf + * @param entityName entityName a name for this entity + * @param responder the responder which will deal with the messages + * that this responder receives + * @param port the port to be used as output of messages + * @throws Exception + */ + public AuctionObserver(int bidderID, String entityName, Sim_port port, + Responder responder) throws Exception { + this(bidderID, entityName, port); + this.responder = responder; + } + + /** + * Sets a responder to this observer + * @param responder the responder + * @pre responder != null + * @return <tt>true</tt> if the responder was correctly set + */ + public boolean setResponder(Responder responder){ + if(responder == null) + return false; + + this.responder = responder; + return true; + } + + /** + * Returns the responder that the observer is using + * @return the responder + */ + public Responder getResponder(){ + return responder; + } + + /** + * + */ + public void body(){ + // Process events until END_OF_SIMULATION is received from the + // GridSimShutdown Entity + + Sim_event ev = new Sim_event(); + while ( Sim_system.running() ) + { + super.sim_get_next(ev); + + // if the simulation finishes then exit the loop + if (ev.get_tag() == GridSimTags.END_OF_SIMULATION){ + break; + } + + // process the received event + processEvent(ev); + } + + // remove I/O entities created during construction of this entity + super.terminateIOEntities(); + + } + + + /** + * Process an event. + * @param ev + * @return <tt>true</tt> if the event was treated; <tt>false</tt> otherwise. + */ + public boolean processEvent(Sim_event ev){ + int src_id = -1; + Message msg = null; + Message respMsg = null; + + if (responder == null){ + System.out.println("No responder to deal with auction messages!"); + return false; + } + + switch ( ev.get_tag() ){ + case AuctionTags.AUCTION_INFORM_START: + msg = (Message)ev.get_data(); + src_id = msg.getSourceID(); + synchronized(syncSteps){ + respMsg = responder.onReceiveStartAuction((MessageInformStart)msg); + } + break; + + case AuctionTags.AUCTION_CFP: + msg = (Message)ev.get_data(); + src_id = msg.getSourceID(); + synchronized(syncSteps){ + respMsg = responder.onReceiveCfb((MessageCallForBids)msg); + } + break; + + case AuctionTags.AUCTION_INFORM_OUTCOME: + msg = (Message)ev.get_data(); + src_id = msg.getSourceID(); + synchronized(syncSteps){ + respMsg = responder.onReceiveInformOutcome((MessageInformOutcome)msg); + } + break; + + case AuctionTags.AUCTION_REJECT_PROPOSAL: + msg = (Message)ev.get_data(); + src_id = msg.getSourceID(); + synchronized(syncSteps){ + respMsg = responder.onReceiveRejectProposal((MessageRejectBid)msg); + } + break; + + // other unknown tags are processed by this method + default: + return false; + } + + if(respMsg!=null){ + respMsg.setDestinationID(src_id); + + int tag = - 1; + if(respMsg instanceof MessageBid){ + tag = AuctionTags.AUCTION_PROPOSE; + ((MessageBid)respMsg).setBidder(this.bidderID); + } + else if(respMsg instanceof MessageRejectCallForBid){ + tag = AuctionTags.AUCTION_REJECT_CALL_FOR_BID; + ((MessageRejectCallForBid)respMsg).setBidder(this.bidderID); + } + + double scheduleAt = (respMsg.getScheduleTime() > 0.0) ? + respMsg.getScheduleTime() : GridSimTags.SCHEDULE_NOW; + + super.sim_schedule(this.outputPort, scheduleAt, + tag, new IO_data(respMsg, 100, src_id)); + } + return true; + } +} Modified: trunk/source/gridsim/auction/AuctionTags.java =================================================================== --- trunk/source/gridsim/auction/AuctionTags.java 2008-08-23 06:55:34 UTC (rev 237) +++ trunk/source/gridsim/auction/AuctionTags.java 2008-08-31 07:16:49 UTC (rev 238) @@ -1,91 +1,91 @@ -/* - * Title: GridSim Toolkit - * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation - * of Parallel and Distributed Systems such as Clusters and Grids - * Licence: GPL - http://www.gnu.org/copyleft/gpl.html - * - * Copyright (c) 2006, The University of Melbourne, Australia - */ -package gridsim.auction; - -/** - * Contains various static command tags that indicate a type of action that - * needs to be undertaken by auction entities when they receive or send events. - * - * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.0 - * @see gridsim.auction.OneSidedAuction - * @see gridsim.auction.DoubleAuction - * @see gridsim.auction.AuctionTags - */ -public class AuctionTags { - - private static final int BASE = 900; - - /** Event used by messages that inform the start of an auction */ - public static final int AUCTION_INFORM_START = BASE + 1; - - /** Represents the rejects of a proposal */ - public static final int AUCTION_REJECT_CALL_FOR_BID = BASE + 2; - - /** It means a call for bids or proposals */ - public static final int AUCTION_CFP = BASE + 3; - - /** Proposal or bid */ - public static final int AUCTION_PROPOSE = BASE + 4; - - /** Represents an ask sent to an auctioneer */ - public static final int AUCTION_ASK = BASE + 5; - - /** Used to inform that a bid has been accepted */ - public static final int AUCTION_ACCEPT_PROPOSAL = BASE + 6; - - /** It is used to reject a proposal */ - public static final int AUCTION_REJECT_PROPOSAL = BASE + 7; - - /** This code is used to events that inform the final outcome of an auction */ - public static final int AUCTION_INFORM_OUTCOME = BASE + 8; - - /** Used to inform that a match for an ask has been found */ - public static final int AUCTION_MATCH_TO_ASK = BASE + 9; - - /** An auction must be post to an auctioneer. This event has this purpose. */ - public static final int AUCTION_POST = BASE + 10; - - /** Event code used to trigger or start an auction */ - public static final int AUCTION_START = BASE + 11; - - /** Event code used to inform auctioneer that an auction has finished */ - public static final int AUCTION_FINISHED = BASE + 12; - - /** Used to inform the auctioneer that an auction must be deleted */ - public static final int AUCTION_DELETE = BASE + 13; - - /** Used to stop an auction and to stop the execution of its <tt>body()</tt> method. */ - public static final int END_OF_AUCTION = BASE + 14; - - /** Internal event code internally by auctions to control timeout of rounds and auctions */ - public static final int AUCTION_TIMEOUT = BASE + 15; - - //Code for some kinds of auctions - /** This code is used by First-Price Sealed Bid auctions */ - public static final int FIRST_PRICE_SEALED_AUCTION = 1; - - /** This code is used by Reverse First-Price Sealed Bid auctions */ - public static final int REVERSE_FIRST_PRICE_SEALED_AUCTION = 2; - - /** This code is used by English auctions */ - public static final int ENGLISH_AUCTION = 3; - - /** This code is used by Reverse English auctions */ - public static final int REVERSE_ENGLISH_AUCTION = 4; - - /** This code is used by Dutch auctions */ - public static final int DUTCH_AUCTION = 5; - - /** This code is used by Reverse Dutch auctions */ - public static final int REVERSE_DUTCH_AUCTION = 6; - - /** This code is used by Continuous Double auctions */ - public static final int CONTINUOUS_DOUBLE_AUCTION = 7; -} +/* + * Title: GridSim Toolkit + * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation + * of Parallel and Distributed Systems such as Clusters and Grids + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * + * Copyright (c) 2006, The University of Melbourne, Australia + */ +package gridsim.auction; + +/** + * Contains various static command tags that indicate a type of action that + * needs to be undertaken by auction entities when they receive or send events. + * + * @author Marcos Dias de Assuncao + * @since GridSim Toolkit 4.0 + * @see gridsim.auction.OneSidedAuction + * @see gridsim.auction.DoubleAuction + * @see gridsim.auction.AuctionTags + */ +public class AuctionTags { + + private static final int BASE = 900; + + /** Event used by messages that inform the start of an auction */ + public static final int AUCTION_INFORM_START = BASE + 1; + + /** Represents the rejects of a proposal */ + public static final int AUCTION_REJECT_CALL_FOR_BID = BASE + 2; + + /** It means a call for bids or proposals */ + public static final int AUCTION_CFP = BASE + 3; + + /** Proposal or bid */ + public static final int AUCTION_PROPOSE = BASE + 4; + + /** Represents an ask sent to an auctioneer */ + public static final int AUCTION_ASK = BASE + 5; + + /** Used to inform that a bid has been accepted */ + public static final int AUCTION_ACCEPT_PROPOSAL = BASE + 6; + + /** It is used to reject a proposal */ + public static final int AUCTION_REJECT_PROPOSAL = BASE + 7; + + /** This code is used to events that inform the final outcome of an auction */ + public static final int AUCTION_INFORM_OUTCOME = BASE + 8; + + /** Used to inform that a match for an ask has been found */ + public static final int AUCTION_MATCH_TO_ASK = BASE + 9; + + /** An auction must be post to an auctioneer. This event has this purpose. */ + public static final int AUCTION_POST = BASE + 10; + + /** Event code used to trigger or start an auction */ + public static final int AUCTION_START = BASE + 11; + + /** Event code used to inform auctioneer that an auction has finished */ + public static final int AUCTION_FINISHED = BASE + 12; + + /** Used to inform the auctioneer that an auction must be deleted */ + public static final int AUCTION_DELETE = BASE + 13; + + /** Used to stop an auction and to stop the execution of its <tt>body()</tt> method. */ + public static final int END_OF_AUCTION = BASE + 14; + + /** Internal event code internally by auctions to control timeout of rounds and auctions */ + public static final int AUCTION_TIMEOUT = BASE + 15; + + //Code for some kinds of auctions + /** This code is used by First-Price Sealed Bid auctions */ + public static final int FIRST_PRICE_SEALED_AUCTION = 1; + + /** This code is used by Reverse First-Price Sealed Bid auctions */ + public static final int REVERSE_FIRST_PRICE_SEALED_AUCTION = 2; + + /** This code is used by English auctions */ + public static final int ENGLISH_AUCTION = 3; + + /** This code is used by Reverse English auctions */ + public static final int REVERSE_ENGLISH_AUCTION = 4; + + /** This code is used by Dutch auctions */ + public static final int DUTCH_AUCTION = 5; + + /** This code is used by Reverse Dutch auctions */ + public static final int REVERSE_DUTCH_AUCTION = 6; + + /** This code is used by Continuous Double auctions */ + public static final int CONTINUOUS_DOUBLE_AUCTION = 7; +} Modified: trunk/source/gridsim/auction/Auctioneer.java =================================================================== --- trunk/source/gridsim/auction/Auctioneer.java 2008-08-23 06:55:34 UTC (rev 237) +++ trunk/source/gridsim/auction/Auctioneer.java 2008-08-31 07:16:49 UTC (rev 238) @@ -1,295 +1,295 @@ -/* - * Title: GridSim Toolkit - * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation - * of Parallel and Distributed Systems such as Clusters and Grids - * Licence: GPL - http://www.gnu.org/copyleft/gpl.html - * - * Copyright (c) 2006, The University of Melbourne, Australia - */ -package gridsim.auction; - -import eduni.simjava.Sim_event; -import eduni.simjava.Sim_system; -import gridsim.GridSim; -import gridsim.GridSimTags; -import gridsim.net.Link; - -import java.util.Hashtable; -import java.util.LinkedList; - -/** - * This class defines the basic behavious of an auctioneer - * - * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.0 - * @see gridsim.GridSim - */ -public abstract class Auctioneer extends GridSim { - private Hashtable auctions; - private Object syncSteps = new Object(); - - /** - * Constructor - * @param name - * @throws Exception - */ - public Auctioneer(String name) throws Exception { - super(name); - auctions = new Hashtable(); - } - - /** - * Constructor - * @param name - * @param baudRate - * @throws Exception - */ - public Auctioneer(String name, double baudRate) throws Exception { - super(name, baudRate); - auctions = new Hashtable(); - } - - /** - * @param name - * @param link - * @throws Exception - */ - public Auctioneer(String name, Link link) throws Exception { - super(name, link); - auctions = new Hashtable(); - } - - /** - * Adds an auction to this auctioneer - * @param auction - */ - public void addAuction(Auction auction){ - Integer key = new Integer(auction.getAuctionID()); - synchronized(syncSteps){ - auctions.put(key, auction); - } - } - - /* - * Removes an auction that has finished - * @param auction the auction ID - */ - private void removeAuction(int auctionID){ - Integer key = new Integer(auctionID); - synchronized(syncSteps){ - Auction auc = (Auction)auctions.get(key); - auctions.remove(key); - super.send(auc.get_id(), - GridSimTags.SCHEDULE_NOW, - AuctionTags.END_OF_AUCTION); - } - } - - /** - * Starts a given auction already added to the auctioneer - * @param auctionID The auction's id - */ - public void startAuction(int auctionID){ - Integer key = new Integer(auctionID); - synchronized(syncSteps){ - Auction auction = (Auction)auctions.get(key); - if(auction!=null){ - super.send(auction.get_id(), - GridSimTags.SCHEDULE_NOW, - AuctionTags.AUCTION_START); - } - else - System.err.println("Auctioneer.startAution(): "+ - "This auction does not exist. Auction ID = " + auctionID); - } - } - - /** - * Handles external events that are coming to this Auctioneer entity. - * <p> - * The services or tags available for this resource are: - * <ul> - * <li> {@link gridsim.auction.AuctionTags#AUCTION_POST} </li> - * <li> {@link gridsim.auction.AuctionTags#AUCTION_START} </li> - * <li> {@link gridsim.auction.AuctionTags#AUCTION_DELETE} </li> - * <li> {$link gridsim.auction.AuctionTags#AUCTION_FINISHED} </li> - * <li> {@link gridsim.auction.AuctionTags#AUCTION_PROPOSE} </li> - * <li> {@link gridsim.auction.AuctionTags#AUCTION_REJECT_CALL_FOR_BID} </li> - * <li> {@link gridsim.auction.AuctionTags#AUCTION_ASK} </li> - * <li> {@link gridsim.auction.AuctionTags#AUCTION_MATCH_TO_ASK} </li> - * </ul> - * <br> - * This method also calls these methods in the following order: - * <ol> - * <li> {@link #processOtherEvent(Sim_event)} method - * </ol> - * - * @pre $none - * @post $none - */ - public void body(){ - // Process events until END_OF_SIMULATION is received from the - // GridSimShutdown Entity - - Sim_event ev = new Sim_event(); - while ( Sim_system.running() ) - { - super.sim_get_next(ev); - - // if the simulation finishes then exit the loop - if (ev.get_tag() == GridSimTags.END_OF_SIMULATION){ - break; - } - - // process the received event - processEvent(ev); - } - - // remove I/O entities created during construction of this entity - super.terminateIOEntities(); - } - - /** - * Processes events or services that are available to this Auctioneer - * @param ev a Sim_event object - * @pre ev != null - * @post $none - */ - private void processEvent(Sim_event ev) - { - Auction auc = null; - Message msg = null; - Integer auctionID = null; - - switch ( ev.get_tag() ) - { - case AuctionTags.AUCTION_POST: - auc = (Auction)ev.get_data(); - addAuction(auc); // just adds the auction in the hashtable - break; - - case AuctionTags.AUCTION_START: - auctionID = (Integer)ev.get_data(); - startAuction(auctionID.intValue()); // starts the auction that was previously added - break; - - case AuctionTags.AUCTION_DELETE: - auctionID = (Integer)ev.get_data(); - removeAuction(auctionID.intValue()); - break; - - case AuctionTags.AUCTION_FINISHED: - auc = (Auction)auctions.get((Integer)ev.get_data()); - synchronized(syncSteps){ - this.onAuctionClose(auc); - // trigger the event to delete this auction from the list - super.send(get_id(), GridSimTags.SCHEDULE_NOW, - AuctionTags.AUCTION_DELETE, new Integer(auc.getAuctionID())); - } - break; - - // deal with proposal that has been sent - case AuctionTags.AUCTION_PROPOSE: - Auction auction_p = null; - msg = (Message)ev.get_data(); - MessageBid bid = (MessageBid)msg; - auction_p = (Auction)auctions.get(new Integer(bid.getAuctionID())); - synchronized(syncSteps){ - if(auction_p != null){ - if(auction_p instanceof OneSidedAuction){ - if(((OneSidedAuction)auction_p).currentRound() == bid.getRound()){ - super.send(auction_p.get_id(), GridSimTags.SCHEDULE_NOW, - AuctionTags.AUCTION_PROPOSE, bid); - } - } - else{ - super.send(auction_p.get_id(), GridSimTags.SCHEDULE_NOW, - AuctionTags.AUCTION_PROPOSE, bid); - } - } - } - break; - - case AuctionTags.AUCTION_REJECT_CALL_FOR_BID: - msg = (Message)ev.get_data(); - MessageRejectCallForBid rej = (MessageRejectCallForBid)msg; - auc = (Auction)auctions.get(new Integer(rej.getAuctionID())); - synchronized(syncSteps){ - if(auc != null){ - if(auc instanceof OneSidedAuction) - if(((OneSidedAuction)auc).currentRound() == rej.getRound()){ - super.send(auc.get_id(), GridSimTags.SCHEDULE_NOW, - AuctionTags.AUCTION_REJECT_CALL_FOR_BID, rej); - } - } - } - break; - - // deal with ask that has been sent - case AuctionTags.AUCTION_ASK: - msg = (Message)ev.get_data(); - MessageAsk ask = (MessageAsk)msg; - auc = (Auction)auctions.get(new Integer(ask.getAuctionID())); - if(auc != null){ - if(auc instanceof DoubleAuction){ - super.send(auc.get_id(), GridSimTags.SCHEDULE_NOW, - AuctionTags.AUCTION_ASK, ask); - } - } - break; - - case AuctionTags.AUCTION_MATCH_TO_ASK: - LinkedList mat = (LinkedList)ev.get_data(); - synchronized(syncSteps){ - MessageAsk a = (MessageAsk)mat.get(0); - MessageBid b = (MessageBid)mat.get(1); - double p = ((Double)mat.get(2)).doubleValue(); - // call the method to process match to ask - this.onResponseToAsk(a,b,p); - } - break; - - // other unknown tags are processed by this method - default: - processOtherEvent(ev); - break; - } - } - - /** - * Overrides this method when making a new and different type of auctioneer. - * This method is called by {@link #body()} for incoming unknown tags. - * - * @param ev a Sim_event object - * @pre ev != null - * @post $none - */ - protected void processOtherEvent(Sim_event ev){ - if (ev == null){ - System.out.println("Auctioneer.processEvent(): " + super.get_name() - + " is has asked to process a null event."); - return; - } - } - - /** - * This method should be implemented to perform some auction after - * some auction has been finished. This method will be called whenever - * one of the auctions that were initiated by this Auctionerr has been concluded - * @param auction is the auction that has been concluded - */ - protected abstract void onAuctionClose(Auction auction); - - /** - * This method is called when a match for an ask was found by a double - * auction. The auction passes the ask, the bid that matches it and the - * price that they will use to trade - * @param ask the ask previously sent to the auctioneer - * @param bid the bid that matches the ask - * @param price the price used to trade - * @post the bid can be null if a match was not found - */ - protected abstract void onResponseToAsk(MessageAsk ask, MessageBid bid, double price); - - -} +/* + * Title: GridSim Toolkit + * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation + * of Parallel and Distributed Systems such as Clusters and Grids + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * + * Copyright (c) 2006, The University of Melbourne, Australia + */ +package gridsim.auction; + +import eduni.simjava.Sim_event; +import eduni.simjava.Sim_system; +import gridsim.GridSim; +import gridsim.GridSimTags; +import gridsim.net.Link; + +import java.util.Hashtable; +import java.util.LinkedList; + +/** + * This class defines the basic behavious of an auctioneer + * + * @author Marcos Dias de Assuncao + * @since GridSim Toolkit 4.0 + * @see gridsim.GridSim + */ +public abstract class Auctioneer extends GridSim { + private Hashtable auctions; + private Object syncSteps = new Object(); + + /** + * Constructor + * @param name + * @throws Exception + */ + public Auctioneer(String name) throws Exception { + super(name); + auctions = new Hashtable(); + } + + /** + * Constructor + * @param name + * @param baudRate + * @throws Exception + */ + public Auctioneer(String name, double baudRate) throws Exception { + super(name, baudRate); + auctions = new Hashtable(); + } + + /** + * @param name + * @param link + * @throws Exception + */ + public Auctioneer(String name, Link link) throws Exception { + super(name, link); + auctions = new Hashtable(); + } + + /** + * Adds an auction to this auctioneer + * @param auction + */ + public void addAuction(Auction auction){ + Integer key = new Integer(auction.getAuctionID()); + synchronized(syncSteps){ + auctions.put(key, auction); + } + } + + /* + * Removes an auction that has finished + * @param auction the auction ID + */ + private void removeAuction(int auctionID){ + Integer key = new Integer(auctionID); + synchronized(syncSteps){ + Auction auc = (Auction)auctions.get(key); + auctions.remove(key); + super.send(auc.get_id(), + GridSimTags.SCHEDULE_NOW, + AuctionTags.END_OF_AUCTION); + } + } + + /** + * Starts a given auction already added to the auctioneer + * @param auctionID The auction's id + */ + public void startAuction(int auctionID){ + Integer key = new Integer(auctionID); + synchronized(syncSteps){ + Auction auction = (Auction)auctions.get(key); + if(auction!=null){ + super.send(auction.get_id(), + GridSimTags.SCHEDULE_NOW, + AuctionTags.AUCTION_START); + } + else + System.err.println("Auctioneer.startAution(): "+ + "This auction does not exist. Auction ID = " + auctionID); + } + } + + /** + * Handles external events that are coming to this Auctioneer entity. + * <p> + * The services or tags available for this resource are: + * <ul> + * <li> {@link gridsim.auction.AuctionTags#AUCTION_POST} </li> + * <li> {@link gridsim.auction.AuctionTags#AUCTION_START} </li> + * <li> {@link gridsim.auction.AuctionTags#AUCTION_DELETE} </li> + * <li> {$link gridsim.auction.AuctionTags#AUCTION_FINISHED} </li> + * <li> {@link gridsim.auction.AuctionTags#AUCTION_PROPOSE} </li> + * <li> {@link gridsim.auction.AuctionTags#AUCTION_REJECT_CALL_FOR_BID} </li> + * <li> {@link gridsim.auction.AuctionTags#AUCTION_ASK} </li> + * <li> {@link gridsim.auction.AuctionTags#AUCTION_MATCH_TO_ASK} </li> + * </ul> + * <br> + * This method also calls these methods in the following order: + * <ol> + * <li> {@link #processOtherEvent(Sim_event)} method + * </ol> + * + * @pre $none + * @post $none + */ + public void body(){ + // Process events until END_OF_SIMULATION is received from the + // GridSimShutdown Entity + + Sim_event ev = new Sim_event(); + while ( Sim_system.running() ) + { + super.sim_get_next(ev); + + // if the simulation finishes then exit the loop + if (ev.get_tag() == GridSimTags.END_OF_SIMULATION){ + break; + } + + // process the received event + processEvent(ev); + } + + // remove I/O entities created during construction of this entity + super.terminateIOEntities(); + } + + /** + * Processes events or services that are available to this Auctioneer + * @param ev a Sim_event object + * @pre ev != null + * @post $none + */ + private void processEvent(Sim_event ev) + { + Auction auc = null; + Message msg = null; + Integer auctionID = null; + + switch ( ev.get_tag() ) + { + case AuctionTags.AUCTION_POST: + auc = (Auction)ev.get_data(); + addAuction(auc); // just adds the auction in the hashtable + break; + + case AuctionTags.AUCTION_START: + auctionID = (Integer)ev.get_data(); + startAuction(auctionID.intValue()); // starts the auction that was previously added + break; + + case AuctionTags.AUCTION_DELETE: + auctionID = (Integer)ev.get_data(); + removeAuction(auctionID.intValue()); + break; + + case AuctionTags.AUCTION_FINISHED: + auc = (Auction)auctions.get((Integer)ev.get_data()); + synchronized(syncSteps){ + this.onAuctionClose(auc); + // trigger the event to delete this auction from the list + super.send(get_id(), GridSimTags.SCHEDULE_NOW, + AuctionTags.AUCTION_DELETE, new Integer(auc.getAuctionID())); + } + break; + + // deal with proposal that has been sent + case AuctionTags.AUCTION_PROPOSE: + Auction auction_p = null; + msg = (Message)ev.get_data(); + MessageBid bid = (MessageBid)msg; + auction_p = (Auction)auctions.get(new Integer(bid.getAuctionID())); + synchronized(syncSteps){ + if(auction_p != null){ + if(auction_p instanceof OneSidedAuction){ + if(((OneSidedAuction)auction_p).currentRound() == bid.getRound()){ + super.send(auction_p.get_id(), GridSimTags.SCHEDULE_NOW, + AuctionTags.AUCTION_PROPOSE, bid); + } + } + else{ + super.send(auction_p.get_id(), GridSimTags.SCHEDULE_NOW, + AuctionTags.AUCTION_PROPOSE, bid); + } + } + } + break; + + case AuctionTags.AUCTION_REJECT_CALL_FOR_BID: + msg = (Message)ev.get_data(); + MessageRejectCallForBid rej = (MessageRejectCallForBid)msg; + auc = (Auction)auctions.get(new Integer(rej.getAuctionID())); + synchronized(syncSteps){ + if(auc != null){ + if(auc instanceof OneSidedAuction) + if(((OneSidedAuction)auc).currentRound() == rej.getRound()){ + super.send(auc.get_id(), GridSimTags.SCHEDULE_NOW, + AuctionTags.AUCTION_REJECT_CALL_FOR_BID, rej); + } + } + } + break; + + // deal with ask that has been sent + case AuctionTags.AUCTION_ASK: + msg = (Message)ev.get_data(); + MessageAsk ask = (MessageAsk)msg; + auc = (Auction)auctions.get(new Integer(ask.getAuctionID())); + if(auc != null){ + if(auc instanceof DoubleAuction){ + super.send(auc.get_id(), GridSimTags.SCHEDULE_NOW, + AuctionTags.AUCTION_ASK, ask); + } + } + break; + + case AuctionTags.AUCTION_MATCH_TO_ASK: + LinkedList mat = (LinkedList)ev.get_data(); + synchronized(syncSteps){ + MessageAsk a = (MessageAsk)mat.get(0); + MessageBid b = (MessageBid)mat.get(1); + double p = ((Double)mat.get(2)).doubleValue(); + // call the method to process match to ask + this.onResponseToAsk(a,b,p); + } + break; + + // other unknown tags are processed by this method + default: + processOtherEvent(ev); + break; + } + } + + /** + * Overrides this method when making a new and different type of auctioneer. + * This method is called by {@link #body()} for incoming unknown tags. + * + * @param ev a Sim_event object + * @pre ev != null + * @post $none + */ + protected void processOtherEvent(Sim_event ev){ + if (ev == null){ + System.out.println("Auctioneer.processEvent(): " + super.get_name() + + " is has asked to process a null event."); + return; + } + } + + /** + * This method should be implemented to perform some auction after + * some auction h... [truncated message content] |
From: <sul...@us...> - 2008-08-31 09:30:43
|
Revision: 240 http://gridsim.svn.sourceforge.net/gridsim/?rev=240&view=rev Author: sulistio Date: 2008-08-31 09:30:53 +0000 (Sun, 31 Aug 2008) Log Message: ----------- update this file to incorporate the new gridsim.net.fnb package. Modified Paths: -------------- trunk/source/gridsim/GridSim.java trunk/source/gridsim/GridSimTags.java Modified: trunk/source/gridsim/GridSim.java =================================================================== --- trunk/source/gridsim/GridSim.java 2008-08-31 09:30:07 UTC (rev 239) +++ trunk/source/gridsim/GridSim.java 2008-08-31 09:30:53 UTC (rev 240) @@ -9,7 +9,7 @@ package gridsim; -//import gridsim.net.fnb.FnbWhiteList; +import gridsim.net.fnb.FnbWhiteList; import gridsim.net.Link; import gridsim.filter.*; import java.io.*; @@ -104,7 +104,7 @@ * if they are going to/coming from the entity stored in the list. * @see gridsim.net.fnb.FnbWhiteList */ - //public static FnbWhiteList fnbWhiteList_ = null; // TODO + public static FnbWhiteList fnbWhiteList_ = null; private static int gisID_ = -1; // id of GIS entity private static int shutdownID_ = -1; // id of GridSimShutdown entity @@ -2538,7 +2538,7 @@ case GridSimTags.NET_BUFFER_PACKET_LEVEL: GridSimCore.NETWORK_TYPE = GridSimTags.NET_BUFFER_PACKET_LEVEL; - //fnbWhiteList_ = new FnbWhiteList(); // TODO + fnbWhiteList_ = new FnbWhiteList(); break; default: Modified: trunk/source/gridsim/GridSimTags.java =================================================================== --- trunk/source/gridsim/GridSimTags.java 2008-08-31 09:30:07 UTC (rev 239) +++ trunk/source/gridsim/GridSimTags.java 2008-08-31 09:30:53 UTC (rev 240) @@ -207,6 +207,64 @@ public static final int FLOW_ACK = NETBASE + 17; + /////////////////////////////////////////////////////////////// + // For the gridsim.net.fnb package + + /** This is to simulate the finite buffers. + * This constant is to tell an entity + * that a packet has been dropped. */ + public static final int FNB_PACKET_DROPPED = NETBASE + 31; + + /** This is to simulate the finite buffers. + * This constant is used when an Output + * port tells a user that a gridlet has failed because its (Gridlet) packets + * has been dropped. */ + public static final int FNB_GRIDLET_FAILED_BECAUSE_PACKET_DROPPED = NETBASE + 32; + + /** This is to simulate the finite buffers. A FIFO dropping algorithm. */ + public static final int FNB_FIFO = NETBASE + 33; + + /** This is to simulate the finite buffers. A RED (Random Early Detection) + dropping algorithm. */ + public static final int FNB_RED = NETBASE + 34; + + /** This is to simulate the finite buffers. + * The event used to capture the number of dropped packets. + * This event is sent form a SCFScheduler to itself every T time. */ + public static final int FNB_COUNT_DROPPED_PKTS = NETBASE + 35; + + /** This is to simulate the finite buffers. + * Adaptative RED (Random Early Detection) dropping algorithm. */ + public static final int FNB_ARED = NETBASE + 36; + + /** This is to update the parameters of ARED. */ + public static final int FNB_UPDATE_ARED_PARAMETERS = NETBASE + 37; + + /** This is to simulate the finite buffers. + * This constant is used when an Output port tells a user that a file + * has failed because its (File) packets has been dropped. */ + public static final int FNB_FILE_FAILED_BECAUSE_PACKET_DROPPED = NETBASE + 38; + + /** This is to simulate the finite buffers. + * This constant is used when an Output port tells a user that a file + * and a gridlet have failed because their (File and Gridlet) packets + * has been dropped. */ + public static final int FNB_FILE_GRIDLET_FAILED_BECAUSE_PACKET_DROPPED = NETBASE + 39; + + /** This is to identify when a packet contains a file. */ + public static final int FNB_PKT_CONTAINS_FILE = NETBASE + 40; + + /** This is to update the parameters of ARED. + * The time period between updates (0.5 seconds). */ + public static final double FNB_UPDATE_ARED_PARAMETERS_PERIOD = 0.5; + + /** + * When a router drops a packet, it has to tell to a user. + * But the router does not notify immediately (when the dropping ocurs), + * but with a given delay (this delay). */ + public static final double FNB_DROPPING_DELAY = 0.01; // 10 milliseconds + + ///////////////////////////////////////////////////////////// // I intentionally put a gap to incorporate future tags // so I don't have to change the numbers! This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sul...@us...> - 2008-09-21 11:46:40
|
Revision: 243 http://gridsim.svn.sourceforge.net/gridsim/?rev=243&view=rev Author: sulistio Date: 2008-09-21 11:46:26 +0000 (Sun, 21 Sep 2008) Log Message: ----------- fix some javadoc issues Modified Paths: -------------- trunk/source/gridsim/GridSim.java trunk/source/gridsim/GridSimCore.java trunk/source/gridsim/datagrid/File.java trunk/source/gridsim/datagrid/FileAttribute.java trunk/source/gridsim/net/fnb/ARED.java trunk/source/gridsim/net/fnb/FIFO.java trunk/source/gridsim/net/fnb/FnbDroppedPacketInfo.java trunk/source/gridsim/net/fnb/FnbDroppedUserPacket.java trunk/source/gridsim/net/fnb/FnbEndToEndPath.java trunk/source/gridsim/net/fnb/FnbInput.java trunk/source/gridsim/net/fnb/FnbMessage.java trunk/source/gridsim/net/fnb/FnbMessageDropFile.java trunk/source/gridsim/net/fnb/FnbMessageDropGridlet.java trunk/source/gridsim/net/fnb/FnbNetworkReader.java trunk/source/gridsim/net/fnb/FnbOutput.java trunk/source/gridsim/net/fnb/FnbRIPRouter.java trunk/source/gridsim/net/fnb/FnbRouter.java trunk/source/gridsim/net/fnb/FnbSCFQScheduler.java trunk/source/gridsim/net/fnb/FnbWhiteList.java trunk/source/gridsim/net/fnb/Fnb_FileName_FileMyID.java trunk/source/gridsim/net/fnb/RED.java trunk/source/gridsim/net/fnb/source_pktNum.java Modified: trunk/source/gridsim/GridSim.java =================================================================== --- trunk/source/gridsim/GridSim.java 2008-09-09 08:14:06 UTC (rev 242) +++ trunk/source/gridsim/GridSim.java 2008-09-21 11:46:26 UTC (rev 243) @@ -2512,16 +2512,16 @@ /** * Initializes the {@link gridsim.GridSimCore#NETWORK_TYPE} to be used in * the simulation. By default, the {@link gridsim.GridSimCore#NETWORK_TYPE} - * is set to {@link gridsim.GridSimTags.NET_PACKET_LEVEL}. + * is set to {@link gridsim.GridSimTags#NET_PACKET_LEVEL}. * * @param networkType network type * @return <tt>true</tt> if the network type has been initialized successfully * or <tt>false</tt> otherwise. * * @see gridsim.GridSimCore#NETWORK_TYPE - * @see gridsim.GridSimTags.NET_PACKET_LEVEL - * @see gridsim.GridSimTags.NET_FLOW_LEVEL - * @see gridsim.GridSimTags.NET_BUFFER_PACKET_LEVEL + * @see gridsim.GridSimTags#NET_PACKET_LEVEL + * @see gridsim.GridSimTags#NET_FLOW_LEVEL + * @see gridsim.GridSimTags#NET_BUFFER_PACKET_LEVEL */ public static boolean initNetworkType(int networkType) { @@ -2552,9 +2552,9 @@ /** Returns the network type used in this simulation. * @return the network type * @see gridsim.GridSimCore#NETWORK_TYPE - * @see gridsim.GridSimTags.NET_PACKET_LEVEL - * @see gridsim.GridSimTags.NET_FLOW_LEVEL - * @see gridsim.GridSimTags.NET_BUFFER_PACKET_LEVEL + * @see gridsim.GridSimTags#NET_PACKET_LEVEL + * @see gridsim.GridSimTags#NET_FLOW_LEVEL + * @see gridsim.GridSimTags#NET_BUFFER_PACKET_LEVEL */ public static int getNetworkType() { return GridSimCore.NETWORK_TYPE; Modified: trunk/source/gridsim/GridSimCore.java =================================================================== --- trunk/source/gridsim/GridSimCore.java 2008-09-09 08:14:06 UTC (rev 242) +++ trunk/source/gridsim/GridSimCore.java 2008-09-21 11:46:26 UTC (rev 243) @@ -14,7 +14,7 @@ import gridsim.util.*; import java.util.Collection; import gridsim.net.flow.*; -//import gridsim.net.fnb.*; +import gridsim.net.fnb.*; /** * Since GridSim version 3.0, this is the overall class of GridSim package, @@ -197,9 +197,9 @@ * {@link gridsim.GridSim#initNetworkType(int)} method <b>before</b> the * simulation starts. * @see gridsim.GridSim#initNetworkType(int) - * @see gridsim.GridSimTags.NET_PACKET_LEVEL - * @see gridsim.GridSimTags.NET_FLOW_LEVEL - * @see gridsim.GridSimTags.NET_BUFFER_PACKET_LEVEL + * @see gridsim.GridSimTags#NET_PACKET_LEVEL + * @see gridsim.GridSimTags#NET_FLOW_LEVEL + * @see gridsim.GridSimTags#NET_BUFFER_PACKET_LEVEL */ protected static int NETWORK_TYPE = GridSimTags.NET_PACKET_LEVEL; @@ -337,9 +337,9 @@ } // Use Finite network buffer else if (GridSimCore.NETWORK_TYPE == GridSimTags.NET_BUFFER_PACKET_LEVEL) - { // TODO: - //in = new FnbInput("Input_" + name, baudRate); - //out_ = new FnbOutput("Output_" + name, baudRate); + { + in = new FnbInput("Input_" + name, baudRate); + out_ = new FnbOutput("Output_" + name, baudRate); } Sim_system.link_ports(name, "input", "Input_" + name, "input_buffer"); Modified: trunk/source/gridsim/datagrid/File.java =================================================================== --- trunk/source/gridsim/datagrid/File.java 2008-09-09 08:14:06 UTC (rev 242) +++ trunk/source/gridsim/datagrid/File.java 2008-09-21 11:46:26 UTC (rev 243) @@ -180,7 +180,6 @@ /** * Sets the file name * @param name the file name - * @return <tt>true</tt> if successful, <tt>false</tt> otherwise */ public void setName(String name) { attr_.setName(name); Modified: trunk/source/gridsim/datagrid/FileAttribute.java =================================================================== --- trunk/source/gridsim/datagrid/FileAttribute.java 2008-09-09 08:14:06 UTC (rev 242) +++ trunk/source/gridsim/datagrid/FileAttribute.java 2008-09-21 11:46:26 UTC (rev 243) @@ -390,7 +390,6 @@ /** * Sets the file name * @param name the file name - * @return <tt>true</tt> if successful, <tt>false</tt> otherwise */ public void setName(String name) { this.name_ = name; Modified: trunk/source/gridsim/net/fnb/ARED.java =================================================================== --- trunk/source/gridsim/net/fnb/ARED.java 2008-09-09 08:14:06 UTC (rev 242) +++ trunk/source/gridsim/net/fnb/ARED.java 2008-09-21 11:46:26 UTC (rev 243) @@ -105,9 +105,9 @@ */ public void updateStats() { - fw_write(GridSim.clock() + "\t" + getMaxP() + "\t" + getMinTh() + "\t" + - getMaxTh() + "\t" + getAvg() + "\t" + this.size() + "\n", - this.getSchedName() + "_Buffers"); + fw_write(GridSim.clock() + ", " + getMaxP() + ", " + getMinTh() + ", " + + getMaxTh() + ", " + getAvg() + ", " + this.size() + "\n", + this.getSchedName() + "_Buffers.csv"); } Modified: trunk/source/gridsim/net/fnb/FIFO.java =================================================================== --- trunk/source/gridsim/net/fnb/FIFO.java 2008-09-09 08:14:06 UTC (rev 242) +++ trunk/source/gridsim/net/fnb/FIFO.java 2008-09-21 11:46:26 UTC (rev 243) @@ -358,8 +358,8 @@ */ public void updateStats() { - fw_write(GridSim.clock() + "\t\t\t\t" + AVG + "\t" + this.size() + "\n", - this.getSchedName() + "_Buffers"); + fw_write(GridSim.clock() + ", , , , " + AVG + ", " + this.size() + "\n", + this.getSchedName() + "_Buffers.csv"); } } Modified: trunk/source/gridsim/net/fnb/FnbDroppedPacketInfo.java =================================================================== --- trunk/source/gridsim/net/fnb/FnbDroppedPacketInfo.java 2008-09-09 08:14:06 UTC (rev 242) +++ trunk/source/gridsim/net/fnb/FnbDroppedPacketInfo.java 2008-09-21 11:46:26 UTC (rev 243) @@ -18,7 +18,7 @@ * Thus, routers tell users which gridlet got the dropped packet. This is done * to minimize the network overhead caused by this informations. * @author Agustin Caminero - * @since GridSim Toolkit 4.1 + * @since GridSim Toolkit 4.2 */ public class FnbDroppedPacketInfo { Modified: trunk/source/gridsim/net/fnb/FnbDroppedUserPacket.java =================================================================== --- trunk/source/gridsim/net/fnb/FnbDroppedUserPacket.java 2008-09-09 08:14:06 UTC (rev 242) +++ trunk/source/gridsim/net/fnb/FnbDroppedUserPacket.java 2008-09-21 11:46:26 UTC (rev 243) @@ -17,8 +17,8 @@ /** * This class is for the routers to tell users when one of their packets is dropped. * @author Agustin Caminero, Universidad de Castilla La Mancha (Spain). - * @since GridSim Toolkit 4.1 - * */ + * @since GridSim Toolkit 4.2 + */ public class FnbDroppedUserPacket implements Packet { int userID; Modified: trunk/source/gridsim/net/fnb/FnbEndToEndPath.java =================================================================== --- trunk/source/gridsim/net/fnb/FnbEndToEndPath.java 2008-09-09 08:14:06 UTC (rev 242) +++ trunk/source/gridsim/net/fnb/FnbEndToEndPath.java 2008-09-21 11:46:26 UTC (rev 243) @@ -21,7 +21,7 @@ * Thus, we put all of the common information (e.g. source and destination IDs) * into this class. * - * @since GridSim Toolkit 4.1 + * @since GridSim Toolkit 4.2 * @author Agustin Caminero */ public class FnbEndToEndPath Modified: trunk/source/gridsim/net/fnb/FnbInput.java =================================================================== --- trunk/source/gridsim/net/fnb/FnbInput.java 2008-09-09 08:14:06 UTC (rev 242) +++ trunk/source/gridsim/net/fnb/FnbInput.java 2008-09-21 11:46:26 UTC (rev 243) @@ -34,7 +34,7 @@ * * @author Agustin Caminero, Universidad de Castilla La Mancha (Spain). * Based on Input class, by Manzur Murshed and Rajkumar Buyya. - * @since GridSim Toolkit 4.1 + * @since GridSim Toolkit 4.2 * * Things added or modifyed: * - getDataFromLink(...) @@ -130,34 +130,34 @@ } /** - * This is an empty method and only applicable to - * {@link gridsim.net.Output} class. - * @param gen a background traffic generator - * @param userName a collection of user entity name (in String object). - * @return <tt>false</tt> since this method is not used by this class. - * @pre gen != null - * @pre userName != null - * @post $none - * @see gridsim.net.Output - */ - public boolean setBackgroundTraffic(TrafficGenerator gen, - Collection userName) - { - return false; - } + * This is an empty method and only applicable to + * {@link gridsim.net.Output} class. + * @param gen a background traffic generator + * @param userName a collection of user entity name (in String object). + * @return <tt>false</tt> since this method is not used by this class. + * @pre gen != null + * @pre userName != null + * @post $none + * @see gridsim.net.Output + */ + public boolean setBackgroundTraffic(TrafficGenerator gen, + Collection userName) + { + return false; + } - /** - * This is an empty method and only applicable to - * {@link gridsim.net.Output} class. - * @param gen a background traffic generator - * @return <tt>false</tt> since this method is not used by this class. - * @pre gen != null - * @post $none - * @see gridsim.net.Output - */ - public boolean setBackgroundTraffic(TrafficGenerator gen) - { - return false; + /** + * This is an empty method and only applicable to + * {@link gridsim.net.Output} class. + * @param gen a background traffic generator + * @return <tt>false</tt> since this method is not used by this class. + * @pre gen != null + * @post $none + * @see gridsim.net.Output + */ + public boolean setBackgroundTraffic(TrafficGenerator gen) + { + return false; } /** @@ -482,42 +482,42 @@ /** - * Prints out the given message into stdout. - * In addition, writes it into a file. - * @param msg a message - * @param file file where we want to write - */ - private static void fw_write(String msg, String file) + * Prints out the given message into stdout. + * In addition, writes it into a file. + * @param msg a message + * @param file file where we want to write + */ + private static void fw_write(String msg, String file) + { + //System.out.print(msg); + FileWriter fwriter = null; + + try { - //System.out.print(msg); - FileWriter fwriter = null; + fwriter = new FileWriter(file, true); + } catch (Exception ex) + { + ex.printStackTrace(); + System.out.println("Unwanted errors while opening file " + file); + } - try - { - fwriter = new FileWriter(file, true); - } catch (Exception ex) - { - ex.printStackTrace(); - System.out.println("Unwanted errors while opening file " + file); - } + try + { + fwriter.write(msg); + } catch (Exception ex) + { + ex.printStackTrace(); + System.out.println("Unwanted errors while writing on file " + file); + } - try - { - fwriter.write(msg); - } catch (Exception ex) - { - ex.printStackTrace(); - System.out.println("Unwanted errors while writing on file " + file); - } - - try - { - fwriter.close(); - } catch (Exception ex) - { - ex.printStackTrace(); - System.out.println("Unwanted errors while closing file " + file); - } + try + { + fwriter.close(); + } catch (Exception ex) + { + ex.printStackTrace(); + System.out.println("Unwanted errors while closing file " + file); + } } Modified: trunk/source/gridsim/net/fnb/FnbMessage.java =================================================================== --- trunk/source/gridsim/net/fnb/FnbMessage.java 2008-09-09 08:14:06 UTC (rev 242) +++ trunk/source/gridsim/net/fnb/FnbMessage.java 2008-09-21 11:46:26 UTC (rev 243) @@ -12,6 +12,11 @@ package gridsim.net.fnb; +/** + * + * @author Agustin Caminero + * @since GridSim Toolkit 4.2 + */ public interface FnbMessage { public void setEntityID(int i); Modified: trunk/source/gridsim/net/fnb/FnbMessageDropFile.java =================================================================== --- trunk/source/gridsim/net/fnb/FnbMessageDropFile.java 2008-09-09 08:14:06 UTC (rev 242) +++ trunk/source/gridsim/net/fnb/FnbMessageDropFile.java 2008-09-21 11:46:26 UTC (rev 243) @@ -14,6 +14,11 @@ import gridsim.net.fnb.*; +/** + * + * @author Agustin Caminero + * @since GridSim Toolkit 4.2 + */ public class FnbMessageDropFile implements FnbMessage { int fileID; Modified: trunk/source/gridsim/net/fnb/FnbMessageDropGridlet.java =================================================================== --- trunk/source/gridsim/net/fnb/FnbMessageDropGridlet.java 2008-09-09 08:14:06 UTC (rev 242) +++ trunk/source/gridsim/net/fnb/FnbMessageDropGridlet.java 2008-09-21 11:46:26 UTC (rev 243) @@ -14,6 +14,11 @@ import gridsim.net.fnb.*; +/** + * + * @author Agustin Caminero + * @since GridSim Toolkit 4.2 + */ public class FnbMessageDropGridlet implements FnbMessage { int gridletID; Modified: trunk/source/gridsim/net/fnb/FnbNetworkReader.java =================================================================== --- trunk/source/gridsim/net/fnb/FnbNetworkReader.java 2008-09-09 08:14:06 UTC (rev 242) +++ trunk/source/gridsim/net/fnb/FnbNetworkReader.java 2008-09-21 11:46:26 UTC (rev 243) @@ -47,6 +47,7 @@ * - createNetworkSCFQ(...) * - Use finiteBufferSCFQScheduler instead of SCFQScheduler * + * @since GridSim Toolkit 4.2 * @author Agustin Caminero, Universidad de Castilla La Mancha (Spain). * Based on NetworkReader class, by Uros Cibej and Anthony Sulistio. */ @@ -67,7 +68,7 @@ * @param stats whether we want to store stats or not * @return the list of finiteBufferRouters of the network or <tt>null</tt> if an error * occurs - * @see gridsim.net.finiteBufferSCFQScheduler + * @see gridsim.net.fnb.FnbSCFQScheduler */ public static LinkedList createSCFQ(String filename, double[] weight, int max_buf_size, int drop_alg, @@ -139,10 +140,11 @@ * Creates a number of routers from a given buffered reader * @param buf a Buffered Reader object * @param rate a flag denotes the type of FnbRouter will be using + * @param stats true if we want to store statistics * @return a list of FnbRouter objects or <tt>null</tt> if an error occurs */ private static LinkedList createRouter(BufferedReader buf, - boolean rate) throws Exception + boolean rate, boolean stats) throws Exception { String line = null; StringTokenizer str = null; @@ -218,7 +220,7 @@ } else { - router = new FnbRIPRouter(name, log, my_id); + router = new FnbRIPRouter(name, log, my_id, stats); } routerList.add(router); // add the router into the list } @@ -231,11 +233,13 @@ * @param buf a Buffered Reader object * @param weight a linear array of the weights to be assigned to * different classes of traffic. + * @param max_buf_size the maximum size for network buffers * @param drop_alg the algorithm used to drop packets at routers * @param min_th minimum threshold for RED * @param max_th maximum threshold for RED * @param max_p maximum drop probability for RED * @param queue_weight queue weight for RED + * @param stats true if we want to store statistics * @return a list of FnbRouter objects or <tt>null</tt> if an error occurs */ private static LinkedList createNetworkSCFQ(BufferedReader buf, @@ -251,7 +255,7 @@ } // create the FnbRouter objects first - LinkedList routerList = createRouter(buf, false); + LinkedList routerList = createRouter(buf, false, stats); int GB = 1000000000; // 1 GB in bits String line; @@ -354,4 +358,3 @@ } // end class - Modified: trunk/source/gridsim/net/fnb/FnbOutput.java =================================================================== --- trunk/source/gridsim/net/fnb/FnbOutput.java 2008-09-09 08:14:06 UTC (rev 242) +++ trunk/source/gridsim/net/fnb/FnbOutput.java 2008-09-21 11:46:26 UTC (rev 243) @@ -32,6 +32,7 @@ * communication delay. Simultaneous outputs can be modeled by using multiple * instances of this class * + * @since GridSim Toolkit 4.2 * @author Agustin Caminero, Universidad de Castilla La Mancha (Spain). * Based on Output class, by Manzur Murshed and Rajkumar Buyya * Things added or modifyed: @@ -90,7 +91,7 @@ filesname_fileMyIDs_ = new ArrayList(); - System.out.println(super.get_name()); + //System.out.println(super.get_name()); } /** @@ -1034,10 +1035,12 @@ else msgDrop = new FnbMessageDropGridlet(flPktGl.getGridletID()); + /***** System.out.println(super.get_name() + ": lookForEntity: entiyID: " + flPktGl.getGridletID() + ". isFile " + flPktGl.getIsFile() + ". filename " + getFilename(msgDrop.getEntityID())); - + *****/ + return msgDrop; } } Modified: trunk/source/gridsim/net/fnb/FnbRIPRouter.java =================================================================== --- trunk/source/gridsim/net/fnb/FnbRIPRouter.java 2008-09-09 08:14:06 UTC (rev 242) +++ trunk/source/gridsim/net/fnb/FnbRIPRouter.java 2008-09-21 11:46:26 UTC (rev 243) @@ -33,6 +33,7 @@ * reliable protocol to use. * * @invariant $none + * @since GridSim Toolkit 4.2 * @author Agustin Caminero, University of Castilla La Mancha, Spain. * Based on class RIPRouter, by Gokul Poduval & Chen-Khong Tham, * National University of Singapore. @@ -75,19 +76,18 @@ /** * Creates a new RIPRouter 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 #FnbRIPRouter(String, boolean)}. + * entity, please use {@link #FnbRIPRouter(String, boolean, int)}. * * @param name Name of this router * @param my_id the my_id of this router. For a router named "router0", its my_id will be 0 * @throws NullPointerException This happens when name is empty or null - * @see #FnbRIPRouter(String, boolean) + * @see #FnbRIPRouter(String, boolean, int) * @pre name != null * @post $none */ public FnbRIPRouter(String name, int my_id) throws NullPointerException { this(name, false, my_id); - storeStats = false; } /** @@ -116,13 +116,13 @@ /** * Creates a new RIPRouter 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 #FnbRIPRouter(String, boolean)}. + * entity, please use {@link #FnbRIPRouter(String, boolean, int)}. * * @param name Name of this router * @param my_id for a router named "Router0", its my_id will be 0 - * @param stats true if we want to recor statistics + * @param stats true if we want to record statistics * @throws NullPointerException This happens when name is empty or null - * @see #FnbRIPRouter(String, boolean) + * @see #FnbRIPRouter(String, boolean, int) * @pre name != null * @post $none */ @@ -465,8 +465,8 @@ // keep stats from all the routers droppedPktsCounter = sched.getCounterDroppedPkts(); - fw_write(GridSim.clock() + "\t" + droppedPktsCounter + "\n", - sched.getSchedName() + "_DroppedPkts"); + fw_write(GridSim.clock() + ", " + droppedPktsCounter + "\n", + sched.getSchedName() + "_DroppedPkts.csv"); sched.resetCounterDroppedPkts(); @@ -958,4 +958,3 @@ } // end class - Modified: trunk/source/gridsim/net/fnb/FnbRouter.java =================================================================== --- trunk/source/gridsim/net/fnb/FnbRouter.java 2008-09-09 08:14:06 UTC (rev 242) +++ trunk/source/gridsim/net/fnb/FnbRouter.java 2008-09-21 11:46:26 UTC (rev 243) @@ -51,6 +51,7 @@ * </ul> * * @invariant $none + * @since GridSim Toolkit 4.2 * @author Agustin Caminero, University of Castilla La Mancha, Spain. * Based on class Router, by Gokul Poduval & Chen-Khong Tham, * National University of Singapore. @@ -316,9 +317,9 @@ * <p> * The services or tags available for this resource are: * <ul> - * <li> {@link gridsim.my_GridSimTags#PKT_FORWARD} - * <li> {@link gridsim.my_GridSimTags#JUNK_PKT} - * <li> {@link gridsim.my_GridSimTags#ROUTER_AD} + * <li> {@link gridsim.GridSimTags#PKT_FORWARD} + * <li> {@link gridsim.GridSimTags#JUNK_PKT} + * <li> {@link gridsim.GridSimTags#ROUTER_AD} * </ul> * * @param ev a Sim_event object Modified: trunk/source/gridsim/net/fnb/FnbSCFQScheduler.java =================================================================== --- trunk/source/gridsim/net/fnb/FnbSCFQScheduler.java 2008-09-09 08:14:06 UTC (rev 242) +++ trunk/source/gridsim/net/fnb/FnbSCFQScheduler.java 2008-09-21 11:46:26 UTC (rev 243) @@ -47,6 +47,7 @@ * judging from their respective weights. * * @invariant $none + * @since GridSim Toolkit 4.2 * @author Agustin Caminero, Universidad de Castilla La Mancha (Spain). * Based on SCFQScheduler class, by Gokul Poduval & Chen-Khong Tham, * National University of Singapore. @@ -303,14 +304,14 @@ if (storeStats) { - fw_write("Interval\tBufferSize\tAvgBufferSize\tMaxBufferSize\n", - getSchedName() + "_MaxBufferSize"); + fw_write("Interval, BufferSize, AvgBufferSize, MaxBufferSize\n", + getSchedName() + "_MaxBufferSize.csv", false); - fw_write("Interval\tDroppedPackets\n", - this.getSchedName() + "_DroppedPkts"); + fw_write("Interval, DroppedPackets\n", + this.getSchedName() + "_DroppedPkts.csv", false); - fw_write("Clock\t\t\tMAX_P\tMIN_TH\tMAX_TH\tAVG\tQUEUE_SIZE\n", - this.getSchedName() + "_Buffers"); + fw_write("Clock, MAX_P, MIN_TH, MAX_TH, AVG, QUEUE_SIZE\n", + this.getSchedName() + "_Buffers.csv", false); } @@ -443,10 +444,9 @@ { maxBufferSize = bufferSize; - fw_write(GridSim.clock() + "\t" + bufferSize + "\t" + getAvg() + "\t" + - maxBufferSize + "\n", - this.getSchedName() + "_MaxBufferSize"); - + fw_write(GridSim.clock() + ", " + bufferSize + ", " + + getAvg() + ", " + maxBufferSize + "\n", + this.getSchedName() + "_MaxBufferSize.csv"); } } @@ -638,14 +638,26 @@ * @param msg a message * @param file file where we want to write */ - private static void fw_write(String msg, String file) + private void fw_write(String msg, String file) { + fw_write(msg, file, true); + } + + /** + * Prints out the given message into stdout. + * In addition, writes it into a file. + * @param msg a message + * @param file file where we want to write + * @param append append the message at the end of the file or not + */ + private void fw_write(String msg, String file, boolean append) + { //System.out.print(msg); FileWriter fwriter = null; try { - fwriter = new FileWriter(file, true); + fwriter = new FileWriter(file, append); } catch (Exception ex) { ex.printStackTrace(); @@ -760,24 +772,25 @@ super.send(src_outputPort, GridSimTags.SCHEDULE_NOW, GridSimTags.FNB_PACKET_DROPPED, new FnbDroppedUserPacket(entity, pktID)); - /*System.out.println("\n" + super.get_name() + - ":(make) A packet has been dropped, and an ACK has been sent.\n" + - " src.output: " + src_outputPort_str + - ". dst: " + dst_str + - "\n Time: " + - GridSim.clock() + ". PktID: " + pkt.getID() +". Gl: " + glID);*/ + /****** + System.out.println("\n" + super.get_name() + + ":(make) A packet has been dropped, and an ACK has been sent.\n" + + " src.output: " + src_outputPort_str + + ". dst: " + dst_str + "\n Time: " + + GridSim.clock() + ". PktID: " + pkt.getID() +". Gl: " + glID); + ******/ } else { - /*System.out.println("\n" + super.get_name() + - ":(make) A packet has been dropped.\n" + - " src.output: " + src_outputPort_str + - ". dst: " + dst_str + - "\n Time: " + - GridSim.clock() + ". PktID: " + pkt.getID() + - ". Gl: " + - glID);*/ + /***** + System.out.println("\n" + super.get_name() + + ":(make) A packet has been dropped.\n" + + " src.output: " + src_outputPort_str + + ". dst: " + dst_str + + "\n Time: " + GridSim.clock() + ". PktID: " + pkt.getID() + + ". Gl: " + glID); + *****/ } @@ -870,8 +883,8 @@ if ((ev.get_tag() == GridSimTags.END_OF_SIMULATION) || (ev.get_tag() == GridSimTags.COUNT_DROPPED_PKTS)) { - fw_write(GridSim.clock() + "\t" + DROPPED_PKTS_COUNTER + "\n", - this.getSchedName() + "_DroppedPkts"); + fw_write(GridSim.clock() + ", " + DROPPED_PKTS_COUNTER + "\n", + this.getSchedName() + "_DroppedPkts.csv"); DROPPED_PKTS_COUNTER = 0; // System.out.println(super.get_name() + ": max_avg: " + MAX_AVG); Modified: trunk/source/gridsim/net/fnb/FnbWhiteList.java =================================================================== --- trunk/source/gridsim/net/fnb/FnbWhiteList.java 2008-09-09 08:14:06 UTC (rev 242) +++ trunk/source/gridsim/net/fnb/FnbWhiteList.java 2008-09-21 11:46:26 UTC (rev 243) @@ -15,7 +15,11 @@ import java.util.*; import gridsim.*; - +/** + * + * @author Agustin Caminero + * @since GridSim Toolkit 4.2 + */ public class FnbWhiteList { private ArrayList list_; Modified: trunk/source/gridsim/net/fnb/Fnb_FileName_FileMyID.java =================================================================== --- trunk/source/gridsim/net/fnb/Fnb_FileName_FileMyID.java 2008-09-09 08:14:06 UTC (rev 242) +++ trunk/source/gridsim/net/fnb/Fnb_FileName_FileMyID.java 2008-09-21 11:46:26 UTC (rev 243) @@ -12,6 +12,11 @@ package gridsim.net.fnb; +/** + * + * @author Agustin Caminero + * @since GridSim Toolkit 4.2 + */ public class Fnb_FileName_FileMyID { // Since files don't have an id until they are registered, we need an id for them. Modified: trunk/source/gridsim/net/fnb/RED.java =================================================================== --- trunk/source/gridsim/net/fnb/RED.java 2008-09-09 08:14:06 UTC (rev 242) +++ trunk/source/gridsim/net/fnb/RED.java 2008-09-21 11:46:26 UTC (rev 243) @@ -36,7 +36,7 @@ * Buffer Management Policies in Networks for Grids" </i> * * @author Agustin Caminero - * @since GridSim Toolkit 4.1 + * @since GridSim Toolkit 4.2 * */ public class RED extends FnbSCFQScheduler { @@ -274,8 +274,8 @@ "\n HENCE, SIMULATION FINISHED AT SIM. TIME " + GridSim.clock()); - fw_write("MaxBufferSizeDuringSim\t" + getMaxBufferSize() + "\n", - this.get_name() + "_MaxBufferSize"); + fw_write("MaxBufferSizeDuringSim, " + getMaxBufferSize() + "\n", + this.get_name() + "_MaxBufferSize.csv"); System.exit(1); // super.shutdownUserEntity(); @@ -287,9 +287,9 @@ // If u want more info on the progress of sims, uncomment this. - System.out.println(super.get_name() + ": packet dropped. Src: " + + /*System.out.println(super.get_name() + ": packet dropped. Src: " + src_outputPort_str + ", Dst: " + dst_str + - ". Pkt num: " + ((FnbNetPacket) pnp).getPacketNum()); + ". Pkt num: " + ((FnbNetPacket) pnp).getPacketNum());*/ // If the packet is not a control packet, we will have to remove the packet, and // also, we will have to tell the user involved in the transmission about the dropping. @@ -381,20 +381,20 @@ FnbDroppedPacketInfo gu = new FnbDroppedPacketInfo(glID, entity); insertGlID_userID(gu); + /**************** System.out.println("\n" + super.get_name() + - ": A packet has been dropped, and an ACK has been sent.\n" + - " src.output: " + src_outputPort_str + - ". dst_inputPort: " + dst_str + - "\n Time: " + - GridSim.clock() + ". PktID: " + pnp.getID() + - ". Gl: " + glID + - ". destination_packetsDroppedEvent: " + - destination_packetsDroppedEvent); - - + ": A packet has been dropped, and an ACK has been sent.\n" + + " src.output: " + src_outputPort_str + + ", dst_inputPort: " + dst_str + + "\n Time: " + + GridSim.clock() + ". PktID: " + pnp.getID() + + ". Gl: " + glID + + ". destination_packetsDroppedEvent: " + + destination_packetsDroppedEvent); + ***********/ } - else{ + /*else{ System.out.println("\n" + super.get_name() + ": A packet has been dropped.\n" + " src.output: " + src_outputPort_str + @@ -404,7 +404,7 @@ glID + ". destination_packetsDroppedEvent: " + destination_packetsDroppedEvent); - } + }*/ pnp = null; // remove the packet. } @@ -559,9 +559,9 @@ */ public void updateStats() { - fw_write(GridSim.clock() + "\t" + MAX_P + "\t" + MIN_TH + "\t" + - MAX_TH + "\t" + AVG + "\t" + this.size() + "\n", - this.getSchedName() + "_Buffers"); + fw_write(GridSim.clock() + ", " + MAX_P + ", " + MIN_TH + ", " + + MAX_TH + ", " + AVG + ", " + this.size() + "\n", + this.getSchedName() + "_Buffers.csv"); } /** Returns the avg buffer size @@ -627,4 +627,3 @@ } - Modified: trunk/source/gridsim/net/fnb/source_pktNum.java =================================================================== --- trunk/source/gridsim/net/fnb/source_pktNum.java 2008-09-09 08:14:06 UTC (rev 242) +++ trunk/source/gridsim/net/fnb/source_pktNum.java 2008-09-21 11:46:26 UTC (rev 243) @@ -15,7 +15,7 @@ /**This class is used in the FnbInput class, to make sure that * all the packets of a gridlet arrive at the user/resource. * @author Agustin Caminero - * @since GridSim Toolkit 4.1 + * @since GridSim Toolkit 4.2 */ public class source_pktNum This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2009-04-03 04:28:33
|
Revision: 260 http://gridsim.svn.sourceforge.net/gridsim/?rev=260&view=rev Author: marcos_dias Date: 2009-04-03 04:28:19 +0000 (Fri, 03 Apr 2009) Log Message: ----------- Several methods of allocation policies have been made synchronised because under a scenario with a large number of simulation events, or the absence of network links, GridResource and allocation policy could change attributes of the policy at the same time. Modified Paths: -------------- trunk/source/gridsim/SpaceShared.java trunk/source/gridsim/TimeShared.java trunk/source/gridsim/resFailure/FailureMsg.java trunk/source/gridsim/resFailure/GridResourceWithFailure.java trunk/source/gridsim/resFailure/RegionalGISWithFailure.java trunk/source/gridsim/resFailure/SpaceSharedWithFailure.java trunk/source/gridsim/resFailure/TimeSharedWithFailure.java Modified: trunk/source/gridsim/SpaceShared.java =================================================================== --- trunk/source/gridsim/SpaceShared.java 2008-11-16 10:42:53 UTC (rev 259) +++ trunk/source/gridsim/SpaceShared.java 2009-04-03 04:28:19 UTC (rev 260) @@ -23,6 +23,7 @@ * * @author Manzur Murshed and Rajkumar Buyya * @author Anthony Sulistio (re-written this class) + * @author Marcos Dias de Assuncao (has made some methods synchronized) * @since GridSim Toolkit 2.2 * @see gridsim.GridSim * @see gridsim.ResourceCharacteristics @@ -94,7 +95,7 @@ // if the simulation finishes then exit the loop if (ev.get_tag() == GridSimTags.END_OF_SIMULATION || - super.isEndSimulation() == true) + super.isEndSimulation()) { break; } @@ -128,7 +129,7 @@ * @pre gl != null * @post $none */ - public void gridletSubmit(Gridlet gl, boolean ack) + public synchronized void gridletSubmit(Gridlet gl, boolean ack) { // update the current Gridlets in exec list up to this point in time updateGridletProcessing(); @@ -160,14 +161,14 @@ } // if no available PE then put the ResGridlet into a Queue list - if (success == false) + if (!success) { rgl.setGridletStatus(Gridlet.QUEUED); gridletQueueList_.add(rgl); } // sends back an ack if required - if (ack == true) + if (ack) { super.sendAck(GridSimTags.GRIDLET_SUBMIT_ACK, true, gl.getGridletID(), gl.getUserID() @@ -185,7 +186,7 @@ * @pre userId > 0 * @post $none */ - public int gridletStatus(int gridletId,int userId) + public synchronized int gridletStatus(int gridletId,int userId) { ResGridlet rgl = null; @@ -247,7 +248,7 @@ * @pre userId > 0 * @post $none */ - public void gridletCancel(int gridletId, int userId) + public synchronized void gridletCancel(int gridletId, int userId) { // cancels a Gridlet ResGridlet rgl = cancel(gridletId, userId); @@ -292,7 +293,7 @@ * @pre userId > 0 * @post $none */ - public void gridletPause(int gridletId, int userId, boolean ack) + public synchronized void gridletPause(int gridletId, int userId, boolean ack) { boolean status = false; @@ -354,7 +355,7 @@ } // sends back an ack if required - if (ack == true) + if (ack) { super.sendAck(GridSimTags.GRIDLET_PAUSE_ACK, status, gridletId, userId); @@ -382,7 +383,7 @@ * @pre destId > 0 * @post $none */ - public void gridletMove(int gridletId, int userId, int destId, boolean ack) + public synchronized void gridletMove(int gridletId, int userId, int destId, boolean ack) { // cancels the Gridlet ResGridlet rgl = cancel(gridletId, userId); @@ -394,7 +395,7 @@ ".SpaceShared.gridletMove(): Cannot find " + "Gridlet #" + gridletId + " for User #" + userId); - if (ack == true) // sends back an ack if required + if (ack) // sends back an ack if required { super.sendAck(GridSimTags.GRIDLET_SUBMIT_ACK, false, gridletId, userId); @@ -411,7 +412,7 @@ + gridletId + " for User #" + userId + " since it has FINISHED."); - if (ack == true) // sends back an ack if required + if (ack) // sends back an ack if required { super.sendAck(GridSimTags.GRIDLET_SUBMIT_ACK, false, gridletId, userId); @@ -445,7 +446,7 @@ * @pre userId > 0 * @post $none */ - public void gridletResume(int gridletId, int userId, boolean ack) + public synchronized void gridletResume(int gridletId, int userId, boolean ack) { boolean status = false; @@ -468,7 +469,7 @@ } // otherwise put into Queue list - if (success == false) + if (!success) { rgl.setGridletStatus(Gridlet.QUEUED); gridletQueueList_.add(rgl); @@ -486,7 +487,7 @@ } // sends back an ack if required - if (ack == true) + if (ack) { super.sendAck(GridSimTags.GRIDLET_RESUME_ACK, status, gridletId, userId); @@ -514,7 +515,7 @@ // allocate the Gridlet into an empty PE slot and remove it from // the queue list boolean success = allocatePEtoGridlet(obj); - if (success == true) { + if (success) { gridletQueueList_.remove(obj); } } @@ -528,7 +529,7 @@ * @pre $none * @post $none */ - private void updateGridletProcessing() + private synchronized void updateGridletProcessing() { // Identify MI share for the duration (from last event time) double time = GridSim.clock(); @@ -645,7 +646,7 @@ * @pre length >= 0.0 * @post $none */ - private double forecastFinishTime(double availableRating, double length) + private static double forecastFinishTime(double availableRating, double length) { double finishTime = (length / availableRating); @@ -665,7 +666,7 @@ * @pre $none * @post $none */ - private void checkGridletCompletion() + private synchronized void checkGridletCompletion() { ResGridlet obj = null; int i = 0; @@ -725,8 +726,7 @@ * or paused list. * @param gridletId a Gridlet ID * @param userId the user or owner's ID of this Gridlet - * @param an object of ResGridlet or <tt>null</tt> if this Gridlet is not - * found + * @return an ResGridlet object <tt>null</tt> if this Gridlet is not found * @pre gridletId > 0 * @pre userId > 0 * @post $none @@ -784,6 +784,5 @@ } return rgl; } +} -} // end class - Modified: trunk/source/gridsim/TimeShared.java =================================================================== --- trunk/source/gridsim/TimeShared.java 2008-11-16 10:42:53 UTC (rev 259) +++ trunk/source/gridsim/TimeShared.java 2009-04-03 04:28:19 UTC (rev 260) @@ -9,9 +9,11 @@ package gridsim; +import eduni.simjava.Sim_event; +import eduni.simjava.Sim_system; + +import java.util.Calendar; import java.util.Iterator; -import gridsim.*; -import eduni.simjava.*; /** @@ -25,6 +27,7 @@ * * @author Manzur Murshed and Rajkumar Buyya * @author Anthony Sulistio (re-written this class) + * @author Marcos Dias de Assuncao (has made some methods synchronized) * @since GridSim Toolkit 2.2 * @see gridsim.GridSim * @see gridsim.ResourceCharacteristics @@ -118,7 +121,7 @@ // if the simulation finishes then exit the loop if (ev.get_tag() == GridSimTags.END_OF_SIMULATION || - super.isEndSimulation() == true) + super.isEndSimulation()) { break; } @@ -150,7 +153,7 @@ * @pre gl != null * @post $none */ - public void gridletSubmit(Gridlet gl, boolean ack) + public synchronized void gridletSubmit(Gridlet gl, boolean ack) { // update Gridlets in execution up to this point in time updateGridletProcessing(); @@ -179,7 +182,7 @@ gridletInExecList_.add(rgl); // add into the execution list // sends back an ack if required - if (ack == true) + if (ack) { super.sendAck(GridSimTags.GRIDLET_SUBMIT_ACK, true, gl.getGridletID(), gl.getUserID() @@ -200,7 +203,7 @@ * @pre userId > 0 * @post $none */ - public int gridletStatus(int gridletId, int userId) + public synchronized int gridletStatus(int gridletId, int userId) { ResGridlet rgl = null; @@ -252,7 +255,7 @@ * @pre userId > 0 * @post $none */ - public void gridletCancel(int gridletId, int userId) + public synchronized void gridletCancel(int gridletId, int userId) { // Finds the gridlet in execution and paused list ResGridlet rgl = cancel(gridletId, userId); @@ -301,7 +304,7 @@ * @pre userId > 0 * @post $none */ - public void gridletPause(int gridletId, int userId, boolean ack) + public synchronized void gridletPause(int gridletId, int userId, boolean ack) { boolean status = false; @@ -349,7 +352,7 @@ } // sends back an ack - if (ack == true) + if (ack) { super.sendAck(GridSimTags.GRIDLET_PAUSE_ACK, status, gridletId, userId); @@ -377,7 +380,7 @@ * @pre destId > 0 * @post $none */ - public void gridletMove(int gridletId, int userId, int destId, boolean ack) + public synchronized void gridletMove(int gridletId, int userId, int destId, boolean ack) { // cancel the Gridlet first ResGridlet rgl = cancel(gridletId, userId); @@ -389,7 +392,7 @@ ".TimeShared.gridletMove(): Cannot find " + "Gridlet #" + gridletId + " for User #" + userId); - if (ack == true) // sends ack that this operation fails + if (ack) // sends ack that this operation fails { super.sendAck(GridSimTags.GRIDLET_SUBMIT_ACK, false, gridletId, userId); @@ -409,7 +412,7 @@ + " Gridlet #" + gridletId + " for User #" + userId + " since it has FINISHED."); - if (ack == true) + if (ack) { super.sendAck(GridSimTags.GRIDLET_SUBMIT_ACK, false, gridletId, userId); @@ -436,7 +439,7 @@ * @pre userId > 0 * @post $none */ - public void gridletResume(int gridletId, int userId, boolean ack) + public synchronized void gridletResume(int gridletId, int userId, boolean ack) { boolean success = false; @@ -470,7 +473,7 @@ } // sends back an ack to sender - if (ack == true) + if (ack) { super.sendAck(GridSimTags.GRIDLET_RESUME_ACK, success, gridletId, userId); @@ -698,7 +701,7 @@ * @param length remaining Gridlet length * @return Gridlet's finish time. */ - private double forecastFinishTime(double availableRating, double length) + private static double forecastFinishTime(double availableRating, double length) { double finishTime = length / availableRating; @@ -740,7 +743,7 @@ * @pre $none * @post $none */ - private void internalEvent() + private synchronized void internalEvent() { // this is a constraint that prevents an infinite loop // Compare between 2 floating point numbers. This might be incorrect @@ -761,8 +764,7 @@ * or paused list. * @param gridletId a Gridlet ID * @param userId the user or owner's ID of this Gridlet - * @param an object of ResGridlet or <tt>null</tt> if this Gridlet is not - * found + * @return a ResGridlet object or <tt>null</tt> if this Gridlet is not found * @pre gridletId > 0 * @pre userId > 0 * @post $none @@ -810,6 +812,5 @@ return rgl; } +} -} // end class - Modified: trunk/source/gridsim/resFailure/FailureMsg.java =================================================================== --- trunk/source/gridsim/resFailure/FailureMsg.java 2008-11-16 10:42:53 UTC (rev 259) +++ trunk/source/gridsim/resFailure/FailureMsg.java 2009-04-03 04:28:19 UTC (rev 260) @@ -48,7 +48,7 @@ } /** - * This method sets the time atribute of the ResourceFailure object + * This method sets the time attribute of the ResourceFailure object * @param time the time that the failure will last */ public void setTime(double time) @@ -57,7 +57,7 @@ } /** - * This method returns the time atribute of the ResourceFailure object + * This method returns the time attribute of the ResourceFailure object * @return time */ public double getTime() @@ -66,7 +66,7 @@ } /** - * This method sets the res_id atribute of the ResourceFailure object + * This method sets the res_id attribute of the ResourceFailure object * @param r the resource id of the resource */ public void setRes(int r) @@ -75,7 +75,7 @@ } /** - * This method returns the res_id atribute of the ResourceFailure object + * This method returns the res_id attribute of the ResourceFailure object * @return the resource id */ public int getRes() @@ -84,7 +84,7 @@ } /** - * This method sets the numMachines atribute of the ResourceFailure object + * This method sets the numMachines attribute of the ResourceFailure object * @param n the number of machines which will fail in this resource */ public void setNumMachines(int n) Modified: trunk/source/gridsim/resFailure/GridResourceWithFailure.java =================================================================== --- trunk/source/gridsim/resFailure/GridResourceWithFailure.java 2008-11-16 10:42:53 UTC (rev 259) +++ trunk/source/gridsim/resFailure/GridResourceWithFailure.java 2009-04-03 04:28:19 UTC (rev 260) @@ -48,7 +48,7 @@ /** a ResourceCalendar object */ protected ResourceCalendar resCalendar_; - /** A resource's scheduler. This object is reponsible in scheduling and + /** A resource's scheduler. This object is responsible for scheduling and * and executing submitted Gridlets. */ protected AllocPolicy policy_; Modified: trunk/source/gridsim/resFailure/RegionalGISWithFailure.java =================================================================== --- trunk/source/gridsim/resFailure/RegionalGISWithFailure.java 2008-11-16 10:42:53 UTC (rev 259) +++ trunk/source/gridsim/resFailure/RegionalGISWithFailure.java 2009-04-03 04:28:19 UTC (rev 260) @@ -18,7 +18,6 @@ import eduni.simjava.*; import gridsim.*; import gridsim.net.Link; -import eduni.simjava.distributions.Sim_uniform_obj; import gridsim.resFailure.FailureMsg; import eduni.simjava.distributions.DiscreteGenerator; import eduni.simjava.distributions.ContinuousGenerator; Modified: trunk/source/gridsim/resFailure/SpaceSharedWithFailure.java =================================================================== --- trunk/source/gridsim/resFailure/SpaceSharedWithFailure.java 2008-11-16 10:42:53 UTC (rev 259) +++ trunk/source/gridsim/resFailure/SpaceSharedWithFailure.java 2009-04-03 04:28:19 UTC (rev 260) @@ -32,6 +32,7 @@ * this Gridlet to one PE. * * @author Agustin Caminero + * @author Marcos Dias de Assuncao (added synchronisation) * @since GridSim Toolkit 4.1 * @see gridsim.SpaceShared * @invariant $none @@ -103,7 +104,7 @@ // if the simulation finishes then exit the loop if (ev.get_tag() == GridSimTags.END_OF_SIMULATION || - super.isEndSimulation() == true) + super.isEndSimulation()) { break; } @@ -137,7 +138,7 @@ * @pre gl != null * @post $none */ - public void gridletSubmit(Gridlet gl, boolean ack) + public synchronized void gridletSubmit(Gridlet gl, boolean ack) { // update the current Gridlets in exec list up to this point in time updateGridletProcessing(); @@ -169,14 +170,14 @@ } // if no available PE then put the ResGridlet into a Queue list - if (success == false) + if (!success) { rgl.setGridletStatus(Gridlet.QUEUED); gridletQueueList_.add(rgl); } // sends back an ack if required - if (ack == true) + if (ack) { super.sendAck(GridSimTags.GRIDLET_SUBMIT_ACK, true, gl.getGridletID(), gl.getUserID() @@ -194,7 +195,7 @@ * @pre userId > 0 * @post $none */ - public int gridletStatus(int gridletId,int userId) + public synchronized int gridletStatus(int gridletId,int userId) { ResGridlet rgl = null; @@ -256,7 +257,7 @@ * @pre userId > 0 * @post $none */ - public void gridletCancel(int gridletId, int userId) + public synchronized void gridletCancel(int gridletId, int userId) { // cancels a Gridlet ResGridlet rgl = cancel(gridletId, userId); @@ -301,7 +302,7 @@ * @pre userId > 0 * @post $none */ - public void gridletPause(int gridletId, int userId, boolean ack) + public synchronized void gridletPause(int gridletId, int userId, boolean ack) { boolean status = false; @@ -363,7 +364,7 @@ } // sends back an ack if required - if (ack == true) + if (ack) { super.sendAck(GridSimTags.GRIDLET_PAUSE_ACK, status, gridletId, userId); @@ -391,7 +392,7 @@ * @pre destId > 0 * @post $none */ - public void gridletMove(int gridletId, int userId, int destId, boolean ack) + public synchronized void gridletMove(int gridletId, int userId, int destId, boolean ack) { // cancels the Gridlet ResGridlet rgl = cancel(gridletId, userId); @@ -403,7 +404,7 @@ ".SpaceSharedWithFailure.gridletMove(): Cannot find " + "Gridlet #" + gridletId + " for User #" + userId); - if (ack == true) // sends back an ack if required + if (ack) // sends back an ack if required { super.sendAck(GridSimTags.GRIDLET_SUBMIT_ACK, false, gridletId, userId); @@ -419,7 +420,7 @@ + ".SpaceSharedWithFailure.gridletMove(): Cannot move Gridlet #" + gridletId + " for User #"+ userId+ " since it has FINISHED."); - if (ack == true) // sends back an ack if required + if (ack) // sends back an ack if required { super.sendAck(GridSimTags.GRIDLET_SUBMIT_ACK, false, gridletId, userId); @@ -453,7 +454,7 @@ * @pre userId > 0 * @post $none */ - public void gridletResume(int gridletId, int userId, boolean ack) + public synchronized void gridletResume(int gridletId, int userId, boolean ack) { boolean status = false; @@ -476,7 +477,7 @@ } // otherwise put into Queue list - if (success == false) + if (!success) { rgl.setGridletStatus(Gridlet.QUEUED); gridletQueueList_.add(rgl); @@ -494,7 +495,7 @@ } // sends back an ack if required - if (ack == true) + if (ack) { super.sendAck(GridSimTags.GRIDLET_RESUME_ACK, status, gridletId, userId); @@ -522,7 +523,7 @@ // allocate the Gridlet into an empty PE slot and remove it from // the queue list boolean success = allocatePEtoGridlet(obj); - if (success == true) { + if (!success) { gridletQueueList_.remove(obj); } } @@ -536,7 +537,7 @@ * @pre $none * @post $none */ - private void updateGridletProcessing() + private synchronized void updateGridletProcessing() { // Identify MI share for the duration (from last event time) double time = GridSim.clock(); @@ -653,7 +654,7 @@ * @pre length >= 0.0 * @post $none */ - private double forecastFinishTime(double availableRating, double length) + private static double forecastFinishTime(double availableRating, double length) { double finishTime = (length / availableRating); @@ -673,7 +674,7 @@ * @pre $none * @post $none */ - private void checkGridletCompletion() + private synchronized void checkGridletCompletion() { ResGridlet obj = null; int i = 0; @@ -733,8 +734,7 @@ * or paused list. * @param gridletId a Gridlet ID * @param userId the user or owner's ID of this Gridlet - * @param an object of ResGridlet or <tt>null</tt> if this Gridlet is not - * found + * @return a ResGridlet or <tt>null</tt> if this Gridlet is not found * @pre gridletId > 0 * @pre userId > 0 * @post $none @@ -797,9 +797,9 @@ * Sets the status of all Gridlets in this resource to <tt>FAILED</tt>. * Then sends them back to users, and clean up the relevant lists. */ - public void setGridletsFailed() + public synchronized void setGridletsFailed() { - ResGridlet rgl; + ResGridlet rgl = null; int gridletPausedList_size = gridletPausedList_.size(); int gridletInExecList_size = gridletInExecList_.size(); @@ -869,7 +869,7 @@ * Then sends them back to users, and clean up the relevant lists. * @param failedMachID the id of the failed machine */ - public void setGridletsFailed(int failedMachID) + public synchronized void setGridletsFailed(int failedMachID) { /*************** // Uncomment this to get more info on the progress of sims @@ -907,5 +907,4 @@ } } } - -} // end class +} Modified: trunk/source/gridsim/resFailure/TimeSharedWithFailure.java =================================================================== --- trunk/source/gridsim/resFailure/TimeSharedWithFailure.java 2008-11-16 10:42:53 UTC (rev 259) +++ trunk/source/gridsim/resFailure/TimeSharedWithFailure.java 2009-04-03 04:28:19 UTC (rev 260) @@ -122,7 +122,7 @@ // if the simulation finishes then exit the loop if (ev.get_tag() == GridSimTags.END_OF_SIMULATION || - super.isEndSimulation() == true) + super.isEndSimulation()) { break; } @@ -154,7 +154,7 @@ * @pre gl != null * @post $none */ - public void gridletSubmit(Gridlet gl, boolean ack) + public synchronized void gridletSubmit(Gridlet gl, boolean ack) { // update Gridlets in execution up to this point in time updateGridletProcessing(); @@ -183,7 +183,7 @@ gridletInExecList_.add(rgl); // add into the execution list // sends back an ack if required - if (ack == true) + if (ack) { super.sendAck(GridSimTags.GRIDLET_SUBMIT_ACK, true, gl.getGridletID(), gl.getUserID() @@ -204,7 +204,7 @@ * @pre userId > 0 * @post $none */ - public int gridletStatus(int gridletId, int userId) + public synchronized int gridletStatus(int gridletId, int userId) { ResGridlet rgl = null; @@ -256,7 +256,7 @@ * @pre userId > 0 * @post $none */ - public void gridletCancel(int gridletId, int userId) + public synchronized void gridletCancel(int gridletId, int userId) { // Finds the gridlet in execution and paused list ResGridlet rgl = cancel(gridletId, userId); @@ -305,7 +305,7 @@ * @pre userId > 0 * @post $none */ - public void gridletPause(int gridletId, int userId, boolean ack) + public synchronized void gridletPause(int gridletId, int userId, boolean ack) { boolean status = false; @@ -353,7 +353,7 @@ } // sends back an ack - if (ack == true) + if (ack) { super.sendAck(GridSimTags.GRIDLET_PAUSE_ACK, status, gridletId, userId); @@ -381,7 +381,7 @@ * @pre destId > 0 * @post $none */ - public void gridletMove(int gridletId, int userId, int destId, boolean ack) + public synchronized void gridletMove(int gridletId, int userId, int destId, boolean ack) { // cancel the Gridlet first ResGridlet rgl = cancel(gridletId, userId); @@ -393,7 +393,7 @@ ".TimeSharedWithFailure.gridletMove(): Cannot find " + "Gridlet #" + gridletId + " for User #" + userId); - if (ack == true) // sends ack that this operation fails + if (ack) // sends ack that this operation fails { super.sendAck(GridSimTags.GRIDLET_SUBMIT_ACK, false, gridletId, userId); @@ -413,7 +413,7 @@ + " Gridlet #" + gridletId + " for User #" + userId + " since it has FINISHED."); - if (ack == true) + if (ack) { super.sendAck(GridSimTags.GRIDLET_SUBMIT_ACK, false, gridletId, userId); @@ -440,7 +440,7 @@ * @pre userId > 0 * @post $none */ - public void gridletResume(int gridletId, int userId, boolean ack) + public synchronized void gridletResume(int gridletId, int userId, boolean ack) { boolean success = false; @@ -474,7 +474,7 @@ } // sends back an ack to sender - if (ack == true) + if (ack) { super.sendAck(GridSimTags.GRIDLET_RESUME_ACK, success, gridletId, userId); @@ -745,7 +745,7 @@ * @pre $none * @post $none */ - private void internalEvent() + private synchronized void internalEvent() { // this is a constraint that prevents an infinite loop // Compare between 2 floating point numbers. This might be incorrect @@ -766,8 +766,7 @@ * or paused list. * @param gridletId a Gridlet ID * @param userId the user or owner's ID of this Gridlet - * @param an object of ResGridlet or <tt>null</tt> if this Gridlet is not - * found + * @return a ResGridlet or <tt>null</tt> if this Gridlet is not found * @pre gridletId > 0 * @pre userId > 0 * @post $none This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |