gridsim
Class ResGridlet

Object
  extended bygridsim.ResGridlet

public class ResGridlet
extends Object

GridSim ResGridlet represents a Gridlet submitted to GridResource for processing. This class keeps track the time for all activities in the GridResource for a specific Gridlet. Before a Gridlet exits the GridResource, it is RECOMMENDED to call this method finalizeGridlet().

It contains a Gridlet object along with its arrival time and the ID of the machine and the PE (Processing Element) allocated to it. It acts as a placeholder for maintaining the amount of resource share allocated at various times for simulating any scheduling using internal events.

Version:
2.2, December 2003
Author:
Manzur Murshed and Rajkumar Buyya
Invariant:
$none

Constructor Summary
ResGridlet(Gridlet gridlet)
          Allocates a new ResGridlet object upon the arrival of a Gridlet object.
 
Method Summary
 void finalizeGridlet()
          Finalizes all relevant information before exiting the GridResource entity.
 double GetArrivalTime()
          Deprecated. As of GridSim 2.1, replaced by getGridletArrivalTime()
 double getExecStartTime()
          Gets the Gridlet's execution start time
 double GetFinishTime()
          Deprecated. As of GridSim 2.1, replaced by getGridletFinishTime()
 Gridlet getGridlet()
          Get this Gridlet object
 Gridlet GetGridlet()
          Deprecated. As of GridSim 2.1, replaced by getGridlet()
 double getGridletArrivalTime()
          Get arrival time of a gridlet
 double getGridletFinishTime()
          Get the Gridlet's finish time
 int getGridletID()
          Gets this Gridlet entity Id
 double getGridletLength()
          Gets the Gridlet's length
 int getGridletStatus()
          Gets the Gridlet status
 int getMachineID()
          Get machine ID
 int GetMachineID()
          Deprecated. As of GridSim 2.1, replaced by getMachineID()
 int getPEID()
          Get PE ID
 int GetPEID()
          Deprecated. As of GridSim 2.1, replaced by getPEID()
 double getRemainingGridletLength()
          Get the remaining gridlet length
 double GetRemainingLength()
          Deprecated. As of GridSim 2.1, replaced by getRemainingGridletLength()
 int getUserID()
          Gets the user or owner of this Gridlet
 void setExecParam(double wallClockTime, double actualCPUTime)
          Sets this Gridlet's execution parameters.
 void setFinishTime(double time)
          Sets the finish time for this Gridlet.
 void setFinishTimeForSpaceSharedResource(double availableRating)
          Deprecated. As of GridSim 2.2, replaced by setFinishTime(double). This method is OBSOLETE since it is the responsibility of individual scheduling to come up with the finish time for each Gridlet.
 void SetFinishTimeForSpaceSharedResource(double availableRating)
          Deprecated. As of GridSim 2.2, replaced by setFinishTime(double). This method is OBSOLETE since it is the responsibility of individual scheduling to come up with the finish time for each Gridlet.
 void setFinishTimeForTimeSharedResource(double availableRating, ResourceCalendar rCalendar)
          Deprecated. As of GridSim 2.2, replaced by setFinishTime(double). This method is OBSOLETE since it is the responsibility of individual scheduling to come up with the finish time for each Gridlet.
 void SetFinishTimeForTimeSharedResource(double availableRating, ResourceCalendar rCalendar)
          Deprecated. As of GridSim 2.2, replaced by setFinishTime(double). This method is OBSOLETE since it is the responsibility of individual scheduling to come up with the finish time for each Gridlet.
 boolean setGridletStatus(int status)
          Sets the Gridlet status.
 void SetIDs(int machineID, int peID)
          Deprecated. As of GridSim 2.1, replaced by setMachineAndPEID(int, int)
 void setMachineAndPEID(int machineID, int peID)
          Set the machine and PE (Processing Element) ID
 void updateGridletFinishedSoFar(double miLength)
          A method that updates the length of gridlet that has been completed
 void UpdateGridletFinishedSoFar(double miLength)
          Deprecated. As of GridSim 2.1, replaced by updateGridletFinishedSoFar(double)
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResGridlet

public ResGridlet(Gridlet gridlet)
Allocates a new ResGridlet object upon the arrival of a Gridlet object. The arriving time is determined by GridSim.Clock()

Parameters:
gridlet - a gridlet object
See Also:
GridSim.Clock()
Pre Condition:
gridlet != null
Post Condition:
$none
Method Detail

getGridletID

public int getGridletID()
Gets this Gridlet entity Id

Returns:
the Gridlet entity Id
Pre Condition:
$none
Post Condition:
$none

getUserID

public int getUserID()
Gets the user or owner of this Gridlet

Returns:
the Gridlet's user Id
Pre Condition:
$none
Post Condition:
$none

getGridletLength

public double getGridletLength()
Gets the Gridlet's length

Returns:
Gridlet's length
Pre Condition:
$none
Post Condition:
$none

setGridletStatus

public boolean setGridletStatus(int status)
Sets the Gridlet status.

Parameters:
status - the Gridlet status
Returns:
true if the new status has been set, false otherwise
Pre Condition:
status >= 0
Post Condition:
$none

getExecStartTime

public double getExecStartTime()
Gets the Gridlet's execution start time

Returns:
Gridlet's execution start time
Pre Condition:
$none
Post Condition:
$none

setExecParam

public void setExecParam(double wallClockTime,
                         double actualCPUTime)
Sets this Gridlet's execution parameters. These parameters are set by the GridResource before departure or sending back to the original Gridlet's owner.

Parameters:
wallClockTime - the time of this Gridlet resides in a GridResource (from arrival time until departure time).
actualCPUTime - the total execution time of this Gridlet in a GridResource.
Pre Condition:
wallClockTime >= 0.0, actualCPUTime >= 0.0
Post Condition:
$none

SetIDs

public void SetIDs(int machineID,
                   int peID)
Deprecated. As of GridSim 2.1, replaced by setMachineAndPEID(int, int)

Set the machine and PE (Processing Element) ID

Parameters:
machineID - machine ID
peID - PE ID
Pre Condition:
machineID >= 0, peID >= 0
Post Condition:
$none

setMachineAndPEID

public void setMachineAndPEID(int machineID,
                              int peID)
Set the machine and PE (Processing Element) ID

Parameters:
machineID - machine ID
peID - PE ID
Pre Condition:
machineID >= 0, peID >= 0
Post Condition:
$none

GetMachineID

public int GetMachineID()
Deprecated. As of GridSim 2.1, replaced by getMachineID()

Get machine ID

Returns:
machine ID or -1 if it is not specified before
Pre Condition:
$none
Post Condition:
$result >= -1

getMachineID

public int getMachineID()
Get machine ID

Returns:
machine ID or -1 if it is not specified before
Pre Condition:
$none
Post Condition:
$result >= -1

GetPEID

public int GetPEID()
Deprecated. As of GridSim 2.1, replaced by getPEID()

Get PE ID

Returns:
PE ID or -1 if it is not specified before
Pre Condition:
$none
Post Condition:
$result >= -1

getPEID

public int getPEID()
Get PE ID

Returns:
PE ID or -1 if it is not specified before
Pre Condition:
$none
Post Condition:
$result >= -1

GetRemainingLength

public double GetRemainingLength()
Deprecated. As of GridSim 2.1, replaced by getRemainingGridletLength()

Get the remaining gridlet length

Returns:
gridlet length
Pre Condition:
$none
Post Condition:
$result >= 0

getRemainingGridletLength

public double getRemainingGridletLength()
Get the remaining gridlet length

Returns:
gridlet length
Pre Condition:
$none
Post Condition:
$result >= 0

finalizeGridlet

public void finalizeGridlet()
Finalizes all relevant information before exiting the GridResource entity. This method sets the final data of:

Pre Condition:
$none
Post Condition:
$none

UpdateGridletFinishedSoFar

public void UpdateGridletFinishedSoFar(double miLength)
Deprecated. As of GridSim 2.1, replaced by updateGridletFinishedSoFar(double)

A method that updates the length of gridlet that has been completed

Parameters:
miLength - gridlet length in Million Instructions (MI)
Pre Condition:
miLength >= 0.0
Post Condition:
$none

updateGridletFinishedSoFar

public void updateGridletFinishedSoFar(double miLength)
A method that updates the length of gridlet that has been completed

Parameters:
miLength - gridlet length in Million Instructions (MI)
Pre Condition:
miLength >= 0.0
Post Condition:
$none

GetArrivalTime

public double GetArrivalTime()
Deprecated. As of GridSim 2.1, replaced by getGridletArrivalTime()

Get arrival time of a gridlet

Returns:
arrival time
Pre Condition:
$none
Post Condition:
$result >= 0.0

getGridletArrivalTime

public double getGridletArrivalTime()
Get arrival time of a gridlet

Returns:
arrival time
Pre Condition:
$none
Post Condition:
$result >= 0.0

SetFinishTimeForTimeSharedResource

public void SetFinishTimeForTimeSharedResource(double availableRating,
                                               ResourceCalendar rCalendar)
                                        throws NullPointerException
Deprecated. As of GridSim 2.2, replaced by setFinishTime(double). This method is OBSOLETE since it is the responsibility of individual scheduling to come up with the finish time for each Gridlet.

Determine Time by which this Gridlet can finish.
NOTE: To be used by Time shared resources only.

Parameters:
availableRating - the available MIPS considering current hour load
rCalendar - Resourcce Calendar
Throws:
NullPointerException - if ResourceCalendar object is null
Pre Condition:
availableRating > 0.0, rCalendar != null
Post Condition:
$none

setFinishTimeForTimeSharedResource

public void setFinishTimeForTimeSharedResource(double availableRating,
                                               ResourceCalendar rCalendar)
                                        throws NullPointerException
Deprecated. As of GridSim 2.2, replaced by setFinishTime(double). This method is OBSOLETE since it is the responsibility of individual scheduling to come up with the finish time for each Gridlet.

Determine Time by which this Gridlet can finish.
NOTE: To be used by Time shared resources only.

Parameters:
availableRating - the available MIPS considering current hour load
rCalendar - Resourcce Calendar
Throws:
NullPointerException - if ResourceCalendar object is null
Pre Condition:
availableRating > 0.0, rCalendar != null
Post Condition:
$none

SetFinishTimeForSpaceSharedResource

public void SetFinishTimeForSpaceSharedResource(double availableRating)
Deprecated. As of GridSim 2.2, replaced by setFinishTime(double). This method is OBSOLETE since it is the responsibility of individual scheduling to come up with the finish time for each Gridlet.

Determine Time by which this Gridlet can finish.
NOTE: To be used by Space shared resources only.

Parameters:
availableRating - this is 100% availability of PE MIPS since it runs in dedicated mode
Pre Condition:
availableRating > 0.0
Post Condition:
$none

setFinishTimeForSpaceSharedResource

public void setFinishTimeForSpaceSharedResource(double availableRating)
Deprecated. As of GridSim 2.2, replaced by setFinishTime(double). This method is OBSOLETE since it is the responsibility of individual scheduling to come up with the finish time for each Gridlet.

Determine Time by which this Gridlet can finish.
NOTE: To be used by Space shared resources only.

Parameters:
availableRating - this is 100% availability of PE MIPS since it runs in dedicated mode
Pre Condition:
availableRating > 0.0
Post Condition:
$none

setFinishTime

public void setFinishTime(double time)
Sets the finish time for this Gridlet. If time is negative, then it is being ignored.

Parameters:
time - finish time
Pre Condition:
time >= 0.0
Post Condition:
$none

GetFinishTime

public double GetFinishTime()
Deprecated. As of GridSim 2.1, replaced by getGridletFinishTime()

Get the Gridlet's finish time

Returns:
finish time of a gridlet or -1.0 if it cannot finish in this hourly slot
Pre Condition:
$none
Post Condition:
$result >= -1.0

getGridletFinishTime

public double getGridletFinishTime()
Get the Gridlet's finish time

Returns:
finish time of a gridlet or -1.0 if it cannot finish in this hourly slot
Pre Condition:
$none
Post Condition:
$result >= -1.0

GetGridlet

public Gridlet GetGridlet()
Deprecated. As of GridSim 2.1, replaced by getGridlet()

Get this Gridlet object

Returns:
gridlet object
Pre Condition:
$none
Post Condition:
$result != null

getGridlet

public Gridlet getGridlet()
Get this Gridlet object

Returns:
gridlet object
Pre Condition:
$none
Post Condition:
$result != null

getGridletStatus

public int getGridletStatus()
Gets the Gridlet status

Returns:
Gridlet status
Pre Condition:
$none
Post Condition:
$none