GridSim 5.0 beta

gridsim
Class PEList

Object
  extended by AbstractCollection<E>
      extended by AbstractList<E>
          extended by AbstractSequentialList<E>
              extended by LinkedList<PE>
                  extended by PEList
All Implemented Interfaces:
Serializable, Cloneable, Iterable<PE>, Collection<PE>, Deque<PE>, List<PE>, Queue<PE>

public class PEList
extends LinkedList<PE>

GridSim PEList maintains a list of PEs (Processing Elements) that make up a machine.

Since:
GridSim Toolkit 1.0
Author:
Manzur Murshed and Rajkumar Buyya
See Also:
Serialized Form
Invariant:
$none

Field Summary
 
Fields inherited from class AbstractList
modCount
 
Constructor Summary
PEList()
           
 
Method Summary
 int getByteSize()
          Gets the byte size of PEList internal data members
 int getFreePEID()
          Gets a PE ID which is FREE
 int getMIPSRating(int id)
          Gets MIPS Rating for a specified PE ID
 int getNumBusyPE()
          Gets the number of BUSY PE
 int getNumFreePE()
          Gets the number of FREE or non-busy PE.
 void setStatusFailed(boolean fail)
          Sets the status of PEs of this machine to FAILED.
 void setStatusFailed(String resName, int machineID, boolean fail)
          Sets the status of PEs of this machine to FAILED.
 boolean setStatusPE(boolean status, int peID)
          Sets the PE status
 
Methods inherited from class LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, toArray, toArray
 
Methods inherited from class AbstractSequentialList
iterator
 
Methods inherited from class AbstractList
equals, hashCode, listIterator, removeRange, subList
 
Methods inherited from class AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toString
 
Methods inherited from class Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList
 
Methods inherited from interface Deque
iterator
 

Constructor Detail

PEList

public PEList()
Method Detail

getMIPSRating

public int getMIPSRating(int id)
Gets MIPS Rating for a specified PE ID

Parameters:
id - the PE ID
Returns:
the MIPS rating if exists, otherwise returns -1
Pre Condition:
id >= 0
Post Condition:
$none

getFreePEID

public int getFreePEID()
Gets a PE ID which is FREE

Returns:
a PE ID if it is FREE, otherwise returns -1
Pre Condition:
$none
Post Condition:
$none

getNumFreePE

public int getNumFreePE()
Gets the number of FREE or non-busy PE.

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

setStatusPE

public boolean setStatusPE(boolean status,
                           int peID)
Sets the PE status

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

getNumBusyPE

public int getNumBusyPE()
Gets the number of BUSY PE

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

getByteSize

public int getByteSize()
Gets the byte size of PEList internal data members

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

setStatusFailed

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

Parameters:
resName - the name of the resource
machineID - the id of this machine
fail - the new value for the "failed" parameter

setStatusFailed

public void setStatusFailed(boolean fail)
Sets the status of PEs of this machine to FAILED.

Parameters:
fail - the new value for the "failed" parameter

GridSim 5.0 beta

The University of Melbourne, Australia, 2009