GridSim 5.0 beta

gridsim.parallel.profile
Class SingleProfile

Object
  extended by Profile
      extended by SingleProfile
All Implemented Interfaces:
Cloneable, Iterable<SingleProfileEntry>

public class SingleProfile
extends Profile
implements Cloneable, Iterable<SingleProfileEntry>

This class represents the profile containing the ranges of PEs available at given simulation times. This availability profile does not provide features to manage multiple resource partitions.

Since:
5.0
Author:
Marcos Dias de Assuncao
See Also:
Profile, SingleProfileEntry, PERangeList, TimeSlot

Nested Class Summary
 
Nested classes/interfaces inherited from class Profile
Profile.Entry
 
Field Summary
 
Fields inherited from class Profile
avail
 
Constructor Summary
protected SingleProfile()
          Creates a new Profile object.
NOTE: if you use this constructor, you need to insert an initial entry with the number of PEs.
  SingleProfile(int numPE)
          Creates an availability profile for a resource providing the number of PEs in the resource.
protected SingleProfile(LinkedTreeMap<Double,ProfileEntry> avail)
          Protected constructor used by the cloning operations.
 
Method Summary
 boolean addTimeSlot(double startTime, double finishTime, PERangeList list)
          Includes a time slot in this availability profile.
 SingleProfile clone()
          Returns shallow copy of this object.
NOTE: this method does not clone the entries.
 SingleProfile copy()
          Returns copy of this object.
NOTE: this method clones the entries
protected  double currentTime()
          This method returns the current time.
 Iterator<SingleProfileEntry> iterator()
          Returns an iterator in case someone needs to iterate this object.
 
Methods inherited from class Profile
add, allocatePERanges, checkAvailability, checkImmediateAvailability, findStartTime, findStartTime, getPrecedingValue, getSchedulingOptions, getTimeSlots, getTimeSlots, removePastEntries, toString
 
Methods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SingleProfile

public SingleProfile(int numPE)
Creates an availability profile for a resource providing the number of PEs in the resource. This constructor will create an initial SingleProfileEntry with time 0 and an initial PE range of [0, numPE-1].

Parameters:
numPE - the number of PEs in the resource.
See Also:
SingleProfileEntry

SingleProfile

protected SingleProfile(LinkedTreeMap<Double,ProfileEntry> avail)
Protected constructor used by the cloning operations.

Parameters:
avail - the availability information map.
See Also:
SingleProfileEntry

SingleProfile

protected SingleProfile()
Creates a new Profile object.
NOTE: if you use this constructor, you need to insert an initial entry with the number of PEs.

See Also:
SingleProfileEntry
Method Detail

clone

public SingleProfile clone()
Returns shallow copy of this object.
NOTE: this method does not clone the entries.

Overrides:
clone in class Object
Returns:
the cloned object
See Also:
copy()

copy

public SingleProfile copy()
Returns copy of this object.
NOTE: this method clones the entries

Returns:
the copy object

addTimeSlot

public boolean addTimeSlot(double startTime,
                           double finishTime,
                           PERangeList list)
Includes a time slot in this availability profile. This is useful if your scheduling strategy cancels a job and you want to update the availability profile.

Parameters:
startTime - the start time of the time slot.
finishTime - the finish time of the time slot.
list - the list of ranges of PEs in the slot.
Returns:
true if the slot was included; false otherwise.

iterator

public Iterator<SingleProfileEntry> iterator()
Returns an iterator in case someone needs to iterate this object.
NOTE: Removing objects from this profile via its iterator may make it behave in an unexpected way.

Specified by:
iterator in interface Iterable<SingleProfileEntry>
Returns:
an iterator for the SingleProfileEntry objects in this profile.

currentTime

protected double currentTime()
This method returns the current time.

Specified by:
currentTime in class Profile
Returns:
the current time.
See Also:
Profile.currentTime()

GridSim 5.0 beta

The University of Melbourne, Australia, 2009