GridSim 5.0 beta

gridsim
Class Machine

Object
  extended by Machine

public class Machine
extends Object

GridSim Machine class represents an uniprocessor or shared memory multiprocessor machine. It can contain one or more Processing Elements (PEs).

Since:
GridSim Toolkit 1.0
Author:
Manzur Murshed and Rajkumar Buyya
Invariant:
$none

Constructor Summary
Machine(int id, int numPE, int ratingPE)
          Allocates a new Machine object
Machine(int id, PEList list)
          Deprecated. as of GridSim version 5.0, you should use Machine(int,int,int)
 
Method Summary
 int getByteSize()
          Gets the byte size of this class
 boolean getFailed()
          Checks whether this machine is failed or not.
 int getMachineID()
          Gets the machine ID
 int getMIPSRating()
          Gets the Millions Instruction Per Second (MIPS) Rating.
 int getNumBusyPE()
          Gets the number of BUSY PE for this Machine
 int getNumFreePE()
          Gets the number of FREE or non-busy PE for this Machine
 int getNumPE()
          Gets the number of PE for this Machine
 PEList getPEList()
          Gets the linked-list of all PEs
 int getSize()
          Gets the number of PEs
 boolean setFailed(boolean fail)
          Sets the PEs of this machine to a FAILED status.
 boolean setFailed(String resName, boolean fail)
          Sets the PEs of this machine to a FAILED status.
 boolean setStatusPE(boolean status, int peID)
          Sets the particular PE status on this Machine
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Machine

public Machine(int id,
               int numPE,
               int ratingPE)
Allocates a new Machine object

Parameters:
id - the machine ID
numPE - the number of PEs in this machine
ratingPE - the rating in MIPS of a resource in this machine
Since:
5.0
Pre Condition:
id > 0, numPE > 0, ratingPE > 0
Post Condition:
$none

Machine

public Machine(int id,
               PEList list)
Deprecated. as of GridSim version 5.0, you should use Machine(int,int,int)

Allocates a new Machine object

Parameters:
id - the machine ID
list - list of PEs
Pre Condition:
id > 0, list != null
Post Condition:
$none
Method Detail

getMachineID

public int getMachineID()
Gets the machine ID

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

getSize

public int getSize()
Gets the number of PEs

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

getPEList

public PEList getPEList()
Gets the linked-list of all PEs

Returns:
the linked-list of all PEs
See Also:
PEList
Pre Condition:
$none
Post Condition:
$result != null

getMIPSRating

public int getMIPSRating()
Gets the Millions Instruction Per Second (MIPS) Rating. However, for Shared Memory Multiprocessors (SMPs), it is is generally assumed that all PEs have the same rating.

Returns:
the sum of MIPS rating of all PEs in a machine.
Pre Condition:
$none
Post Condition:
$result >= 0

setStatusPE

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

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

getNumPE

public int getNumPE()
Gets the number of PE for this Machine

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

getNumFreePE

public int getNumFreePE()
Gets the number of FREE or non-busy PE for this Machine

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

getNumBusyPE

public int getNumBusyPE()
Gets the number of BUSY PE for this Machine

Returns:
number of PE
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

setFailed

public boolean setFailed(String resName,
                         boolean fail)
Sets the PEs of this machine to a FAILED status. NOTE: resName is used for debugging purposes, which is ON by default. Use setFailed(boolean) if you do not want this information.

Parameters:
resName - the name of the resource
fail - true if this machine fails or false otherwise
Returns:
true if successful, false otherwise

setFailed

public boolean setFailed(boolean fail)
Sets the PEs of this machine to a FAILED status.

Parameters:
fail - true if this machine fails or false otherwise
Returns:
true if successful, false otherwise

getFailed

public boolean getFailed()
Checks whether this machine is failed or not.

Returns:
true if this machine is failed, false otherwise

GridSim 5.0 beta

The University of Melbourne, Australia, 2009