gridsim
Class MachineList

Object
  extended byAbstractCollection
      extended byAbstractList
          extended byAbstractSequentialList
              extended byLinkedList
                  extended bygridsim.MachineList
All Implemented Interfaces:
Cloneable, Collection, List, Serializable

public class MachineList
extends LinkedList

GridSim MachineList simulates a collection of machines. It is up to the GridSim users to define the connectivity among the machines in a collection. Therefore, this class can be instantiated to model a simple LAN to cluster to WAN.

Version:
2.2, December 2003
Author:
Manzur Murshed and Rajkumar Buyya
See Also:
Serialized Form
Invariant:
$none

Field Summary
 
Fields inherited from class AbstractList
modCount
 
Constructor Summary
MachineList()
          Allocates a new MachineList object
 
Method Summary
 int ByteSize()
          Deprecated. As of GridSim 2.1, replaced by getByteSize()
 int getByteSize()
          Gets the byte size of this class
 Machine getMachine(int id)
          Gets the Machine object for a particular ID
 Machine GetMachine(int id)
          Deprecated. As of GridSim 2.1, replaced by getMachine(int)
 Machine getMachineWithFreePE()
          Gets a Machine with free PE
 Machine GetMachineWithFreePE()
          Deprecated. As of GridSim 2.1, replaced by getMachineWithFreePE()
 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
 boolean setStatusPE(boolean status, int machineID, int peID)
          Sets the particular PE status on a Machine
 
Methods inherited from class LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, remove, remove, removeFirst, removeLast, 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
 

Constructor Detail

MachineList

public MachineList()
Allocates a new MachineList object

Pre Condition:
$none
Post Condition:
$none
Method Detail

GetMachine

public Machine GetMachine(int id)
Deprecated. As of GridSim 2.1, replaced by getMachine(int)

Gets the Machine object for a particular ID

Parameters:
id - the machine ID
Returns:
the Machine object or null if no machine exists
See Also:
Machine
Pre Condition:
id > 0
Post Condition:
$none

getMachine

public Machine getMachine(int id)
Gets the Machine object for a particular ID

Parameters:
id - the machine ID
Returns:
the Machine object or null if no machine exists
See Also:
Machine
Pre Condition:
id >= 0
Post Condition:
$none

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

GetMachineWithFreePE

public Machine GetMachineWithFreePE()
Deprecated. As of GridSim 2.1, replaced by getMachineWithFreePE()

Gets a Machine with free PE

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

getMachineWithFreePE

public Machine getMachineWithFreePE()
Gets a Machine with free PE

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

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

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