From: <mar...@us...> - 2007-09-14 23:23:04
|
Revision: 60 http://gridsim.svn.sourceforge.net/gridsim/?rev=60&view=rev Author: marcos_dias Date: 2007-09-14 16:23:03 -0700 (Fri, 14 Sep 2007) Log Message: ----------- The javadoc tags @since have been changed as kindly requested by Anthony in a personal communication. "Please remove them instantly to contain the damage level". Modified Paths: -------------- branches/gridsim4.0-branch3/source/eduni/simjava/Evqueue.java branches/gridsim4.0-branch3/source/gridsim/PERange.java branches/gridsim4.0-branch3/source/gridsim/PERangeList.java branches/gridsim4.0-branch3/source/gridsim/ParallelSpaceShared.java branches/gridsim4.0-branch3/source/gridsim/SSGridlet.java branches/gridsim4.0-branch3/source/gridsim/SpaceShared.java branches/gridsim4.0-branch3/source/gridsim/gui/AllocationAction.java branches/gridsim4.0-branch3/source/gridsim/gui/AllocationListener.java branches/gridsim4.0-branch3/source/gridsim/gui/AllocationSubject.java branches/gridsim4.0-branch3/source/gridsim/gui/GridSimVisualizer.java branches/gridsim4.0-branch3/source/gridsim/gui/GridletPanel.java branches/gridsim4.0-branch3/source/gridsim/gui/ResourceWindow.java branches/gridsim4.0-branch3/source/gridsim/services/AcquisitionPolicy.java branches/gridsim4.0-branch3/source/gridsim/services/MessageBody.java branches/gridsim4.0-branch3/source/gridsim/services/Negotiation.java branches/gridsim4.0-branch3/source/gridsim/services/NegotiationList.java branches/gridsim4.0-branch3/source/gridsim/services/NegotiationMessage.java branches/gridsim4.0-branch3/source/gridsim/services/NegotiationPolicy.java branches/gridsim4.0-branch3/source/gridsim/services/Provider.java branches/gridsim4.0-branch3/source/gridsim/services/ProviderCalendar.java branches/gridsim4.0-branch3/source/gridsim/services/ProviderCharacteristics.java branches/gridsim4.0-branch3/source/gridsim/services/ProvisioningPolicy.java branches/gridsim4.0-branch3/source/gridsim/services/Service.java branches/gridsim4.0-branch3/source/gridsim/services/ServiceAttributes.java branches/gridsim4.0-branch3/source/gridsim/services/ServiceGridTags.java branches/gridsim4.0-branch3/source/gridsim/services/ServiceGridlet.java branches/gridsim4.0-branch3/source/gridsim/services/ServiceList.java branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequest.java branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequestList.java branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequestWorkload.java branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequestWorkloadList.java branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequester.java branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequirement.java branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequirementList.java branches/gridsim4.0-branch3/source/gridsim/services/ServiceWorkload.java branches/gridsim4.0-branch3/source/gridsim/services/ServiceWorkloadItem.java branches/gridsim4.0-branch3/source/gridsim/services/SimpleAcquisitionPolicy.java branches/gridsim4.0-branch3/source/gridsim/services/SimpleProvisionPolicy.java branches/gridsim4.0-branch3/source/gridsim/services/filter/ServiceFilter.java branches/gridsim4.0-branch3/source/gridsim/services/filter/ServiceNameFilter.java branches/gridsim4.0-branch3/source/gridsim/services/filter/ServiceNameTypeFilter.java branches/gridsim4.0-branch3/source/gridsim/services/filter/ServiceTypeFilter.java branches/gridsim4.0-branch3/source/gridsim/services/index/GridServiceRepository.java branches/gridsim4.0-branch3/source/gridsim/services/index/RegionalGSR.java Modified: branches/gridsim4.0-branch3/source/eduni/simjava/Evqueue.java =================================================================== --- branches/gridsim4.0-branch3/source/eduni/simjava/Evqueue.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/eduni/simjava/Evqueue.java 2007-09-14 23:23:03 UTC (rev 60) @@ -20,6 +20,7 @@ * @see eduni.simjava.Sim_system * @version 0.1, 25 June 1995 * @author Ross McNab + * @author Marcos Dias de Assuncao (changed this class to use SortedSet) */ public class Evqueue { private SortedSet sortedSet; Modified: branches/gridsim4.0-branch3/source/gridsim/PERange.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/PERange.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/PERange.java 2007-09-14 23:23:03 UTC (rev 60) @@ -13,9 +13,9 @@ * Gridlets. For example, a Gridlet is using a range of PEs (0..4). * * @author Marcos Dias de Assuncao + * @since GridSim Turbo Alpha 0.1 * @see PERangeList * @see ParallelSpaceShared - * @since GridSim Toolkit 4.2 */ public class PERange implements Cloneable { Modified: branches/gridsim4.0-branch3/source/gridsim/PERangeList.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/PERangeList.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/PERangeList.java 2007-09-14 23:23:03 UTC (rev 60) @@ -18,11 +18,10 @@ * to create a profile of ranges available at particular simulation times. * * @author Marcos Dias de Assuncao - * @since GridSim 4.2 - * + * @since GridSim Turbo Alpha 0.1 + * * @see PERange * @see ParallelSpaceShared - * @since GridSim Toolkit 4.2 */ public class PERangeList extends LinkedList<PERange> @@ -482,6 +481,7 @@ /** * Used to sort the list according to the beginning of the ranges * @author Marcos Dias de Assuncao + * @since GridSim Turbo Alpha 0.1 */ class OrderByBegginingAsc implements Comparator<PERange>{ Modified: branches/gridsim4.0-branch3/source/gridsim/ParallelSpaceShared.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/ParallelSpaceShared.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/ParallelSpaceShared.java 2007-09-14 23:23:03 UTC (rev 60) @@ -39,7 +39,7 @@ * </ul> * * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @since GridSim Turbo Alpha 0.1 * @see gridsim.GridSim * @see gridsim.ResourceCharacteristics * @see gridsim.AllocPolicy Modified: branches/gridsim4.0-branch3/source/gridsim/SSGridlet.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/SSGridlet.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/SSGridlet.java 2007-09-14 23:23:03 UTC (rev 60) @@ -19,6 +19,7 @@ * the ranges of PEs (Processing Element) allocated to it. * * @author Marcos Dias de Assuncao (copied the most of it from @link{ResGridlet}} + * @since GridSim Turbo Alpha 0.1 */ public class SSGridlet { Modified: branches/gridsim4.0-branch3/source/gridsim/SpaceShared.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/SpaceShared.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/SpaceShared.java 2007-09-14 23:23:03 UTC (rev 60) @@ -135,12 +135,12 @@ if (gl.getNumPE() > 1) { String userName = GridSim.getEntityName( gl.getUserID() ); -// System.out.println(); -// System.out.println(super.get_name() + ".gridletSubmit(): " + -// " Gridlet #" + gl.getGridletID() + " from " + userName + -// " user requires " + gl.getNumPE() + " PEs."); -// System.out.println("--> Process this Gridlet to 1 PE only."); -// System.out.println(); + System.out.println(); + System.out.println(super.get_name() + ".gridletSubmit(): " + + " Gridlet #" + gl.getGridletID() + " from " + userName + + " user requires " + gl.getNumPE() + " PEs."); + System.out.println("--> Process this Gridlet to 1 PE only."); + System.out.println(); // also adjusted the length because the number of PEs are reduced int numPE = gl.getNumPE(); Modified: branches/gridsim4.0-branch3/source/gridsim/gui/AllocationAction.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/gui/AllocationAction.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/gui/AllocationAction.java 2007-09-14 23:23:03 UTC (rev 60) @@ -18,6 +18,8 @@ * passed to the listener. * * @author Marcos Dias de Assuncao + * @since GridSim Turbo Alpha 0.1 + * */ public class AllocationAction { Modified: branches/gridsim4.0-branch3/source/gridsim/gui/AllocationListener.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/gui/AllocationListener.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/gui/AllocationListener.java 2007-09-14 23:23:03 UTC (rev 60) @@ -14,6 +14,7 @@ * to display information about the scheduling queues. * * @author Marcos Dias de Assuncao + * @since GridSim Turbo Alpha 0.1 */ public interface AllocationListener { Modified: branches/gridsim4.0-branch3/source/gridsim/gui/AllocationSubject.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/gui/AllocationSubject.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/gui/AllocationSubject.java 2007-09-14 23:23:03 UTC (rev 60) @@ -14,6 +14,7 @@ * to display information about the scheduling queues. * * @author Marcos Dias de Assuncao + * @since GridSim Turbo Alpha 0.1 * * @see AllocationAction * @see AllocationListener Modified: branches/gridsim4.0-branch3/source/gridsim/gui/GridSimVisualizer.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/gui/GridSimVisualizer.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/gui/GridSimVisualizer.java 2007-09-14 23:23:03 UTC (rev 60) @@ -49,11 +49,13 @@ * <b>NOTE:</b> This visualisation tool should be used for debugging * purposes only. It is useful if you want to evaluate a new allocation * policy for example. A real experiment is not meant to have any - * visualisation features. + * visualisation features. This interface was initially created for + * another simulator called PajFit available at <b>http://pajfit.sourceforge.net/</b>. * * @author Marco A. S. Netto (created this visualisation tool) * @author Marcos Dias de Assuncao (modified this class to be * used by GridSim.) + * @since GridSim Turbo Alpha 0.1 * * @see gridsim.GridSim#startGridSimulation(boolean visualiser) * @see gridsim.ParallelSpaceShared Modified: branches/gridsim4.0-branch3/source/gridsim/gui/GridletPanel.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/gui/GridletPanel.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/gui/GridletPanel.java 2007-09-14 23:23:03 UTC (rev 60) @@ -43,11 +43,14 @@ /** * This class corresponds to the panel that contains information about the * Gridlets received by a Grid resource. This panel displays the list of Gridles. - * If the user clicks on a Gridlet, additional information is shown. + * If the user clicks on a Gridlet, additional information is shown. <br> + * This interface was initially created for another simulator called PajFit + * available at <b>http://pajfit.sourceforge.net/</b>. * * @author Marco A. S. Netto (created this class) * @author Marcos Dias de Assuncao (modified this class to be used by GridSim * and receive updated from the @link{ResourceWindow}) + * @since GridSim Turbo Alpha 0.1 */ public class GridletPanel extends JPanel Modified: branches/gridsim4.0-branch3/source/gridsim/gui/ResourceWindow.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/gui/ResourceWindow.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/gui/ResourceWindow.java 2007-09-14 23:23:03 UTC (rev 60) @@ -62,10 +62,13 @@ /** * @link{Visualiser} class represents the window that shows the - * scheduling result of a give resource allocation policy. + * scheduling result of a give resource allocation policy. This interface + * was initially created for another simulator called PajFit available + * at <b>http://pajfit.sourceforge.net/</b>. * * @author Marco A. S. Netto * @author Marcos Dias de Assuncao (modified this class to be used by GridSim) + * @since GridSim Turbo Alpha 0.1 */ public class ResourceWindow extends JFrame implements AllocationListener { Modified: branches/gridsim4.0-branch3/source/gridsim/services/AcquisitionPolicy.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/AcquisitionPolicy.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/AcquisitionPolicy.java 2007-09-14 23:23:03 UTC (rev 60) @@ -24,7 +24,6 @@ import java.util.List; /** - * * {@link AcquisitionPolicy} is an abstract class that handles the internal * {@link Provider} acquisition policy. It defines the policy for * service or resource acquision by a provider to serve the requests @@ -41,7 +40,7 @@ * @see IGProvisionPolicy * * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @since GridSim Turbo Alpha 0.1 */ public abstract class AcquisitionPolicy extends Sim_entity { Modified: branches/gridsim4.0-branch3/source/gridsim/services/MessageBody.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/MessageBody.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/MessageBody.java 2007-09-14 23:23:03 UTC (rev 60) @@ -13,8 +13,8 @@ * In the scope of the WS-Agreement specification, a can be * the agreement offer sent by an initiator to a responder. * - * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @author Marcos Dias de Assuncao + * @since GridSim Turbo Alpha 0.1 * * @see gridsim.services.ServiceGridTags */ Modified: branches/gridsim4.0-branch3/source/gridsim/services/Negotiation.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/Negotiation.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/Negotiation.java 2007-09-14 23:23:03 UTC (rev 60) @@ -18,8 +18,8 @@ * WS-Agreement specification, a negotiation can be * seen as an agreement between a provider and a consumer. * - * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @author Marcos Dias de Assuncao + * @since GridSim Turbo Alpha 0.1 * * @see gridsim.services.ServiceGridTags */ Modified: branches/gridsim4.0-branch3/source/gridsim/services/NegotiationList.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/NegotiationList.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/NegotiationList.java 2007-09-14 23:23:03 UTC (rev 60) @@ -16,8 +16,8 @@ * This class can be instantiated to model a collection of negotiations * in which a provider is involved. * - * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @author Marcos Dias de Assuncao + * @since GridSim Turbo Alpha 0.1 */ public class NegotiationList extends LinkedList { Modified: branches/gridsim4.0-branch3/source/gridsim/services/NegotiationMessage.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/NegotiationMessage.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/NegotiationMessage.java 2007-09-14 23:23:03 UTC (rev 60) @@ -15,8 +15,8 @@ * In the scope of the WS-Agreement specification, a can be * the agreement offer sent by an initiator to a responder. * - * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @author Marcos Dias de Assuncao + * @since GridSim Turbo Alpha 0.1 * * @see gridsim.services.ServiceGridTags */ Modified: branches/gridsim4.0-branch3/source/gridsim/services/NegotiationPolicy.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/NegotiationPolicy.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/NegotiationPolicy.java 2007-09-14 23:23:03 UTC (rev 60) @@ -21,8 +21,8 @@ * @see ProvisioningPolicy * @see AcquisitionPolicy * - * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @author Marcos Dias de Assuncao + * @since GridSim Turbo Alpha 0.1 */ public interface NegotiationPolicy { Modified: branches/gridsim4.0-branch3/source/gridsim/services/Provider.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/Provider.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/Provider.java 2007-09-14 23:23:03 UTC (rev 60) @@ -28,7 +28,7 @@ * provider. * * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @since GridSim Turbo Alpha 0.1 * * @see NegotiationPolicy * @see ProvisioningPolicy Modified: branches/gridsim4.0-branch3/source/gridsim/services/ProviderCalendar.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/ProviderCalendar.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/ProviderCalendar.java 2007-09-14 23:23:03 UTC (rev 60) @@ -15,8 +15,8 @@ * a local load on Grid providers that may vary according to the time zone, * time, weekends and holidays. * - * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @author Marcos Dias de Assuncao + * @since GridSim Turbo Alpha 0.1 * * @see gridsim.ResourceCalendar */ Modified: branches/gridsim4.0-branch3/source/gridsim/services/ProviderCharacteristics.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/ProviderCharacteristics.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/ProviderCharacteristics.java 2007-09-14 23:23:03 UTC (rev 60) @@ -17,8 +17,8 @@ * provider such as time zone, service list, provision policy and * acquisition policy. * - * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @author Marcos Dias de Assuncao + * @since GridSim Turbo Alpha 0.1 */ public class ProviderCharacteristics { Modified: branches/gridsim4.0-branch3/source/gridsim/services/ProvisioningPolicy.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/ProvisioningPolicy.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/ProvisioningPolicy.java 2007-09-14 23:23:03 UTC (rev 60) @@ -33,7 +33,7 @@ * @see AcquisitionPolicy * * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @since GridSim Turbo Alpha 0.1 */ public abstract class ProvisioningPolicy extends Sim_entity { Modified: branches/gridsim4.0-branch3/source/gridsim/services/Service.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/Service.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/Service.java 2007-09-14 23:23:03 UTC (rev 60) @@ -22,7 +22,7 @@ * of requests to the service S. * * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @since GridSim Turbo Alpha 0.1 */ public abstract class Service { Modified: branches/gridsim4.0-branch3/source/gridsim/services/ServiceAttributes.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/ServiceAttributes.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/ServiceAttributes.java 2007-09-14 23:23:03 UTC (rev 60) @@ -18,7 +18,7 @@ * @see gridsim.services.Service * * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @since GridSim Turbo Alpha 0.1 */ public class ServiceAttributes { Modified: branches/gridsim4.0-branch3/source/gridsim/services/ServiceGridTags.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/ServiceGridTags.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/ServiceGridTags.java 2007-09-14 23:23:03 UTC (rev 60) @@ -10,8 +10,8 @@ /** * This class contains additional tags for the ServiceGrid functionalities * - * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @author Marcos Dias de Assuncao + * @since GridSim Turbo Alpha 0.1 */ public class ServiceGridTags { Modified: branches/gridsim4.0-branch3/source/gridsim/services/ServiceGridlet.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/ServiceGridlet.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/ServiceGridlet.java 2007-09-14 23:23:03 UTC (rev 60) @@ -23,7 +23,7 @@ * @see Gridlet * * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @since GridSim Turbo Alpha 0.1 */ public class ServiceGridlet extends Gridlet Modified: branches/gridsim4.0-branch3/source/gridsim/services/ServiceList.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/ServiceList.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/ServiceList.java 2007-09-14 23:23:03 UTC (rev 60) @@ -16,8 +16,8 @@ * This class can be instantiated to model a collection of services * offered by a service provider. * - * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @author Marcos Dias de Assuncao + * @since GridSim Turbo Alpha 0.1 */ public class ServiceList extends LinkedList { Modified: branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequest.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequest.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequest.java 2007-09-14 23:23:03 UTC (rev 60) @@ -13,8 +13,8 @@ * A class that defines the basic functionalities of a service * request made by a consumer to a service provider. * - * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @author Marcos Dias de Assuncao + * @since GridSim Turbo Alpha 0.1 * * @see Provider * @see ProvisioningPolicy Modified: branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequestList.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequestList.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequestList.java 2007-09-14 23:23:03 UTC (rev 60) @@ -14,8 +14,8 @@ * GridSim ServiceRequestList maintains a * linked-list of ServiceRequest * - * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @author Marcos Dias de Assuncao + * @since GridSim Turbo Alpha 0.1 */ public class ServiceRequestList extends LinkedList { Modified: branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequestWorkload.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequestWorkload.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequestWorkload.java 2007-09-14 23:23:03 UTC (rev 60) @@ -22,7 +22,8 @@ * @see ServiceGridlet * * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @since GridSim Turbo Alpha 0.1 + * */ public class ServiceRequestWorkload { private ServiceRequest request_; // the service request Modified: branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequestWorkloadList.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequestWorkloadList.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequestWorkloadList.java 2007-09-14 23:23:03 UTC (rev 60) @@ -21,7 +21,7 @@ * @see ServiceGridlet * * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @since GridSim Turbo Alpha 0.1 */ public class ServiceRequestWorkloadList extends LinkedList { Modified: branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequester.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequester.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequester.java 2007-09-14 23:23:03 UTC (rev 60) @@ -43,9 +43,8 @@ * @see ServiceAttributes * @see ServiceRequest * - * - * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @author Marcos Dias de Assuncao + * @since GridSim Turbo Alpha 0.1 */ public class ServiceRequester extends GridSim { Modified: branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequirement.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequirement.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequirement.java 2007-09-14 23:23:03 UTC (rev 60) @@ -20,7 +20,7 @@ * @see ServiceRequirementList * * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @since GridSim Turbo Alpha 0.1 */ public abstract class ServiceRequirement { Modified: branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequirementList.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequirementList.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/ServiceRequirementList.java 2007-09-14 23:23:03 UTC (rev 60) @@ -20,7 +20,7 @@ * @see ServiceRequirement * * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @since GridSim Turbo Alpha 0.1 */ public class ServiceRequirementList extends LinkedList { Modified: branches/gridsim4.0-branch3/source/gridsim/services/ServiceWorkload.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/ServiceWorkload.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/ServiceWorkload.java 2007-09-14 23:23:03 UTC (rev 60) @@ -18,8 +18,8 @@ * access to a given service or can be a list of service gridlets * that have to be executed on resources. * - * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @author Marcos Dias de Assuncao + * @since GridSim Turbo Alpha 0.1 */ public class ServiceWorkload extends LinkedList { Modified: branches/gridsim4.0-branch3/source/gridsim/services/ServiceWorkloadItem.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/ServiceWorkloadItem.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/ServiceWorkloadItem.java 2007-09-14 23:23:03 UTC (rev 60) @@ -15,7 +15,7 @@ * @see ServiceGridlet * * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @since GridSim Turbo Alpha 0.1 */ public interface ServiceWorkloadItem { Modified: branches/gridsim4.0-branch3/source/gridsim/services/SimpleAcquisitionPolicy.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/SimpleAcquisitionPolicy.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/SimpleAcquisitionPolicy.java 2007-09-14 23:23:03 UTC (rev 60) @@ -27,7 +27,7 @@ * @see AcquisitionPolicy * * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @since GridSim Turbo Alpha 0.1 */ public class SimpleAcquisitionPolicy extends AcquisitionPolicy { Modified: branches/gridsim4.0-branch3/source/gridsim/services/SimpleProvisionPolicy.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/SimpleProvisionPolicy.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/SimpleProvisionPolicy.java 2007-09-14 23:23:03 UTC (rev 60) @@ -26,7 +26,7 @@ * @see ProvisioningPolicy * * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @since GridSim Turbo Alpha 0.1 */ public class SimpleProvisionPolicy extends ProvisioningPolicy { Modified: branches/gridsim4.0-branch3/source/gridsim/services/filter/ServiceFilter.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/filter/ServiceFilter.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/filter/ServiceFilter.java 2007-09-14 23:23:03 UTC (rev 60) @@ -21,7 +21,7 @@ * </ol> * @see ServiceNameFilter * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @since GridSim Turbo Alpha 0.1 */ public interface ServiceFilter { Modified: branches/gridsim4.0-branch3/source/gridsim/services/filter/ServiceNameFilter.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/filter/ServiceNameFilter.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/filter/ServiceNameFilter.java 2007-09-14 23:23:03 UTC (rev 60) @@ -13,7 +13,7 @@ /** * Creates a filter based on a service name * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @since GridSim Turbo Alpha 0.1 */ public class ServiceNameFilter implements ServiceFilter { Modified: branches/gridsim4.0-branch3/source/gridsim/services/filter/ServiceNameTypeFilter.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/filter/ServiceNameTypeFilter.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/filter/ServiceNameTypeFilter.java 2007-09-14 23:23:03 UTC (rev 60) @@ -13,7 +13,7 @@ /** * Creates a filter based on a service name and type * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @since GridSim Turbo Alpha 0.1 */ public class ServiceNameTypeFilter implements ServiceFilter { Modified: branches/gridsim4.0-branch3/source/gridsim/services/filter/ServiceTypeFilter.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/filter/ServiceTypeFilter.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/filter/ServiceTypeFilter.java 2007-09-14 23:23:03 UTC (rev 60) @@ -13,7 +13,7 @@ /** * Creates a filter based on a service type * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @since GridSim Turbo Alpha 0.1 */ public class ServiceTypeFilter implements ServiceFilter { Modified: branches/gridsim4.0-branch3/source/gridsim/services/index/GridServiceRepository.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/index/GridServiceRepository.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/index/GridServiceRepository.java 2007-09-14 23:23:03 UTC (rev 60) @@ -34,7 +34,8 @@ * {@link gridsim.services.index.RegionalGSR} class. * * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @since GridSim Turbo Alpha 0.1 + * * @see gridsim.services.index.RegionalGSR */ Modified: branches/gridsim4.0-branch3/source/gridsim/services/index/RegionalGSR.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/services/index/RegionalGSR.java 2007-09-14 07:34:35 UTC (rev 59) +++ branches/gridsim4.0-branch3/source/gridsim/services/index/RegionalGSR.java 2007-09-14 23:23:03 UTC (rev 60) @@ -29,7 +29,7 @@ * offering a service with particular attributes. * * @author Marcos Dias de Assuncao - * @since GridSim Toolkit 4.1 + * @since GridSim Turbo Alpha 0.1 */ public class RegionalGSR extends RegionalGIS { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-02-08 03:25:17
|
Revision: 91 http://gridsim.svn.sourceforge.net/gridsim/?rev=91&view=rev Author: marcos_dias Date: 2008-02-07 19:25:23 -0800 (Thu, 07 Feb 2008) Log Message: ----------- This update allows the user to pause the simulation at a given simulation time. If the user sets the simulation to run until 50000 seconds and clicks the run button, the simulation will run continuously until 50000 and stop at the first even whose time is >= to 50000. Modified Paths: -------------- branches/gridsim4.0-branch3/source/eduni/simjava/Sim_system.java branches/gridsim4.0-branch3/source/gridsim/GridSim.java branches/gridsim4.0-branch3/source/gridsim/gui/DefaultGridSimVisualizer.java branches/gridsim4.0-branch3/source/gridsim/gui/ResourceWindow.java branches/gridsim4.0-branch3/source/gridsim/turbo/ARMessage.java Modified: branches/gridsim4.0-branch3/source/eduni/simjava/Sim_system.java =================================================================== --- branches/gridsim4.0-branch3/source/eduni/simjava/Sim_system.java 2008-02-08 01:57:22 UTC (rev 90) +++ branches/gridsim4.0-branch3/source/eduni/simjava/Sim_system.java 2008-02-08 03:25:23 UTC (rev 91) @@ -77,6 +77,7 @@ // ADDED BY MARCOS - 2007-09-07 private static boolean paused = false; + private static double pauseAt = Double.MAX_VALUE; private static Object syncObj = new Object(); /** @@ -534,7 +535,12 @@ // ADDED BY MARCOS TO ALLOW THE // SIMULATION TO BE PAUSED + synchronized(syncObj){ + + if(clock >= pauseAt) + paused = true; + while(paused){ try { syncObj.wait(); @@ -710,6 +716,23 @@ return paused; } } + + /** + * This method is called if one wants to pause the simulation + * at a given time + * @time the time at which the simulation has to be paused + * @return <tt>true</tt>if the simulation has been paused + * or <tt>false</tt> otherwise. + */ + public static synchronized boolean pauseSimulation(double time) { + synchronized(syncObj){ + if(time <= clock) + return false; + else + pauseAt = time; + } + return true; + } /** * This method is called if one wants to resume the simulation @@ -720,6 +743,10 @@ public static synchronized boolean resumeSimulation() { synchronized(syncObj){ paused = false; + + if(pauseAt <= clock) + pauseAt = Double.MAX_VALUE; + syncObj.notify(); return !paused; } Modified: branches/gridsim4.0-branch3/source/gridsim/GridSim.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/GridSim.java 2008-02-08 01:57:22 UTC (rev 90) +++ branches/gridsim4.0-branch3/source/gridsim/GridSim.java 2008-02-08 03:25:23 UTC (rev 91) @@ -825,6 +825,17 @@ } /** + * Pauses the simulation at a given simulation time. This method + * should be used for debugging purposes only + * @param time the time when the simulation should be paused + * @return <tt>true</tt> if the simulation can be paused or + * <tt>false</tt> otherwise. + */ + public static boolean pauseSimulation(double time){ + return Sim_system.pauseSimulation(time); + } + + /** * Resumes the simulation. This method should be used for * debugging purposes only * @return <tt>true</tt> if the simulation has been resumed or Modified: branches/gridsim4.0-branch3/source/gridsim/gui/DefaultGridSimVisualizer.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/gui/DefaultGridSimVisualizer.java 2008-02-08 01:57:22 UTC (rev 90) +++ branches/gridsim4.0-branch3/source/gridsim/gui/DefaultGridSimVisualizer.java 2008-02-08 03:25:23 UTC (rev 91) @@ -26,13 +26,16 @@ import javax.swing.BorderFactory; import javax.swing.JButton; import javax.swing.JFrame; +import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; +import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextArea; +import javax.swing.JTextField; import javax.swing.border.Border; import javax.swing.border.EtchedBorder; import javax.swing.border.TitledBorder; @@ -64,12 +67,16 @@ GridSimVisualizer { private static final long serialVersionUID = 2059324063853260682L; - public static final int WINDOW_WIDTH = 400; + public static final int WINDOW_WIDTH = 450; public static final int WINDOW_HEIGHT = 350; private JButton btStep_; private JButton btRun_; private JButton btSlowMotion_; + + private JButton btChangePause_; + private JTextField tfRunUntil_; + private JList jlResource_; private JTextArea jlResourceInfo_; @@ -121,17 +128,16 @@ super.setTitle("GridSim Turbo Alpha 0.1 Visualizer"); JPanel mainPanel = new JPanel(new GridLayout(0, 1)); -// JPanel simulationPanel = new JPanel(new GridLayout(0, 3)); - JPanel simulationPanel = new JPanel(new GridLayout(0, 2)); + JPanel simulationPanel = new JPanel(new GridLayout(0, 3)); Border simulationBorder = BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(EtchedBorder.RAISED), "Simulation"); simulationPanel.setBorder(simulationBorder); - - JPanel executionPanel = new JPanel(new GridLayout(3,0)); + + JPanel executionPanel = new JPanel(new GridLayout(3,1)); executionPanel.setBorder(new TitledBorder("Execution")); - JPanel pausePanel = new JPanel(new GridLayout(3,0)); + JPanel pausePanel = new JPanel(new GridLayout(3,1)); pausePanel.setBorder(new TitledBorder("Pause Condition")); btStep_ = new JButton("Step by Step"); @@ -142,10 +148,21 @@ btRun_.addActionListener(this); btSlowMotion_.addActionListener(this); + JLabel lbRunUntil = new JLabel(" Pause at (Seconds):"); + lbRunUntil.setAlignmentY(JTextField.CENTER_ALIGNMENT); + + tfRunUntil_ = new JTextField(10); + btChangePause_ = new JButton("Change"); executionPanel.add(btStep_); + + pausePanel.add(lbRunUntil); + pausePanel.add(tfRunUntil_); + pausePanel.add(btChangePause_); + + btChangePause_.addActionListener(this); + executionPanel.add(btSlowMotion_); executionPanel.add(btRun_); - executionPanel.add(btSlowMotion_); - + ArrayList<String> resourceNames = new ArrayList<String>(); for(GridResource resource : resources_) { resourceNames.add(resource.get_name()); @@ -162,7 +179,7 @@ resourcePanel.add(scrollResourcePanel); simulationPanel.add(executionPanel); -// simulationPanel.add(pausePanel); + simulationPanel.add(pausePanel); simulationPanel.add(resourcePanel); jlResourceInfo_ = new JTextArea(); @@ -234,7 +251,30 @@ public void actionPerformed(ActionEvent e){ String cmd = e.getActionCommand(); - if(e.getSource() == btStep_){ + if(e.getSource() == btChangePause_) { + double newPause; + boolean success = true; + try { + newPause = Double.parseDouble(tfRunUntil_.getText()); + if(newPause >= GridSim.clock()) + GridSim.pauseSimulation(newPause); + else + success = false; + } + catch (NumberFormatException nfe) { + success = false; + } + if(!success) { + String message = "The value informed to pause the simulation " + + "is invalid.\nThe current simulation time is " + GridSim.clock() + "."; + + JOptionPane.showMessageDialog(this, message, + "Error While Setting the Time", + JOptionPane.ERROR_MESSAGE); + + } + } + else if(e.getSource() == btStep_){ GridSim.enableStepByStepMode(); GridSim.disableSlowMotionMode(); Modified: branches/gridsim4.0-branch3/source/gridsim/gui/ResourceWindow.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/gui/ResourceWindow.java 2008-02-08 01:57:22 UTC (rev 90) +++ branches/gridsim4.0-branch3/source/gridsim/gui/ResourceWindow.java 2008-02-08 03:25:23 UTC (rev 91) @@ -109,6 +109,7 @@ private JRadioButtonMenuItem btHour_; private boolean drawID_ = true; private boolean autoScroll_ = true; + private boolean animate_ = true; private JButton btSetSdWindowSize_; private JTextField fdSdWindowSize_; @@ -329,7 +330,7 @@ sliderX_ = new JSlider(10, 100, 10); sliderY_ = new JSlider(10, 100, 10); - ChangeListener graphResizer = new ChangeListener(){ + ChangeListener graphResizer = new ChangeListener() { synchronized public void stateChanged(ChangeEvent e) { pnGraph_.repaint(); } @@ -453,13 +454,33 @@ updateResourceWindow(); } }); - + menuCommand.add(mnScroll); + + JMenu mnAnimation = new JMenu("Animation"); + JCheckBoxMenuItem miAnimation = new JCheckBoxMenuItem("Animate this Window"); + miAnimation.setSelected(true); + mnAnimation.add(miAnimation); + + miAnimation.addItemListener(new ItemListener(){ + public void itemStateChanged(ItemEvent e){ + if (e.getStateChange() == ItemEvent.DESELECTED){ + animate_ = false; + } + else if (e.getStateChange() == ItemEvent.SELECTED){ + animate_ = true; + } + updateResourceWindow(); + } + }); + + menuCommand.add(mnAnimation); + menuBar.add(menuCommand); setJMenuBar(menuBar); } - private void updateResourceWindow(){ + private void updateResourceWindow() { pnGraph_.repaint(); if(slidingWindowSize_ != Double.MAX_VALUE) { @@ -555,6 +576,9 @@ } protected synchronized void paintComponent(Graphics g2) { + if(!animate_) + return; + super.paintComponent(g2); Graphics2D g2D = (Graphics2D)g2; g2D.setFont(graphFont_); Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/ARMessage.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/ARMessage.java 2008-02-08 01:57:22 UTC (rev 90) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/ARMessage.java 2008-02-08 03:25:23 UTC (rev 91) @@ -21,7 +21,6 @@ */ public class ARMessage { - private int srcId_; // id of the entity that sent the message private int dstId_; // id of the entity that will receive the message private int msgId_; // a unique id for the message This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-04-07 23:06:43
|
Revision: 167 http://gridsim.svn.sourceforge.net/gridsim/?rev=167&view=rev Author: marcos_dias Date: 2008-04-07 16:06:47 -0700 (Mon, 07 Apr 2008) Log Message: ----------- Small improvements in the java comments and some updates in getting free time slots from availability info objects. Modified Paths: -------------- branches/gridsim4.0-branch3/source/eduni/simjava/Sim_entity.java branches/gridsim4.0-branch3/source/eduni/simjava/Sim_system.java branches/gridsim4.0-branch3/source/gridsim/Accumulator.java branches/gridsim4.0-branch3/source/gridsim/AllocPolicy.java branches/gridsim4.0-branch3/source/gridsim/Machine.java branches/gridsim4.0-branch3/source/gridsim/MachineList.java branches/gridsim4.0-branch3/source/gridsim/turbo/ARCBMultiplePartitions.java branches/gridsim4.0-branch3/source/gridsim/turbo/AREBMultiplePartitions.java branches/gridsim4.0-branch3/source/gridsim/turbo/ARMessage.java branches/gridsim4.0-branch3/source/gridsim/turbo/ARTGridResource.java branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityInfo.java branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityInfoEntry.java branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityProfile.java branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityProfileEntry.java branches/gridsim4.0-branch3/source/gridsim/turbo/CBMultiplePartitions.java branches/gridsim4.0-branch3/source/gridsim/turbo/EBMultiplePartitions.java branches/gridsim4.0-branch3/source/gridsim/turbo/OrderGridletByStartTime.java branches/gridsim4.0-branch3/source/gridsim/turbo/PERange.java branches/gridsim4.0-branch3/source/gridsim/turbo/QueuePartition.java branches/gridsim4.0-branch3/source/gridsim/turbo/Reservation.java branches/gridsim4.0-branch3/source/gridsim/turbo/ReservationRequester.java branches/gridsim4.0-branch3/source/gridsim/turbo/TResourceCharacteristics.java Added Paths: ----------- branches/gridsim4.0-branch3/source/gridsim/turbo/TimeSlot.java Modified: branches/gridsim4.0-branch3/source/eduni/simjava/Sim_entity.java =================================================================== --- branches/gridsim4.0-branch3/source/eduni/simjava/Sim_entity.java 2008-03-31 00:27:24 UTC (rev 166) +++ branches/gridsim4.0-branch3/source/eduni/simjava/Sim_entity.java 2008-04-07 23:06:47 UTC (rev 167) @@ -88,6 +88,7 @@ generators = new ArrayList(); // Add this to Sim_system automatically Sim_system.add(this); + super.setName(name); // sets the thread name to ease debugging } /** @@ -111,6 +112,7 @@ generators = new ArrayList(); // Add this to Sim_system automatically Sim_system.add(this); + super.setName(name); // sets the thread name to ease debugging } /** Modified: branches/gridsim4.0-branch3/source/eduni/simjava/Sim_system.java =================================================================== --- branches/gridsim4.0-branch3/source/eduni/simjava/Sim_system.java 2008-03-31 00:27:24 UTC (rev 166) +++ branches/gridsim4.0-branch3/source/eduni/simjava/Sim_system.java 2008-04-07 23:06:47 UTC (rev 167) @@ -2,7 +2,6 @@ package eduni.simjava; -import java.text.NumberFormat; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; Modified: branches/gridsim4.0-branch3/source/gridsim/Accumulator.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/Accumulator.java 2008-03-31 00:27:24 UTC (rev 166) +++ branches/gridsim4.0-branch3/source/gridsim/Accumulator.java 2008-04-07 23:06:47 UTC (rev 167) @@ -93,43 +93,20 @@ /** * Calculates the mean of accumulated items - * @deprecated As of GridSim 2.1, replaced by {@link #getMean()} * @return the mean of accumalated items * @pre $none * @post $none */ - public double mean() { - return this.getMean(); - } - - /** - * Calculates the mean of accumulated items - * @return the mean of accumalated items - * @pre $none - * @post $none - */ public double getMean() { return mean_; } /** * Calculates the standard deviation of accumulated items - * @deprecated As of GridSim 2.1, replaced by - * {@link #getStandardDeviation()} * @return the Standard Deviation of accumulated items * @pre $none * @post $none */ - public double sd() { - return this.getStandardDeviation(); - } - - /** - * Calculates the standard deviation of accumulated items - * @return the Standard Deviation of accumulated items - * @pre $none - * @post $none - */ public double getStandardDeviation() { return Math.sqrt( this.getVariance() ); } @@ -146,105 +123,52 @@ /** * Finds the smallest number of accumulated items - * @deprecated As of GridSim 2.1, replaced by {@link #getMin()} * @return the smallest of accumulated items * @pre $none * @post $none */ - public double min() { - return this.getMin(); - } - - /** - * Finds the smallest number of accumulated items - * @return the smallest of accumulated items - * @pre $none - * @post $none - */ public double getMin() { return min_; } /** * Finds the largest number of accumulated items - * @deprecated As of GridSim 2.1, replaced by {@link #getMax()} * @return the largest of accumulated items * @pre $none * @post $none */ - public double max() { - return this.getMax(); - } - - /** - * Finds the largest number of accumulated items - * @return the largest of accumulated items - * @pre $none - * @post $none - */ public double getMax() { return max_; } /** * Finds the last accumulated item - * @deprecated As of GridSim 2.1, replaced by {@link #getLast()} * @return the last accumulated item * @pre $none * @post $none */ - public double last() { - return this.getLast(); - } - - /** - * Finds the last accumulated item - * @return the last accumulated item - * @pre $none - * @post $none - */ public double getLast() { return last_; } /** * Counts the number of items accumulated so far - * @deprecated As of GridSim 2.1, replaced by {@link #getCount()} * @return the number of items accumulated so far * @pre $none * @post $result >= 0 */ - public int count() { - return this.getCount(); - } - - /** - * Counts the number of items accumulated so far - * @return the number of items accumulated so far - * @pre $none - * @post $result >= 0 - */ public int getCount() { return n_; } /** * Calculates the sum of accumulated items - * @deprecated As of GridSim 2.1, replaced by {@link #getSum()} + * <b>NOTE:</b> The sum returned by this method is + * (number of items * mean of the accumulated items) * @return the sum of accumulated items * @pre $none * @post $none */ - public double sum() { - return this.getSum(); - } - - /** - * Calculates the sum of accumulated items - * @return the sum of accumulated items - * @pre $none - * @post $none - */ public double getSum() { return n_ * mean_; } @@ -252,20 +176,9 @@ /** * Determines the size of Accumulator object * @return the size of this object - * @deprecated As of GridSim 2.1, replaced by {@link #getByteSize()} * @pre $none * @post $result > 0 */ - public static int ByteSize() { - return getByteSize(); - } - - /** - * Determines the size of Accumulator object - * @return the size of this object - * @pre $none - * @post $result > 0 - */ public static int getByteSize() { int totalInt = 4; // contains only 1 int Modified: branches/gridsim4.0-branch3/source/gridsim/AllocPolicy.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/AllocPolicy.java 2008-03-31 00:27:24 UTC (rev 166) +++ branches/gridsim4.0-branch3/source/gridsim/AllocPolicy.java 2008-04-07 23:06:47 UTC (rev 167) @@ -10,14 +10,10 @@ package gridsim; import java.util.Calendar; -import java.util.LinkedList; import eduni.simjava.Sim_entity; import eduni.simjava.Sim_event; import eduni.simjava.Sim_port; -import gridsim.gui.AllocationAction; -import gridsim.gui.DefaultGridSimVisualizer; -import gridsim.turbo.ScheduleItem; /** * AllocPolicy is an abstract class that handles the internal Modified: branches/gridsim4.0-branch3/source/gridsim/Machine.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/Machine.java 2008-03-31 00:27:24 UTC (rev 166) +++ branches/gridsim4.0-branch3/source/gridsim/Machine.java 2008-04-07 23:06:47 UTC (rev 167) @@ -86,7 +86,7 @@ * @pre id >= 0 * @post $none */ - public int getMIPSRating(int peID){ + public int getMIPSRating(int peID) { return MIPSRatingPE_; } @@ -98,7 +98,7 @@ * @pre $none * @post $result >= 0 */ - public int getMIPSRating(){ + public int getMIPSRating() { return numPE_ * MIPSRatingPE_; } @@ -118,7 +118,7 @@ if (PEStatuses_[peID] == status) return false; - if(status){ + if(status) { busyPE_++; } else{ @@ -183,7 +183,7 @@ * Returns a list of free PEs * @return the list of free PEs */ - public LinkedList<Integer> getListFreePE(){ + public LinkedList<Integer> getListFreePE() { LinkedList<Integer> result = new LinkedList<Integer>(); for(int index=0; index<numPE_; index++){ if(!PEStatuses_[index]){ Modified: branches/gridsim4.0-branch3/source/gridsim/MachineList.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/MachineList.java 2008-03-31 00:27:24 UTC (rev 166) +++ branches/gridsim4.0-branch3/source/gridsim/MachineList.java 2008-04-07 23:06:47 UTC (rev 167) @@ -74,7 +74,7 @@ * Returns the size of this list of machines * @return the size of the list */ - public int size(){ + public int size() { return map_.size(); } @@ -82,7 +82,7 @@ * Returns an iterator over the values in this list. * @return an iterator over the elements in this list. */ - public Iterator iterator(){ + public Iterator<Machine> iterator() { return map_.values().iterator(); } Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/ARCBMultiplePartitions.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/ARCBMultiplePartitions.java 2008-03-31 00:27:24 UTC (rev 166) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/ARCBMultiplePartitions.java 2008-04-07 23:06:47 UTC (rev 167) @@ -26,7 +26,8 @@ * directed to these partitions using a partition predicate * ({@link QueuePartitionPredicate}. A partition can borrow resources from * another when it requires and the resources are not being used by the - * other partition. + * other partition. However, you can change this behaviour + * by calling {@link #setAllowBorrowing(boolean)}. * * We use an availability profile to store the availability of processing * elements. @@ -41,6 +42,9 @@ * <li> Gridlets cannot be paused nor migrated. * </ul> * + * @author Marcos Dias de Assuncao + * @since GridSim Turbo Alpha 0.1 + * * @see gridsim.GridSim * @see gridsim.ResourceCharacteristics * @see gridsim.turbo.TAllocPolicy Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/AREBMultiplePartitions.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/AREBMultiplePartitions.java 2008-03-31 00:27:24 UTC (rev 166) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/AREBMultiplePartitions.java 2008-04-07 23:06:47 UTC (rev 167) @@ -25,8 +25,13 @@ * This policy can use multiple partitions or queues and the jobs can be * directed to these partitions using a partition predicate * ({@link QueuePartitionPredicate}. A partition can borrow resources from - * another when it requires and the resources are not being used by the - * other partition. + * another when it requires and the resources are not being used by the other + * partition. However, you can change this behaviour + * by calling {@link #setAllowBorrowing(boolean)}. Additionally, this policy + * supports priorities. Jobs are ordered according to their priorities; + * a high priority job can take the place of a pivot with lower priority. + * To change the way that the scheduler assigns priorities to the jobs, please + * see {@link PrioritySelector}. * * We use an availability profile to store the availability of processing * elements. In order to represent the pivots (i.e. the first jobs in the @@ -45,6 +50,9 @@ * <li> Gridlets cannot be paused nor migrated. * </ul> * + * @author Marcos Dias de Assuncao + * @since GridSim Turbo Alpha 0.1 + * * @see gridsim.GridSim * @see gridsim.ResourceCharacteristics * @see gridsim.turbo.TAllocPolicy Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/ARMessage.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/ARMessage.java 2008-03-31 00:27:24 UTC (rev 166) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/ARMessage.java 2008-04-07 23:06:47 UTC (rev 167) @@ -14,7 +14,6 @@ * and a resource providers to negotiate an advance reservation. * * @author Marcos Dias de Assuncao - * * @since GridSim Turbo Alpha 0.1 * * @see Reservation Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/ARTGridResource.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/ARTGridResource.java 2008-03-31 00:27:24 UTC (rev 166) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/ARTGridResource.java 2008-04-07 23:06:47 UTC (rev 167) @@ -24,9 +24,10 @@ * {@link TResourceCharacteristics#AR_PARALLEL_SPACE_SHARED}. In addition, * a resource's scheduler should be extended from * {@link ARTPolicy} class. - * - * @author Marcos Dias de Assuncao - + * + * @author Marcos Dias de Assuncao + * @since GridSim Turbo Alpha 0.1 + * * @see gridsim.GridResource * @see gridsim.GridSim * @see gridsim.ResourceCharacteristics Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityInfo.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityInfo.java 2008-03-31 00:27:24 UTC (rev 166) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityInfo.java 2008-04-07 23:06:47 UTC (rev 167) @@ -10,6 +10,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; +import java.util.LinkedList; /** * The {@link AvailabilityInfo} class represents a list of entries @@ -24,7 +25,7 @@ * @see PERange * @see PERangeList * @see ARParallelSpaceShared - * @see ARParallelSpaceShared#handleQueryAvailability(ARMessage) + * @see ARTPolicy#handleQueryAvailability(ARMessage) */ public class AvailabilityInfo extends ArrayList<AvailabilityInfoEntry> { @@ -384,11 +385,143 @@ } /** + * Returns the time slots contained in this availability information object + * within a specified period of time. <br> + * <b>NOTE:</b> The time slots returned by this method do not overlap. + * That is, they are not the scheduling options of a given job. + * @param startTime the start time of the period. + * @param finishTime the finish time of the period. + * @return a linked list with the time slots contained in this availability + * information object within a specified period of time. + */ + public LinkedList<TimeSlot> getTimeSlots(double startTime, double finishTime) { + LinkedList<TimeSlot> slots = new LinkedList<TimeSlot>(); + + // gets the part of the profile relevant to create the slots + AvailabilityInfo subProfile = getSubAvailabilityInfo(startTime, finishTime); + + if(subProfile == null || subProfile.size() == 0) + return slots; + + double slotStart = 0; + double slotFinish = 0; + int startIdx = 0; + int endIdx = 0; + AvailabilityInfoEntry entry = null; + AvailabilityInfoEntry nextEntry = null; + PERangeList rangesSlot = null; + PERangeList intersect = null; + + for(int i=0; i<subProfile.size(); i++) { + entry = subProfile.get(i); + slotStart = entry.getTime(); + startIdx = i; + endIdx = i; + + if(entry.getNumPE() == 0) + continue; + + // check all time slots starting at slotStart + do { + intersect = entry.getAvailRanges().clone(); + rangesSlot = intersect.clone(); + for(int j=i+1; j<subProfile.size(); j++) { + nextEntry = subProfile.get(j); + intersect = PERangeList.intersection(intersect, + nextEntry.getAvailRanges()); + + if(intersect != null && intersect.getNumPE() > 0) { + rangesSlot = intersect.clone(); + endIdx = j; + continue; + } + else + break; + } + + if(intersect != null && intersect.getNumPE() > 0) { + slotFinish = finishTime; + } + else { + slotFinish = nextEntry.getTime(); + } + + TimeSlot slot = new TimeSlot(slotStart, slotFinish, rangesSlot); + slots.add(slot); + + for(int j=startIdx; j<=endIdx; j++) { + nextEntry = subProfile.get(j); + PERangeList difference = + PERangeList.difference(nextEntry.getAvailRanges(), rangesSlot); + nextEntry.setAvailRanges(difference); + } + } while(entry.getNumPE() > 0); + } + + return slots; + } + + /** + * Returns part of the availability information.<br> + * <b>NOTE:</b> The entries of the sub-info are clones of the original + * info object's. + * @param startTime the start time of the resulting part + * @param finishTime the finish time of the resulting part + * @return part of the availability information. + */ + protected AvailabilityInfo getSubAvailabilityInfo(double startTime, double finishTime) { + AvailabilityInfo info = new AvailabilityInfo(); + + // start time cannot be smaller than the start time of the info obj + if(startTime < startTime_) + startTime = startTime_; + + // start time cannot be larger than the finish time of the info obj + if(startTime > finishTime_) { + return null; + } + + int length = super.size(); + AvailabilityInfoEntry entry = null; + AvailabilityInfoEntry firstEntry = null; + entry = getPrecedingEntry(startTime); + int index = super.indexOf(entry); + + firstEntry = entry.clone(startTime); + info.setStartTime(startTime); + info.add(firstEntry); + AvailabilityInfoEntry previousEntry = firstEntry; + + for(int i=index+1; i<length; i++) { + entry = super.get(i); + if(entry.getTime() <= startTime) + continue; + if(entry.getTime() > finishTime) { + break; + } + else { + PERangeList peList = entry.getAvailRanges(); + peList = (peList != null) ? peList.clone() : new PERangeList(); + + if( !previousEntry.getAvailRanges().equals(peList)) { + AvailabilityInfoEntry newEntry = entry.clone(entry.getTime()); + info.add(newEntry); + previousEntry = newEntry; + } + } + } + + info.setFinishTime(finishTime); + return info; + } + + /** * Creates a string representation of the list * @return a string representation */ public String toString() { - String result = "Availability={\n"; + String result = "Availability={startTime=" + startTime_ + + ", finishTime=" + finishTime_ + "\n"; for(AvailabilityInfoEntry entry : this){ result += entry + "\n"; } Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityInfoEntry.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityInfoEntry.java 2008-03-31 00:27:24 UTC (rev 166) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityInfoEntry.java 2008-04-07 23:06:47 UTC (rev 167) @@ -107,6 +107,15 @@ } /** + * Returns the number of Gridlets that rely on this entry to mark + * their expected completion time or their anchor point + * @return the number of Gridlets that use this entry + */ + public int getNumGridlets() { + return numGridlets_; + } + + /** * Adds the ranges provided to the list of ranges available * @param list the list to be added * @return <tt>true</tt> if the ranges changed as result of this call Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityProfile.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityProfile.java 2008-03-31 00:27:24 UTC (rev 166) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityProfile.java 2008-04-07 23:06:47 UTC (rev 167) @@ -106,6 +106,39 @@ } /** + * Returns part of the availability profile.<br> + * <b>NOTE:</b> The entries of the sub-profile are clones of the original + * profile object's. + * @param startTime the start time of the resulting part + * @param finishTime the finish time of the resulting part + * @return part of the availability profile. + */ + protected AvailabilityProfile getSubProfile(double startTime, double finishTime) { + AvailabilityProfile subProfile = new AvailabilityProfile(); + AvailabilityProfileEntry previousEntry = null; + + for(AvailabilityProfileEntry entry : this) { + if(entry.getTime() < startTime) + continue; + if(entry.getTime() > finishTime) { + break; + } + else { + PERangeList peList = entry.getPERanges(); + peList = (peList != null) ? peList.clone() : new PERangeList(); + + if(previousEntry == null || !previousEntry.getPERanges().equals(peList)) { + AvailabilityProfileEntry newEntry = entry.clone(entry.getTime()); + subProfile.add(newEntry); + previousEntry = newEntry; + } + } + } + + return subProfile; + } + + /** * Creates an string representation of the profile * @return an string representation */ Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityProfileEntry.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityProfileEntry.java 2008-03-31 00:27:24 UTC (rev 166) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityProfileEntry.java 2008-04-07 23:06:47 UTC (rev 167) @@ -128,6 +128,19 @@ } /** + * Returns a clone of this entry. The ranges are cloned, but the time + * and the number of gridlets relying on this entry are not. + * @param time the time for the new entry + * @return the new entry with the number of gridlets set to default. + */ + public AvailabilityProfileEntry clone(double time) { + PERangeList ranges = ranges_ == null ? null : ranges_.clone(); + AvailabilityProfileEntry entry = + new AvailabilityProfileEntry(time, ranges); + return entry; + } + + /** * Creates a string representation of this entry */ public String toString() { Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/CBMultiplePartitions.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/CBMultiplePartitions.java 2008-03-31 00:27:24 UTC (rev 166) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/CBMultiplePartitions.java 2008-04-07 23:06:47 UTC (rev 167) @@ -22,7 +22,8 @@ * multiple partitions or queues and the jobs can be directed to these partitions * using a partition predicate ({@link QueuePartitionPredicate}. A partition * can borrow resources from another when it requires and the resources are - * not being used by the other partition. + * not being used by the other partition. However, you can change this behaviour + * by calling {@link #setAllowBorrowing(boolean)}. * * We use an availability profile to store the availability of processing * elements. In order to represent the pivots (i.e. the first jobs in the @@ -42,6 +43,9 @@ * <li> This policy does not support advance reservations. * </ul> * + * @author Marcos Dias de Assuncao + * @since GridSim Turbo Alpha 0.1 + * * @see gridsim.GridSim * @see gridsim.ResourceCharacteristics * @see gridsim.turbo.TAllocPolicy Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/EBMultiplePartitions.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/EBMultiplePartitions.java 2008-03-31 00:27:24 UTC (rev 166) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/EBMultiplePartitions.java 2008-04-07 23:06:47 UTC (rev 167) @@ -28,8 +28,13 @@ * multiple partitions or queues and the jobs can be directed to these partitions * using a partition predicate ({@link QueuePartitionPredicate}. A partition * can borrow resources from another when it requires and the resources are - * not being used by the other partition. The implementation of this policy is - * based on the following paper: + * not being used by the other partition. However, you can change this behaviour + * by calling {@link #setAllowBorrowing(boolean)}. Additionally, this policy + * supports priorities. Jobs are ordered according to their priorities; + * a high priority job can take the place of a pivot with lower priority. + * To change the way that the scheduler assigns priorities to the jobs, please + * see {@link PrioritySelector}. The implementation of this policy is based + * on the following paper: * <p> * <ul> * <li> Barry G. Lawson and Evgenia Smirni, Multiple-Queue Backfilling Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/OrderGridletByStartTime.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/OrderGridletByStartTime.java 2008-03-31 00:27:24 UTC (rev 166) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/OrderGridletByStartTime.java 2008-04-07 23:06:47 UTC (rev 167) @@ -13,8 +13,9 @@ /** * Class used to order the gridlets according to their * potential start times - * @author Marcos Dias de Assuncao - * + * + * @author Marcos Dias de Assuncao + * @since GridSim Turbo Alpha 0.1 */ public class OrderGridletByStartTime implements Comparator<SSGridlet> { Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/PERange.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/PERange.java 2008-03-31 00:27:24 UTC (rev 166) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/PERange.java 2008-04-07 23:06:47 UTC (rev 167) @@ -14,9 +14,10 @@ * * @author Marcos Dias de Assuncao * @since GridSim Turbo Alpha 0.1 + * * @see PERangeList - * @see CBParallelSpaceShared - * @see EBParallelSpaceShared + * @see AvailabilityProfileEntry + * @see AvailabilityProfile */ public class PERange implements Cloneable, Comparable<PERange> { Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/QueuePartition.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/QueuePartition.java 2008-03-31 00:27:24 UTC (rev 166) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/QueuePartition.java 2008-04-07 23:06:47 UTC (rev 167) @@ -3,6 +3,7 @@ /** * This class represents a partition in this scheduler. It only * stores a few variables used to control the partition. + * * @author Marcos Dias de Assuncao * @since GridSim Turbo Alpha 0.1 */ Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/Reservation.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/Reservation.java 2008-03-31 00:27:24 UTC (rev 166) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/Reservation.java 2008-04-07 23:06:47 UTC (rev 167) @@ -16,8 +16,8 @@ * and its properties. * * @author Marcos Dias de Assuncao - * * @since GridSim Turbo Alpha 0.1 + * * @invariant $none */ public class Reservation implements Cloneable, Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/ReservationRequester.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/ReservationRequester.java 2008-03-31 00:27:24 UTC (rev 166) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/ReservationRequester.java 2008-04-07 23:06:47 UTC (rev 167) @@ -22,7 +22,6 @@ * and query. * * @author Marcos Dias de Assuncao - * * @since GridSim Turbo Alpha 0.1 */ public class ReservationRequester extends GridSim { Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/TResourceCharacteristics.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/TResourceCharacteristics.java 2008-03-31 00:27:24 UTC (rev 166) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/TResourceCharacteristics.java 2008-04-07 23:06:47 UTC (rev 167) @@ -241,7 +241,7 @@ * @param ranges the list of ranges available */ public void resetFreePERanges(PERangeList ranges) { - freePERanges_ = ranges == null ? null : ranges.clone(); // clones the list to avoid conflict + freePERanges_ = (ranges == null) ? null : ranges.clone(); // clones the list to avoid conflict } /** Added: branches/gridsim4.0-branch3/source/gridsim/turbo/TimeSlot.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/TimeSlot.java (rev 0) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/TimeSlot.java 2008-04-07 23:06:47 UTC (rev 167) @@ -0,0 +1,120 @@ +/* + * Title: GridSim Toolkit + * Description: GridSim (Grid Simulation) Toolkit for Modelling and Simulation + * of Parallel and Distributed Systems such as Clusters and Grids + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + */ + +package gridsim.turbo; + +/** + * This class defines a time slot. A time slot can be used to represent a + * free fragment in the scheduling queue. This may be useful for users who + * want to implement policies that perform best-fit, next-fit or worst-fit + * time slot selection. For a description on how time slots can be utilised, + * please read the following paper on the MAUI scheduler: + * <ul> + * <li> David B. Jackson, Quinn Snell and Mark J. Clement. Core Algorithms + * of the Maui Scheduler, Revised Papers from the 7th International + * Workshop on Job Scheduling Strategies for Parallel Processing + * (JSSPP '01), Lecture Notes in Computer Science, pp. 87-102, London, UK. + * </ul> + * + * @author Marcos Dias de Assuncao + * @since GridSim Turbo Alpha 0.1 + * + * @see gridsim.turbo.PERange + * @see gridsim.turbo.PERangeList + */ +public class TimeSlot { + + private double startTime_; + private double finishTime_; + private PERangeList ranges_; + + /** + * Default constructor sets + * @param startTime the start time of the time slot + * @param finishTime the finish time of the time slot + * @param ranges the list of PE ranges available at the slot + */ + public TimeSlot(double startTime, double finishTime, PERangeList ranges) { + startTime_ = startTime; + finishTime_ = finishTime; + ranges_ = ranges; + } + + /** + * Sets the start time of the time slot + * @param startTime the start time + * @return <tt>true</tt> if set successfully; <tt>false</tt> otherwise. + * @pre startTime >= 0 + */ + public boolean setStartTime(double startTime) { + if(startTime <0) + return false; + + startTime_ = startTime; + return true; + } + + /** + * Sets the finish time of the time slot + * @param finishTime the finish time + * @return <tt>true</tt> if set successfully; <tt>false</tt> otherwise. + * @pre finishTime >= 0 + */ + public boolean setFinishTime(double finishTime) { + if(finishTime <0) + return false; + + finishTime_ = finishTime; + return true; + } + + /** + * Sets the ranges of the time slot + * @param ranges the ranges of this time slot + * @return <tt>true</tt> if set successfully; <tt>false</tt> otherwise. + * @pre ranges != <tt>null</tt> + */ + public boolean setPERanges(PERangeList ranges) { + if(ranges == null) + return false; + + ranges_ = ranges; + return true; + } + + /** + * Returns the start time of this time slot + * @return the start time of this time slot + */ + public double getStartTime() { + return startTime_; + } + + /** + * Returns the finish time of this time slot + * @return the finish time of this time slot + */ + public double getFinishTime() { + return finishTime_; + } + + /** + * Returns the PE ranges available at the time slot + * @return the PE ranges available at the time slot + */ + public PERangeList getPERanges() { + return ranges_; + } + + /** + * Returns the number of PEs available at the time slot + * @return the number of PEs available at the time slot + */ + public int getNumPE() { + return ranges_ == null ? 0 : ranges_.getNumPE(); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |