GridSim 5.0 beta

gridsim.parallel.profile
Class PartProfileEntry

Object
  extended by ProfileEntry
      extended by PartProfileEntry
All Implemented Interfaces:
Comparable<ProfileEntry>

public class PartProfileEntry
extends ProfileEntry

The PartProfileEntry class represents an entry in the availability profile. It contains the list of ranges of PEs available at a particular time. This time may represent either the start time or completion of a job or advance reservation. It differs from SingleProfileEntry by having information about multiple resource partitions.

Since:
5.0
Author:
Marcos Dias de Assuncao
See Also:
PERange, PERangeList

Constructor Summary
PartProfileEntry(double time, int numPart)
          Creates a new instance of PartProfileEntry
 
Method Summary
 void addRanges(int partId, PERangeList list)
          Adds the ranges provided to the list of ranges available
 PartProfileEntry clone(double time)
          Returns a clone of this entry.
 PERangeList getAvailRanges()
          Returns the overall list of ranges available at this entry in all partitions.
 PERangeList getAvailRanges(int partId)
          Returns the list of ranges available for a given partition at this entry
 int getNumPE()
          Gets the number of PEs associated with this entry
 int getNumPE(int partId)
          Gets the number of PEs at a partition associated with this entry.
 void setAvailRanges(int partId, PERangeList availRanges)
          Sets the ranges of PEs available at this entry
 String toString()
          Creates a string representation of this entry
 void transferPEs(int partId, PERangeList list)
          Transfers PEs from partitions to one selected partition
 
Methods inherited from class ProfileEntry
compareTo, decreaseJob, getNumJobs, getTime, increaseJob, setTime
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PartProfileEntry

public PartProfileEntry(double time,
                        int numPart)
Creates a new instance of PartProfileEntry

Parameters:
time - the time associated with this entry
numPart - the number of partitions
Method Detail

getAvailRanges

public PERangeList getAvailRanges(int partId)
Returns the list of ranges available for a given partition at this entry

Parameters:
partId - the id of the partition.
Returns:
the list of ranges available or null if either the partition does not have ranges set.
Throws:
IndexOutOfBoundsException - if the partition id is out of the bounds.

getAvailRanges

public PERangeList getAvailRanges()
Returns the overall list of ranges available at this entry in all partitions.

Specified by:
getAvailRanges in class ProfileEntry
Returns:
the list of ranges available or null if no ranges have been set previously.

setAvailRanges

public void setAvailRanges(int partId,
                           PERangeList availRanges)
Sets the ranges of PEs available at this entry

Parameters:
partId - the id of the partition.
availRanges - the list of ranges of PEs available
Throws:
IndexOutOfBoundsException - if the partition id is out of the bounds.

addRanges

public void addRanges(int partId,
                      PERangeList list)
Adds the ranges provided to the list of ranges available

Parameters:
partId - the id of the partition.
list - the list to be added
Throws:
IndexOutOfBoundsException - if the partition id is out of the bounds.

getNumPE

public int getNumPE()
Gets the number of PEs associated with this entry

Specified by:
getNumPE in class ProfileEntry
Returns:
the number of PEs

getNumPE

public int getNumPE(int partId)
Gets the number of PEs at a partition associated with this entry.

Parameters:
partId - the id of the partition.
Returns:
the number of PEs

toString

public String toString()
Creates a string representation of this entry

Overrides:
toString in class Object
Returns:
a representation of this entry

clone

public PartProfileEntry clone(double time)
Returns a clone of this entry. The ranges are cloned, but the time and the number of requests relying on this entry are not.

Specified by:
clone in class ProfileEntry
Parameters:
time - the time for the new entry
Returns:
the new entry with the number of requests set to default.

transferPEs

public void transferPEs(int partId,
                        PERangeList list)
Transfers PEs from partitions to one selected partition

Parameters:
partId - the partition receiving the ranges
list - the list of ranges

GridSim 5.0 beta

The University of Melbourne, Australia, 2009