GridSim
v3.0

gridsim
Class ResourceCharacteristics

Object
  extended bygridsim.ResourceCharacteristics

public class ResourceCharacteristics
extends Object

GridSim ResourceCharacteristics class represents static properties of a resource such as resource architecture, Operating System (OS), management policy (time- or space-shared), cost and time zone at which the resource is located along resource configuration.

Since:
GridSim Toolkit 1.0
Version:
3.0, May 2004
Author:
Manzur Murshed and Rajkumar Buyya
Invariant:
$none

Field Summary
static int ADVANCE_RESERVATION
          A resource that supports Advanced Reservation mechanisms.
static int OTHER_POLICY_DIFFERENT_RATING
          Assuming all PEs in a Machine have the same rating.
static int OTHER_POLICY_SAME_RATING
          Assuming all PEs in all Machines have the same rating.
static int SPACE_SHARED
          Spaced-shared system using First Come First Serve (FCFS) algorithm
static int TIME_SHARED
          Time-shared system using Round-Robin algorithm
 
Constructor Summary
ResourceCharacteristics(String architecture, String OS, MachineList machineList, int allocationPolicy, double timeZone, double costPerSec)
          Allocates a new ResourceCharacteristics object.
 
Method Summary
 int ByteSize()
          Deprecated. As of GridSim 2.1, replaced by getByteSize()
 double CPU_time(double gridletLength, double load)
          Deprecated. As of GridSim 2.1, replaced by getCPUTime(double, double)
 int GetAllocationPolicy()
          Deprecated. As of GridSim 2.1, replaced by getResourceAllocationPolicy()
 String GetArch()
          Deprecated. As of GridSim 2.1, replaced by getResourceArch()
 int getByteSize()
          Gets the byte size of this class
 double getCostPerMI()
          Gets the cost per Millions Instruction (MI) associated with a resource
 double GetCostPerMI()
          Deprecated. As of GridSim 2.1, replaced by getCostPerMI()
 double getCostPerSec()
          Gets the cost per second associated with a resource
 double GetCostPerSec()
          Deprecated. As of GridSim 2.1, replaced by getCostPerSec()
 double getCPUTime(double gridletLength, double load)
          Gets the CPU time given the specified parameters (only for TIME_SHARED).
 int GetID()
          Deprecated. As of GridSim 2.1, replaced by getResourceID()
 MachineList getMachineList()
          Gets the list of machines in a resouce
 MachineList GetMachines()
          Deprecated. As of GridSim 2.1, replaced by getMachineList()
 Machine getMachineWithFreePE()
          Gets a Machine with at least one empty PE
 Machine getMachineWithFreePE(int numPE)
          Gets a Machine with at least a given number of free PE
 int getMIPSRating()
          Gets the total MIPS rating, which is the sum of MIPS rating of all machines in a resource.
 int GetMIPSRating()
          Deprecated. As of GridSim 2.1, replaced by getMIPSRating()
 int getMIPSRatingOfOnePE()
          Gets Millions Instructions Per Second (MIPS) Rating of a Processing Element (PE).
 int GetMIPSRatingOfOnePE()
          Deprecated. As of GridSim 2.1, replaced by getMIPSRatingOfOnePE()
 int getMIPSRatingOfOnePE(int id, int peID)
          Gets Millions Instructions Per Second (MIPS) Rating of a Processing Element (PE).
 int GetMIPSRatingOfOnePE(int id, int peID)
          Deprecated. As of GridSim 2.1, replaced by getMIPSRatingOfOnePE(int, int)
 String GetName()
          Deprecated. As of GridSim 2.1, replaced by getResourceName()
 int GetNoOfPEs()
          Deprecated. As of GridSim 2.1, replaced by getNumPE()
 int getNumBusyPE()
          Gets the total number of BUSY PEs for all Machines
 int getNumFreePE()
          Gets the total number of FREE or non-busy PEs for all Machines
 int getNumPE()
          Gets the total number of PEs for all Machines
 String GetOS()
          Deprecated. As of GridSim 2.1, replaced by getResourceOS()
 int getResourceAllocationPolicy()
          Gets the resource allocation policy
 String getResourceArch()
          Gets the resource architecture name
 int getResourceID()
          Gets the resource ID
 String getResourceName()
          Gets the name of a resource
 String getResourceOS()
          Gets the Operating System (OS) this resource is used
 double getResourceTimeZone()
          Gets the resource time zone
 double GetTimeZone()
          Deprecated. As of GridSim 2.1, replaced by getResourceTimeZone()
 void setCostPerSec(double costPerSec)
          Sets the cost per second associated with a resource
 void SetCostPerSec(double costPerSec)
          Deprecated. As of GridSim 2.1, replaced by setCostPerSec(double)
 void SetID(int id)
          Deprecated. As of GridSim 2.1, replaced by setResourceID(int)
 void setResourceID(int id)
          Sets the resource ID
 boolean setStatusPE(boolean status, int machineID, int peID)
          Sets the particular PE status on a Machine
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TIME_SHARED

public static final int TIME_SHARED
Time-shared system using Round-Robin algorithm

See Also:
Constant Field Values

SPACE_SHARED

public static final int SPACE_SHARED
Spaced-shared system using First Come First Serve (FCFS) algorithm

See Also:
Constant Field Values

OTHER_POLICY_SAME_RATING

public static final int OTHER_POLICY_SAME_RATING
Assuming all PEs in all Machines have the same rating.

See Also:
Constant Field Values

OTHER_POLICY_DIFFERENT_RATING

public static final int OTHER_POLICY_DIFFERENT_RATING
Assuming all PEs in a Machine have the same rating. However, each Machine has different rating to each other.

See Also:
Constant Field Values

ADVANCE_RESERVATION

public static final int ADVANCE_RESERVATION
A resource that supports Advanced Reservation mechanisms.

See Also:
Constant Field Values
Constructor Detail

ResourceCharacteristics

public ResourceCharacteristics(String architecture,
                               String OS,
                               MachineList machineList,
                               int allocationPolicy,
                               double timeZone,
                               double costPerSec)
Allocates a new ResourceCharacteristics object. If the time zone is invalid, then by default, it will be GMT+0.

Parameters:
architecture - the architecture of a resource
OS - the operating system used
machineList - list of machines in a resource
allocationPolicy - the resource allocation policy
timeZone - local time zone of a user that owns this reservation. Time zone should be of range [GMT-12 ... GMT+13]
costPerSec - the cost per sec to use this resource
Pre Condition:
architecture != null, OS != null, machineList != null, allocationPolicy >= 0 && allocationPolicy <= 3, timeZone >= -12 && timeZone <= 13, costPerSec >= 0.0
Post Condition:
$none
Method Detail

SetID

public void SetID(int id)
Deprecated. As of GridSim 2.1, replaced by setResourceID(int)

Sets the resource ID

Parameters:
id - the resource ID
Pre Condition:
id >= 0
Post Condition:
$none

setResourceID

public void setResourceID(int id)
Sets the resource ID

Parameters:
id - the resource ID
Pre Condition:
id >= 0
Post Condition:
$none

GetID

public int GetID()
Deprecated. As of GridSim 2.1, replaced by getResourceID()

Gets the resource ID

Returns:
the resource ID
Pre Condition:
$none
Post Condition:
$result >= 0

getResourceID

public int getResourceID()
Gets the resource ID

Returns:
the resource ID
Pre Condition:
$none
Post Condition:
$result >= 0

GetName

public String GetName()
Deprecated. As of GridSim 2.1, replaced by getResourceName()

Gets the name of a resource

Returns:
the resource name
Pre Condition:
$none
Post Condition:
$result != null

getResourceName

public String getResourceName()
Gets the name of a resource

Returns:
the resource name
Pre Condition:
$none
Post Condition:
$result != null

GetArch

public String GetArch()
Deprecated. As of GridSim 2.1, replaced by getResourceArch()

Gets the resource architecture name

Returns:
the architecture name
Pre Condition:
$none
Post Condition:
$result != null

getResourceArch

public String getResourceArch()
Gets the resource architecture name

Returns:
the architecture name
Pre Condition:
$none
Post Condition:
$result != null

GetOS

public String GetOS()
Deprecated. As of GridSim 2.1, replaced by getResourceOS()

Gets the Operating System (OS) this resource is used

Returns:
the name of OS
Pre Condition:
$none
Post Condition:
$result != null

getResourceOS

public String getResourceOS()
Gets the Operating System (OS) this resource is used

Returns:
the name of OS
Pre Condition:
$none
Post Condition:
$result != null

GetMachines

public MachineList GetMachines()
Deprecated. As of GridSim 2.1, replaced by getMachineList()

Gets the list of machines in a resouce

Returns:
a MachineList object
See Also:
MachineList
Pre Condition:
$none
Post Condition:
$result != null

getMachineList

public MachineList getMachineList()
Gets the list of machines in a resouce

Returns:
a MachineList object
See Also:
MachineList
Pre Condition:
$none
Post Condition:
$result != null

getMachineWithFreePE

public Machine getMachineWithFreePE()
Gets a Machine with at least one empty PE

Returns:
a Machine object or null if not found
Pre Condition:
$none
Post Condition:
$none

getMachineWithFreePE

public Machine getMachineWithFreePE(int numPE)
Gets a Machine with at least a given number of free PE

Parameters:
numPE - number of PE
Returns:
a Machine object or null if not found
Pre Condition:
$none
Post Condition:
$none

GetAllocationPolicy

public int GetAllocationPolicy()
Deprecated. As of GridSim 2.1, replaced by getResourceAllocationPolicy()

Gets the resource allocation policy

Returns:
the allocation policy
Pre Condition:
$none
Post Condition:
$result >= 0 && $result <= 2

getResourceAllocationPolicy

public int getResourceAllocationPolicy()
Gets the resource allocation policy

Returns:
the allocation policy
Pre Condition:
$none
Post Condition:
$result >= 0 && $result <= 2

GetTimeZone

public double GetTimeZone()
Deprecated. As of GridSim 2.1, replaced by getResourceTimeZone()

Gets the resource time zone

Returns:
the time zone
Pre Condition:
$none
Post Condition:
$none

getResourceTimeZone

public double getResourceTimeZone()
Gets the resource time zone

Returns:
the time zone
Pre Condition:
$none
Post Condition:
$none

GetMIPSRatingOfOnePE

public int GetMIPSRatingOfOnePE()
Deprecated. As of GridSim 2.1, replaced by getMIPSRatingOfOnePE()

Gets Millions Instructions Per Second (MIPS) Rating of a Processing Element (PE). It is assumed all PEs' rating is same in a given machine.

Returns:
the MIPS Rating or -1 if no PEs are exists.
Pre Condition:
$none
Post Condition:
$result >= -1

getMIPSRatingOfOnePE

public int getMIPSRatingOfOnePE()
Gets Millions Instructions Per Second (MIPS) Rating of a Processing Element (PE). It is assumed all PEs' rating is same in a given machine.

Returns:
the MIPS Rating or -1 if no PEs are exists.
Pre Condition:
$none
Post Condition:
$result >= -1

GetMIPSRatingOfOnePE

public int GetMIPSRatingOfOnePE(int id,
                                int peID)
Deprecated. As of GridSim 2.1, replaced by getMIPSRatingOfOnePE(int, int)

Gets Millions Instructions Per Second (MIPS) Rating of a Processing Element (PE). It is essential to use this method when a resource is made up of heterogenous PEs/machines.

Parameters:
id - the machine ID
peID - the PE ID
Returns:
the MIPS Rating or -1 if no PEs are exists.
Pre Condition:
id >= 0, peID >= 0
Post Condition:
$result >= -1

getMIPSRatingOfOnePE

public int getMIPSRatingOfOnePE(int id,
                                int peID)
Gets Millions Instructions Per Second (MIPS) Rating of a Processing Element (PE). It is essential to use this method when a resource is made up of heterogenous PEs/machines.

Parameters:
id - the machine ID
peID - the PE ID
Returns:
the MIPS Rating or -1 if no PEs are exists.
Pre Condition:
id >= 0, peID >= 0
Post Condition:
$result >= -1

GetMIPSRating

public int GetMIPSRating()
Deprecated. As of GridSim 2.1, replaced by getMIPSRating()

Gets the total MIPS rating, which is the sum of MIPS rating of all machines in a resource

Returns:
the sum of MIPS ratings
Pre Condition:
$none
Post Condition:
$result >= 0

getMIPSRating

public int getMIPSRating()
Gets the total MIPS rating, which is the sum of MIPS rating of all machines in a resource.

Total MIPS rating for:

Returns:
the sum of MIPS ratings
Pre Condition:
$none
Post Condition:
$result >= 0

CPU_time

public double CPU_time(double gridletLength,
                       double load)
Deprecated. As of GridSim 2.1, replaced by getCPUTime(double, double)

Gets the CPU time given the specified parameters

Parameters:
gridletLength - the length of a Gridlet
load - the load of a Gridlet
Returns:
the CPU time
Pre Condition:
gridletLength >= 0.0, load >= 0.0
Post Condition:
$result >= 0.0

getCPUTime

public double getCPUTime(double gridletLength,
                         double load)
Gets the CPU time given the specified parameters (only for TIME_SHARED). NOTE: The CPU time for SPACE_SHARED and ADVANCE_RESERVATION are not yet implemented.

Parameters:
gridletLength - the length of a Gridlet
load - the load of a Gridlet
Returns:
the CPU time
Pre Condition:
gridletLength >= 0.0, load >= 0.0
Post Condition:
$result >= 0.0

GetNoOfPEs

public int GetNoOfPEs()
Deprecated. As of GridSim 2.1, replaced by getNumPE()

Gets the total number of PEs for all Machines

Returns:
number of PEs
Pre Condition:
$none
Post Condition:
$result >= 0

getNumPE

public int getNumPE()
Gets the total number of PEs for all Machines

Returns:
number of PEs
Pre Condition:
$none
Post Condition:
$result >= 0

getNumFreePE

public int getNumFreePE()
Gets the total number of FREE or non-busy PEs for all Machines

Returns:
number of PEs
Pre Condition:
$none
Post Condition:
$result >= 0

getNumBusyPE

public int getNumBusyPE()
Gets the total number of BUSY PEs for all Machines

Returns:
number of PEs
Pre Condition:
$none
Post Condition:
$result >= 0

setStatusPE

public boolean setStatusPE(boolean status,
                           int machineID,
                           int peID)
Sets the particular PE status on a Machine

Parameters:
status - PE status, either PE.FREE or PE.BUSY
machineID - Machine ID
peID - PE id
Returns:
true if the PE status has changed, false otherwise (Machine id or PE id might not be exist)
Pre Condition:
machineID >= 0, peID >= 0
Post Condition:
$none

SetCostPerSec

public void SetCostPerSec(double costPerSec)
Deprecated. As of GridSim 2.1, replaced by setCostPerSec(double)

Sets the cost per second associated with a resource

Parameters:
costPerSec - the cost using a resource
Pre Condition:
costPerSec >= 0.0
Post Condition:
$none

setCostPerSec

public void setCostPerSec(double costPerSec)
Sets the cost per second associated with a resource

Parameters:
costPerSec - the cost using a resource
Pre Condition:
costPerSec >= 0.0
Post Condition:
$none

GetCostPerSec

public double GetCostPerSec()
Deprecated. As of GridSim 2.1, replaced by getCostPerSec()

Gets the cost per second associated with a resource

Returns:
the cost using a resource
Pre Condition:
$none
Post Condition:
$result >= 0.0

getCostPerSec

public double getCostPerSec()
Gets the cost per second associated with a resource

Returns:
the cost using a resource
Pre Condition:
$none
Post Condition:
$result >= 0.0

GetCostPerMI

public double GetCostPerMI()
Deprecated. As of GridSim 2.1, replaced by getCostPerMI()

Gets the cost per Millions Instruction (MI) associated with a resource

Returns:
the cost using a resource
Pre Condition:
$none
Post Condition:
$result >= 0.0

getCostPerMI

public double getCostPerMI()
Gets the cost per Millions Instruction (MI) associated with a resource

Returns:
the cost using a resource
Pre Condition:
$none
Post Condition:
$result >= 0.0

ByteSize

public int ByteSize()
Deprecated. As of GridSim 2.1, replaced by getByteSize()

Gets the byte size of this class

Returns:
the byte size
Pre Condition:
$none
Post Condition:
$result > 0

getByteSize

public int getByteSize()
Gets the byte size of this class

Returns:
the byte size
Pre Condition:
$none
Post Condition:
$result > 0

GridSim
v3.0

The University of Melbourne, Australia, 2004