From: <mar...@us...> - 2008-03-02 22:54:11
|
Revision: 139 http://gridsim.svn.sourceforge.net/gridsim/?rev=139&view=rev Author: marcos_dias Date: 2008-03-02 14:53:59 -0800 (Sun, 02 Mar 2008) Log Message: ----------- QueuePartition is now a public class. Users extending the multi-partition policies may find it useful. Modified Paths: -------------- branches/gridsim4.0-branch3/source/gridsim/turbo/MPAvailabilityProfile.java Added Paths: ----------- branches/gridsim4.0-branch3/source/gridsim/turbo/QueuePartition.java Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/MPAvailabilityProfile.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/MPAvailabilityProfile.java 2008-03-01 01:10:44 UTC (rev 138) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/MPAvailabilityProfile.java 2008-03-02 22:53:59 UTC (rev 139) @@ -1041,112 +1041,3 @@ return entry; } } - -/** - * 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 - */ -class QueuePartition { - private int partitionId_; // this partition's identifier - private int initialNumPEs_; // the initial number of PEs allocated - private PERangeList idlePERanges_; // idle resources in this partition - - // to check whether a gridlet can be scheduled in this queue - private QueuePartitionPredicate predicate_; - - /** - * Creates a new <tt>Queuepartition</tt> object. - * @param queueId the partition ID - * @param numPE the number of PEs initially assigned to the partition - * @param predicate the queue predicate - * @see gridsim.turbo.QueuePartitionPredicate - */ - public QueuePartition(int queueId, - int numPE, QueuePartitionPredicate predicate) { - this.partitionId_ = queueId; - initialNumPEs_ = numPE; - predicate_ = predicate; - } - - /** - * Gets the partition ID - * @return the partition ID - */ - public int getPartitionId() { - return partitionId_; - } - - /** - * Sets the partition ID - * @param partitionId the partition ID - * @return <tt>true</tt> if set properly; <tt>false</tt> otherwise. - */ - public boolean setPartitionId(int partitionId) { - if(partitionId < 0) - return false; - - partitionId_ = partitionId; - return true; - } - - /** - * Gets the number of PEs initially assigned to the partition - * @return the number of PEs initially assigned to the partition - */ - public int getInitialNumPEs() { - return initialNumPEs_; - } - - /** - * Sets the number of PEs initially assigned to the partition - * @param initialNumPEs the number of PEs initially assigned - * @return <tt>true</tt> if set properly; <tt>false</tt> otherwise. - */ - public boolean setInitialNumPEs(int initialNumPEs) { - if(initialNumPEs < 0) - return false; - - initialNumPEs_ = initialNumPEs; - return true; - } - - /** - * Gets the number of PEs currently idle at a partition - * @return the number of PEs currently idle at a partition - */ - public PERangeList getIdlePERanges() { - return idlePERanges_; - } - - /** - * Sets the number of PEs currently idle at a partition - * @param idlePERanges the number of PEs currently idle at a partition - */ - public void setIdlePERanges(PERangeList idlePERanges) { - idlePERanges_ = idlePERanges; - } - - /** - * Gets the predicate of this partition - * @return the predicate of this partition - */ - public QueuePartitionPredicate getPredicate() { - return predicate_; - } - - /** - * Sets the predicate of this partition - * @param predicate the predicate of this partition - * @return <tt>true</tt> if set properly; <tt>false</tt> otherwise. - */ - public boolean setPredicate(QueuePartitionPredicate predicate) { - if(predicate == null) - return false; - - predicate_ = predicate; - return true; - } -} - Added: branches/gridsim4.0-branch3/source/gridsim/turbo/QueuePartition.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/QueuePartition.java (rev 0) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/QueuePartition.java 2008-03-02 22:53:59 UTC (rev 139) @@ -0,0 +1,109 @@ +package gridsim.turbo; + +/** + * 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 + */ +public class QueuePartition { + private int partitionId_; // this partition's identifier + private int initialNumPEs_; // the initial number of PEs allocated + private PERangeList idlePERanges_; // idle resources in this partition + + // to check whether a gridlet can be scheduled in this queue + private QueuePartitionPredicate predicate_; + + /** + * Creates a new <tt>Queuepartition</tt> object. + * @param queueId the partition ID + * @param numPE the number of PEs initially assigned to the partition + * @param predicate the queue predicate + * @see gridsim.turbo.QueuePartitionPredicate + */ + public QueuePartition(int queueId, + int numPE, QueuePartitionPredicate predicate) { + this.partitionId_ = queueId; + initialNumPEs_ = numPE; + predicate_ = predicate; + } + + /** + * Gets the partition ID + * @return the partition ID + */ + public int getPartitionId() { + return partitionId_; + } + + /** + * Sets the partition ID + * @param partitionId the partition ID + * @return <tt>true</tt> if set properly; <tt>false</tt> otherwise. + */ + public boolean setPartitionId(int partitionId) { + if(partitionId < 0) + return false; + + partitionId_ = partitionId; + return true; + } + + /** + * Gets the number of PEs initially assigned to the partition + * @return the number of PEs initially assigned to the partition + */ + public int getInitialNumPEs() { + return initialNumPEs_; + } + + /** + * Sets the number of PEs initially assigned to the partition + * @param initialNumPEs the number of PEs initially assigned + * @return <tt>true</tt> if set properly; <tt>false</tt> otherwise. + */ + public boolean setInitialNumPEs(int initialNumPEs) { + if(initialNumPEs < 0) + return false; + + initialNumPEs_ = initialNumPEs; + return true; + } + + /** + * Gets the number of PEs currently idle at a partition + * @return the number of PEs currently idle at a partition + */ + public PERangeList getIdlePERanges() { + return idlePERanges_; + } + + /** + * Sets the number of PEs currently idle at a partition + * @param idlePERanges the number of PEs currently idle at a partition + */ + public void setIdlePERanges(PERangeList idlePERanges) { + idlePERanges_ = idlePERanges; + } + + /** + * Gets the predicate of this partition + * @return the predicate of this partition + */ + public QueuePartitionPredicate getPredicate() { + return predicate_; + } + + /** + * Sets the predicate of this partition + * @param predicate the predicate of this partition + * @return <tt>true</tt> if set properly; <tt>false</tt> otherwise. + */ + public boolean setPredicate(QueuePartitionPredicate predicate) { + if(predicate == null) + return false; + + predicate_ = predicate; + return true; + } +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |